Files
sgame-admin-deploy/config.yaml
2026-10-22 04:22:21 +00:00

49 lines
2.6 KiB
YAML
Raw 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.

server:
port: 8090
log_level: info # debug, info, warn, error;留空默认 info
tls_cert: "" # TLS 证书路径(留空则以 HTTP 启动;生产由 Caddy 终结 TLS)
tls_key: ""
# timezone: "Asia/Shanghai" # 可选 IANA 时区,决定看板"按日"统计边界与前端时间显示;留空默认 Asia/Shanghai
# SQLite 数据文件。admin / game 分成两个文件(沿用原先 MySQL 双 schema 的划分):
# 玩家上报的数据独占 game 库,可以整个清空或拷走而不碰管理员账号。
#
# 2026-07 由 MySQL+Redis 换成 SQLite:服务从 NAS 迁到 512MB 的 VPS,
# 光 MySQL 就要 ~400MB 常驻内存,而全部数据量以 MB 计。
db:
admin_path: "data/admin.db" # admins
game_path: "data/game.db" # feedbacks / events / devices / daily_active / daily_stats / demo_markers
busy_timeout_ms: 5000 # 写锁等待毫秒数;与 WAL 一起吸收并发写入
jwt:
secret: "admin-secret-change-in-production"
expire_hours: 24
# 首次启动时若 admins 表为空,用以下信息创建超级管理员(纯密码登录,必须设置 password)
init_admin:
name: "超级管理员"
phone: "13800000000"
password: ""
# 玩家侧公开上报 API(/api/v1/events|heartbeat|feedback)
ingest:
app_key: "" # 客户端内置的 X-App-Key;留空 = 关闭上报路由(503)
upload_dir: "data/uploads" # 反馈截图落盘目录
max_screenshot_kb: 2048 # 单张截图上限
max_save_mb: 16 # Unity 编辑器反馈可附带的存档 zip 上限 MB(反馈 body 上限 = 5MB + 此值;玩家包不带)
events_per_min: 10 # 按 IP 限流:事件批/分钟
feedback_per_10min: 5 # 按 IP 限流:反馈/10分钟
heartbeat_per_min: 2 # 按 IP 限流:心跳/分钟
events_retention_days: 90 # 原始事件保留天数(已汇总进 daily_stats 后批量清理;0=永久保留)
# 工具报告通道(/api/v1/diag:Unity 编辑器里策划一键上传的诊断 zip 包)
diag_upload_dir: "data/uploads/diag" # zip 包落盘目录(留空默认 <upload_dir>/diag)
diag_max_mb: 32 # 单次上传 body 上限 MB(编辑器侧自限 20MB)
diag_per_10min: 20 # 按 IP 限流:报告/10分钟
diag_retention_days: 90 # 报告(行 + zip)保留天数;0=永久保留
# 所有字段均可被环境变量覆盖(生产用 systemd EnvironmentFile 注入),
# 见 internal/config/config.go envBindings:
# SERVER_PORT TZ ADMIN_DB_PATH GAME_DB_PATH
# JWT_SECRET INIT_ADMIN_NAME/PHONE/PASSWORD INGEST_APP_KEY INGEST_UPLOAD_DIR
# INGEST_DIAG_UPLOAD_DIR INGEST_DIAG_MAX_MB INGEST_DIAG_RETENTION_DAYS