Files
sgame-admin-deploy/config.yaml
2026-06-12 04:28:23 +00:00

58 lines
2.1 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
# 后台自身库admins 表)。默认部署与 game_db 同一 MySQL 实例、不同 schema。
admin_db:
host: 127.0.0.1
port: 3306
database: sgame_admin
username: sgame
password: "change-me"
max_open_conns: 10
max_idle_conns: 5
# 游戏数据库feedbacks / events / devices / daily_active由玩家上报 API 写入)
game_db:
host: 127.0.0.1
port: 3306
database: sgame_game
username: sgame
password: "change-me"
max_open_conns: 10
max_idle_conns: 5
redis:
addr: 127.0.0.1:6379
password: ""
db: 0
pool_size: 10
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" # 反馈截图落盘目录Docker 部署用 INGEST_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=永久保留)
# 所有字段均可被环境变量覆盖Docker 部署用),见 internal/config/config.go envBindings
# SERVER_PORT TZ ADMIN_DB_HOST/PORT/DATABASE/USERNAME/PASSWORD
# GAME_DB_HOST/PORT/DATABASE/USERNAME/PASSWORD REDIS_ADDR/PASSWORD/DB
# JWT_SECRET INIT_ADMIN_NAME/PHONE/PASSWORD INGEST_APP_KEY INGEST_UPLOAD_DIR