主要更新内容
- 监控数据存储全面迁移至 metric store(默认 SQLite
./data/metrics.db,支持 MySQL/PostgreSQL),旧records、gpu_records、ping_records表只作为迁移源,运行期读写全部走 metric store - 新增 metric store 热重载:保存配置后连接测试通过即自动切换后端,无需重启
- 新增 metric store DSN 自动推断数据库驱动
- 新增数据库维护 API:
/api/v1/admin/database/vacuum(手动 VACUUM)和/api/v1/admin/database/size(查询数据库文件大小) - 新增 store-to-store 迁移功能(WebUI 触发),支持暂停/恢复、进度持久化与重启后孤儿状态修复
- 安装脚本
install-komari.sh新增稳定版/快照版通道选择、TUI 交互支持(whiptail/dialog) - RPC 权限模型重构:引入
Principal结构体,Admin 与 Agent 角色正交,消除越权路径 - 敏感操作(如
admin:exec)在 RPC 边界强制要求双因素认证(2FA) - 移除内置 Cloudflare Tunnel 及 Cloudflare Access OAuth 支持(
cloudflared二进制与相关配置项、go-oidc/oauth2依赖全部删除) - 启动流程重构为显式生命周期阶段(
cmd/app.go),各阶段错误中止启动,关闭反序清理 - 版本号使用 UTC+8 时间戳格式(
Snapshot-yymmddhhMM)
Bug修复
- 修复主题操作(DeleteTheme/UpdateTheme/SetTheme)未校验短名称导致的路径穿越漏洞
- 修复 Telegram 非 200 响应时仅返回状态码而未包含 API 错误描述
- 修复 RPC
common:getNodes返回键值对而非数组导致节点顺序丢失(改为保留入参顺序) - 修复私有站点模式下临时分享链接被错误拦截
- 修复 metric 聚合中系列身份(标签组合)未被正确保留,导致 GPU 多设备等带标签数据丢失
- 修复 metric rollup 查询选择不兼容的间隔(超出保留范围时未上取整到下一级)
- 修复 SQLite 并发写入时
database is locked错误(通过优化锁粒度) - 修复启动迁移恢复时已迁移进度计数从零重新累计
- 修复 metric store 迁移期间临时表锁定导致的失败
其他
- CI 工作流重构:提取前端构建、Zig 工具链、前端部署为可复用 GitHub Actions
- 新增 snapshot 自动发布工作流,主分支推送即构建快照并创建 Release
- 使用 AI 生成发布说明时改用稳定版标签作为比较基线,改进上下文截断与格式化
- 移除
go.mod中废弃的github.com/coreos/go-oidc/v3、github.com/go-jose/go-jose/v4、golang.org/x/oauth2依赖 - 旧的
record_enabled、record_preserve_time、ping_record_preserve_time配置项废弃,由metric_retention_days统一替代 - Docker 镜像发布改为手动触发并通过 build-frontend / build-docker-binaries 分阶段构建
What's Changed
- fix(rpc): 在 RPC 边界强制对敏感操作进行双因素认证(2FA) by @carbofish in #571
- fix: preserve node order in common:getNodes RPC by @yuanhhs in #566
- feat: add database vacuum and size API endpoints by @Akizon77 in #578
- fix(security): prevent path traversal in theme name (DeleteTheme/UpdateTheme/SetTheme) by @guocn in #584
- fix(telegram): 非 200 响应时返回 API 错误描述而非仅状态码 by @Torther in #583
Commits
- Preserve RPC node order (144efdc) @yuanhhs
- fix(rpc): enforce sensitive-operation 2FA at the RPC boundary (50fe286) @carbofish
- Merge PR #571: fix(rpc): enforce sensitive-operation 2FA at the RPC boundary (50ba831) @Akizon77
- Preserve RPC node order (#566) (dd05393) @Akizon77
- refactor(rpc): unify identity into Principal model (036121c) @Akizon77
- refactor(rpc): migrate ACL to capability-based Principal model (ce41745) @Akizon77
- fix(rpc): allow login-page endpoints in private-site mode (11d3ba8) @Akizon77
- feat: add database vacuum and size API endpoints (074958f) @Akizon77
- feat(install): add stable/snapshot channel selection for binary install and upgrade (e740bf2) @Akizon77
- feat(install): add TUI support with whiptail/dialog and text fallback (20c865e) @Akizon77
- Merge pull request #578 from komari-monitor/feat/vacuum-database (0a4cd6b) @Akizon77
- ci: limit build workflow to PRs and fix snapshot release creation (9db4daa) @Akizon77
- fix: allow temp-share guests to bypass private site block (7e19909) @Akizon77
- Merge branch 'fix/temp-share-private-site' (5f50d1b) @Akizon77
- feat: route metric reads and writes to dedicated store (f2c46db) @Akizon77
- fix(database): use FromTime() for time queries and improve cache cleanup (f0877d6) @Akizon77
- fix(telegram): include API error description in non-200 responses (da047cf) @Torther
- refactor(metrics): route all storage through metric store when enabled (6a5f3ef) @Akizon77
- fix(rpc): common:getNodes returns uuid-keyed map instead of array (ff6daa6) @Akizon77
- Merge branch 'refactor/metrics-unify-storage': unify storage through metric store + getNodes map (0132d1c) @Akizon77
- fix(theme): prevent path traversal in theme operations (404d97d) @guocn
- fix(theme): prevent path traversal in theme operations (#584) (92ec774) @Akizon77
- Merge pull request #583 from Torther/main (b6fcdd3) @Akizon77
- fix: avoid sqlite database is locked failures for record writes (332053d) @Akizon77
- feat(metrics): hot-reload metrics DB config with connection test before save (9e5b6df) @Akizon77
- fix: avoid sqlite table locks during metric migration (64998b5) @Akizon77
- feat(metrics): infer DB driver from DSN automatically (d02d934) @Akizon77
- merge: metrics DSN autodetect (be6af33) @Akizon77
- perf: 优化 metrics 迁移性能 - 批量写入 + keyset 分页 (5c2bd4e) @Akizon77
- feat(metrics): 支持迁移暂停/恢复,进度持久化与重启后孤儿状态修复 (416ea87) @Akizon77
- fix(migration): 恢复迁移时保留已迁移进度计数,避免从0重新累计 (43c80d2) @Akizon77
- ci: align snapshot workflow behavior (eb4ca83) @airium
- refactor: split startup into app lifecycle stages (6ddb143) @Akizon77
- feat(metrics): always enable metric store with startup migration and version-based backup (4ad190a) @Akizon77
- refactor: remove built-in Cloudflare tunnel support (73071ff) @Akizon77
- refactor(oauth): remove Cloudflare Access provider support (ab31fc6) @Akizon77
- Use UTC+8 for snapshot versions (e009444) @Akizon77
- fix: run metric store migrations before startup migration (84130df) @Akizon77
- refactor(metrics): use metric retention for cleanup settings (7e0d542) @Akizon77
- feat: add metric retention policy management (7d95240) @Akizon77
- fix(metric): preserve series identity during aggregation (8911c08) @Akizon77
- feat(metricstore): add scheduled rollup compaction (5ad791f) @Akizon77
- fix(metricstore): rotate compaction cursor per metric (46b4e37) @Akizon77
- ci: reuse frontend and toolchain actions in workflows (8a529b4) @Akizon77
- feat(metricstore): aggregate record queries via series rollups (b2fe9ab) @Akizon77
- ci: generate AI-assisted release notes from stable tags (8910c2e) @Akizon77
- feat(metricstore): track ping packet loss in metrics (855ff82) @Akizon77
- Improve release notes generation (5ade710) @Akizon77
- Read release note workflow inputs (0660ee7) @Akizon77
- Use stable release base for snapshot notes (29eecf5) @Akizon77
- feat(metric): preserve series identity in rollup queries (9831df0) @Akizon77
- Include commits in release notes (39c5f7b) @Akizon77
- feat(metricstore): add downsampling toggle, raise default retention to 90d, and cleanup expired data on compact (42ef993) @Akizon77
- fix(metrics): select compatible rollup intervals (3b48339) @Akizon77
New Contributors
- @carbofish made their first contribution in #571
- @yuanhhs made their first contribution in #566
- @guocn made their first contribution in #584
- @Torther made their first contribution in #583
Full Changelog: 1.2.5...Snapshot-2607120101