Files
nl-pms-api/config.example.yaml
2026-08-15 17:04:47 +08:00

28 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# nl-pms-api 配置示例:复制为 config.yaml 后按环境修改。
# env 仅 dev 会在启动时自动迁移表结构AutoMigrate
# prod 绝不执行任何 DDL缺表直接退出 —— 部署前先手工执行 init.sql。
env: prod
listen: ":8788"
# 拼接文件访问 URL 的前缀,必须是客户端可达的地址(含反代前缀);
# 例https://o-api.nailaoyun.cn/pms-api ;留空则按每次请求的 Host 推断。
base_url: "https://o-api.nailaoyun.cn/pms-api"
# 反代若不剥路径前缀1Panel 常见),填 /pms-api若反代已把 /pms-api 剥掉再转发,则留空。
base_path: "/pms-api"
# JWT 签发密钥access / refresh token 共用,务必使用足够长的随机串。
jwt_secret: "change-me-to-a-long-random-secret"
# access token 有效小时数(默认 2refresh token 有效天数(默认 30
access_ttl_hours: 2
refresh_ttl_days: 30
storage_dir: "./uploads"
# 普通图片上传上限MB
max_upload_mb: 20
# 客户端发版安装包上传上限MB
max_release_mb: 200
# 可信反代CIDR 或 IP填了才会信任 X-Forwarded-For 解析真实客户端 IP。
# trusted_proxies:
# - 127.0.0.1
# - 10.0.0.0/8
mysql:
# 与 view 桌面端共用 code_count 库;账号需要对业务表的 SELECT/INSERT/UPDATE 权限。
dsn: "root:root@tcp(127.0.0.1:3306)/code_count?charset=utf8mb4&parseTime=false&loc=Local"