2025-12-21 10:23:25 +08:00
|
|
|
[server]
|
2026-03-05 20:19:35 +08:00
|
|
|
# 服务监听端口
|
2025-12-21 10:23:25 +08:00
|
|
|
port = 8052
|
2026-03-05 20:19:35 +08:00
|
|
|
# 服务监听地址
|
2025-12-21 10:23:25 +08:00
|
|
|
host = 0.0.0.0
|
2026-01-13 18:18:50 +08:00
|
|
|
# URL前缀,例如 /baihu,留空则无前缀
|
|
|
|
|
# 配置后:前端路径为 /baihu/*,后端API路径为 /baihu/api/v1/*
|
|
|
|
|
url_prefix =
|
2026-06-16 16:26:52 +08:00
|
|
|
# 全局会话 Cookie 名称
|
|
|
|
|
cookie_name = BHToken
|
2025-12-21 10:23:25 +08:00
|
|
|
|
|
|
|
|
[database]
|
2026-03-05 20:19:35 +08:00
|
|
|
# 数据库类型: sqlite, mysql, postgres
|
2025-12-21 10:23:25 +08:00
|
|
|
type = sqlite
|
2026-03-05 20:19:35 +08:00
|
|
|
# 数据库连接地址 (mysql/postgres)
|
2025-12-21 10:23:25 +08:00
|
|
|
host = localhost
|
2026-03-05 20:19:35 +08:00
|
|
|
# 数据库连接端口 (mysql: 3306, postgres: 5432)
|
2025-12-21 10:23:25 +08:00
|
|
|
port = 3306
|
2026-03-05 20:19:35 +08:00
|
|
|
# 数据库用户名
|
2025-12-21 10:23:25 +08:00
|
|
|
user = root
|
2026-03-05 20:19:35 +08:00
|
|
|
# 数据库密码
|
2025-12-21 10:23:25 +08:00
|
|
|
password =
|
2026-03-05 20:19:35 +08:00
|
|
|
# 数据库名称
|
|
|
|
|
dbname = baihu
|
|
|
|
|
# 数据库文件路径 (仅 sqlite)
|
|
|
|
|
path = data/baihu.db
|
2026-03-16 09:00:44 +08:00
|
|
|
# 数据库 DSN (仅 mysql/postgres, 如果设置则优先使用。注意:需同时将 type 设置为 mysql 或 postgres)
|
|
|
|
|
# 例如 (MySQL): user:password@unix(/var/run/mysqld/mysqld.sock)/dbname?charset=utf8mb4&parseTime=True&loc=Local
|
|
|
|
|
# 例如 (Postgres): postgres://user:password@localhost:5432/dbname?sslmode=disable
|
2026-03-16 08:33:48 +08:00
|
|
|
dsn =
|
2026-03-05 20:19:35 +08:00
|
|
|
# 表前缀
|
2025-12-21 10:23:25 +08:00
|
|
|
table_prefix = baihu_
|
2026-06-13 23:19:03 +08:00
|
|
|
# SSL 模式 (仅 mysql/postgres): postgres 支持 disable/require/verify-ca/verify-full; mysql 支持 true/skip-verify
|
|
|
|
|
# ssl_mode = disable
|
2026-03-05 20:19:35 +08:00
|
|
|
|
|
|
|
|
[security]
|
|
|
|
|
# JWT 密钥。留空则在首次启动时自动生成并保存到数据库设置中。
|
|
|
|
|
# 如果你手动设置了此项,它将覆盖数据库中的设置。
|
|
|
|
|
secret =
|
|
|
|
|
|
2026-03-05 22:22:46 +08:00
|
|
|
|