Repository navigation
Expand file tree
/
Copy pathconfig.example.toml
More file actions
64 lines (56 loc) · 1.86 KB
/
Copy pathconfig.example.toml
File metadata and controls
64 lines (56 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[server]
host = "127.0.0.1"
port = 3000
workers = 0 # 0 = auto (num_cpus)
temp_dir = ".tmp"
upload_temp_dir = ".uploads"
start_mode = "primary" # "primary" | "follower"
[server.follower]
remote_storage_target_local_root = "remote-storage-targets"
[database]
url = "sqlite://asterdrive.db?mode=rwc" # 或 postgres://user:pass@localhost/asterdrive
pool_size = 10
retry_count = 3
[auth]
jwt_secret = "change-me-in-production"
share_cookie_secret = "change-me-in-production-share-cookie"
direct_link_secret = "change-me-in-production-direct-link"
mfa_secret_key = "change-me-in-production-mfa"
storage_credential_secret_key = "change-me-in-production-storage-credential"
bootstrap_insecure_cookies = false # 仅首次初始化 auth_cookie_secure 时生效;纯 HTTP 首启可临时设为 true
[cache]
backend = "memory" # "memory" | "redis"
endpoint = ""
default_ttl = 3600
[config_sync]
backend = "disabled" # "disabled" | "redis"
endpoint = ""
topic = "aster_drive.config_reload"
[logging]
level = "info" # trace | debug | info | warn | error
format = "text" # "text" | "json"
file = "" # 留空 = stdout only
enable_rotation = true # 按天轮转(仅 file 非空时生效)
max_backups = 5 # 保留的历史日志文件数量
[webdav]
prefix = "/webdav"
payload_limit = 10737418240 # 10 GiB
# Rate limiting 配置(默认不启用,按需开启)
# [rate_limit]
# enabled = true
#
# [rate_limit.auth] # 认证接口:登录/注册/refresh(防暴力破解)
# seconds_per_request = 2
# burst_size = 5
#
# [rate_limit.public] # 公开分享访问(匿名)
# seconds_per_request = 1
# burst_size = 30
#
# [rate_limit.api] # 已认证一般读写接口
# seconds_per_request = 1
# burst_size = 120
#
# [rate_limit.write] # 批量操作 / 管理后台(高成本写操作)
# seconds_per_request = 2
# burst_size = 10