-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver.example.yml
More file actions
179 lines (168 loc) · 5.43 KB
/
Copy pathserver.example.yml
File metadata and controls
179 lines (168 loc) · 5.43 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# 服务监听主机,默认对外监听所有网卡
host: "0.0.0.0"
# HTTP 监听端口
port: 8080
# JWT 鉴权配置
jwt:
# JWT 域名,通常用于生成和校验 token 时的上下文信息
domain: "http://localhost:8080"
# JWT 目标受众,客户端在校验 token 时应与此值一致
audience: "timeflow-client"
# JWT 认证域,会出现在认证失败提示中
realm: "TimeFlow API"
# JWT 签发者标识
issuer: "timeflow-api"
# 使用 OpenSSL 生成 ES256 (P-256) 私钥:
# openssl ecparam -genkey -name prime256v1 -noout -out jwt-private.pem
# 从私钥导出对应的公钥:
# openssl ec -in jwt-private.pem -pubout -out jwt-public.pem
# JWT 私钥文件路径;文件不存在时服务可按当前逻辑自动生成
privateKeyPath: "jwt-private.pem"
# JWT 公钥文件路径;用于校验访问令牌
publicKeyPath: "jwt-public.pem"
# PostgreSQL 数据库配置
postgres:
# 数据库主机名或 IP
host: "localhost"
# 数据库端口
port: "5432"
# 数据库名称
database: "timeflow"
# 数据库用户名
user: ""
# 数据库密码
password: ""
# 数据库连接池最大连接数
maximumPoolSize: 10
# 邮件发送与邮箱验证码配置
email:
# 是否启用邮箱验证码校验;关闭后注册时无需提交验证码
verificationEnabled: true
# SMTP 服务器地址
host: ""
# SMTP 服务器端口
port: "465"
# SMTP 登录用户名
username: ""
# SMTP 登录密码或授权码
password: ""
# 发件人邮箱地址
from: ""
# 是否启用 SSL 直连 SMTP
ssl: true
# 验证码有效期,单位为分钟
codeExpirationMinutes: 10
# Cloudflare Turnstile 人机校验配置
turnstile:
# 是否启用 Turnstile 校验
enabled: false
# Turnstile 服务端密钥
secretKey: ""
# Turnstile 校验接口地址,通常无需修改
siteVerifyUrl: "https://challenges.cloudflare.com/turnstile/v0/siteverify"
# HTTP 相关中间件与安全策略
http:
# 标准 Forwarded 请求头支持,通常在反向代理后启用
forwardedHeaders:
# 是否启用 ForwardedHeaders
enabled: true
# 兼容 X-Forwarded-* 请求头,通常在 Nginx 或 Cloudflare 后启用
xForwardedHeaders:
# 是否启用 XForwardedHeaders
enabled: true
# CORS 跨域配置
cors:
# 是否启用 CORS
enabled: false
# 是否允许任意来源访问;生产环境通常应保持为 false
anyHost: false
# 允许访问的来源列表;多个来源时按服务支持的格式填写
allowedHosts: ""
# 是否允许跨域请求携带凭据(如 Cookie、Authorization)
allowCredentials: false
# HSTS 配置,要求浏览器后续始终使用 HTTPS
hsts:
# 是否启用 HSTS
enabled: false
# 是否对子域名一并生效
includeSubDomains: true
# 是否声明允许加入浏览器 HSTS preload 列表
preload: false
# HSTS 最大缓存时间,单位为秒
maxAgeInSeconds: 31536000
# HTTP 到 HTTPS 的自动重定向配置
httpsRedirect:
# 是否启用 HTTPS 重定向
enabled: false
# HTTPS 服务端口
sslPort: 443
# 是否使用永久重定向(301/308)
permanentRedirect: true
# 同步配置
sync:
# 每用户允许同步的最大课程表总数(含回收站)
scheduleQuota: 15
# AI 课程表识别配置
ai:
# 是否启用 AI 课程表图片提取功能
enabled: false
# 图片最大字节数,超出时服务端会自动缩放(默认 2MB)
maxImageSizeBytes: 2097152
# 图片最大分辨率(长边像素),超出时自动缩放
maxImageResolution: 2048
# 每用户每 6 个月的默认 AI 提取配额
quotaPerHalfYear: 4
# LLM 提供商配置,每个提供商定义协议格式、API 密钥和可选的自定义端点
# format 支持: openai, openrouter, google, anthropic, ollama
# 每个 format 都支持通过 endpoint 自定义 API 地址
providers:
# 示例: NVIDIA API (OpenAI 兼容)
nvidia:
format: "openai"
apiKey: ""
endpoint: "https://integrate.api.nvidia.com/v1/chat/completions"
# 示例: OpenRouter
# openrouter:
# format: "openrouter"
# apiKey: ""
# 示例: OpenAI 直连
# openai:
# format: "openai"
# apiKey: ""
# 示例: Google Gemini
# google:
# format: "google"
# apiKey: ""
# 示例: Anthropic Claude
# anthropic:
# format: "anthropic"
# apiKey: ""
# 示例: 本地 Ollama
# ollama:
# format: "ollama"
# apiKey: ""
# endpoint: "http://localhost:11434"
# 可用模型列表,每个模型引用一个 provider
# weight: 权重,越大被选中概率越高(默认 1)
# rpm: 每分钟请求上限,0 表示不限(可选)
# rpd: 每天请求上限,0 表示不限(可选)
# 请求时按权重随机选择模型,若失败则自动尝试其他模型,全部失败才返回错误
models:
- id: "qwen/qwen3.5-122b-a10b"
provider: nvidia
weight: 1
# - id: "google/gemini-2.5-flash"
# provider: openrouter
# weight: 2
# rpm: 10
# rpd: 1000
# Web 应用静态包配置
webApp:
# 是否由后端直接托管前端 Web 应用
serveEnabled: true
# 留空时:若当前构建包含内置 web zip,则直接使用内置资源。
# 非空时:直接使用这里指定的文件系统路径中的 web app zip。
zipPath: ""
# Web 应用的 URL 路径,默认 "app" 即 /app/
# 设置为 "/" 可在根路径提供 Web 应用
location: "app"