-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
133 lines (120 loc) · 3.37 KB
/
config.example.yaml
File metadata and controls
133 lines (120 loc) · 3.37 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# LINUX DO CDK Config
# Copy to config.yaml for runtime
# App
app:
app_name: "linux-do-cdk"
env: "development" # development, testing, production
addr: ":8000"
session_cookie_name: "linux_do_cdk_session_id" # change this in local dev env
session_secret: "<uniq string>" # you can't change this after first time start
session_domain: ".linux.do"
session_age: 86400
session_secure: false
session_http_only: false
api_prefix: "/api"
# projectApp
projectApp:
hidden_threshold: 5 # project hidden threshold
deduction_per_offense: 5 # deduction per offense
# rate limit for creating projects for level 0-4
create_project_rate_limit:
- interval_seconds: 60
max_count: 1
- interval_seconds: 60
max_count: 3
- interval_seconds: 60
max_count: 5
- interval_seconds: 60
max_count: 10
- interval_seconds: 60
max_count: 20
# OAuth2
oauth2:
client_id: "<OAUTH2_CLIENT_ID>"
client_secret: "<OAUTH2_CLIENT_SECRET>"
redirect_uri: "<OAUTH2_REDIRECT_URI>"
# alternative domain: connect.linuxdo.org
authorization_endpoint: "https://connect.linux.do/oauth2/authorize"
token_endpoint: "https://connect.linux.do/oauth2/token"
user_endpoint: "https://connect.linux.do/api/user"
# DB
database:
enabled: true
host: "127.0.0.1"
port: 3306
username: "root"
password: ""
database: "linux_do_cdk"
max_idle_conn: 10
max_open_conn: 100
conn_max_lifetime: 3600
log_level: "info" # error, warn, info, debug, silent
slow_threshold: 200ms
ignore_record_not_found_error: false
# clickhouse
clickhouse:
enabled: false
hosts:
- "127.0.0.1:9000"
username: "default"
password: ""
database: "linux_do_cdk"
max_idle_conn: 10
max_open_conn: 100
conn_max_lifetime: 3600
dial_timeout: 5
# Redis config
redis:
enabled: true
host: "127.0.0.1"
port: 6379
username: ""
password: ""
db: 0
pool_size: 100
min_idle_conn: 10
dial_timeout: 5
read_timeout: 3
write_timeout: 3
# Log
log:
level: "info" # debug, info, warn, error, fatal, panic
format: "json" # text, json
output: "stdout" # stdout, file
file_path: "./logs/app.log"
max_size: 100
max_age: 30
max_backups: 10
compress: true
# Schedule
schedule:
user_badge_score_dispatch_interval_seconds: 1
update_user_badges_scores_task_cron: "0 2 * * *"
update_all_badges_task_cron: "0 1 * * *"
expire_stale_payment_orders_cron: "*/1 * * * *" # 扫描超时未付款订单的频率
# Worker
worker:
concurrency: 50
# linuxDo
linuxDo:
api_key: "<LINUX_DO_API_KEY>"
# OpenAPI Risk
openapi_risk:
enabled: false
base_url: "https://audit.example.com"
username: "<OPENAPI_USERNAME>"
password: "<OPENAPI_PASSWORD>"
cache_ttl_seconds: 3600
prompt_risk_levels: []
block_risk_levels: []
# OpenTelemetry 配置
otel:
sampling_rate: 0.1 # 采样率 0.0-1.0
# Payment (LDC Credit EasyPay-compatible)
payment:
enabled: false
api_url: "https://credit.linux.do/epay" # 易支付网关地址
notify_base_url: "http://cdk.cdk.svc.cluster.local" # CDK 的内网或公网地址,供支付网关回调使用
redirect_base_url: "https://cdk.linux.do" # 支付完成后跳转的 URL 基址
config_encryption_key: "<32-char-secret-key!!>" # AES-256 密钥,恰好 32 字节,首次部署后不可更改
order_expire_minutes: 10 # 订单未付款超时时间(分钟)