ci deploy (src 64628e9)

This commit is contained in:
2026-06-11 17:23:33 +08:00
committed by gitea-actions
commit 390058d378
9 changed files with 298 additions and 0 deletions

41
config.yaml Normal file
View File

@ -0,0 +1,41 @@
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 # 单张截图上限
events_per_min: 10 # 按 IP 限流:事件批/分钟
feedback_per_10min: 5 # 按 IP 限流:反馈/10分钟
heartbeat_per_min: 2 # 按 IP 限流:心跳/分钟
events_retention_days: 90 # 原始事件保留天数(已汇总进 daily_stats 后批量清理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