主要更新内容
- 指标数据独立存储:监控数据(CPU、内存、GPU、Ping 等)从主数据库迁移至专用 metric store。默认使用
./data/metrics.db,支持 SQLite / MySQL / PostgreSQL 后端,可通过 WebUI 热切换存储后端并触发数据迁移。 - 新管理 API:新增数据库 VACUUM 和大小查询端点;新增指标保留策略管理(
metric_retention_days)、定时滚动压缩及降采样开关。 - 安装脚本增强:
install-komari.sh新增 stable / snapshot 通道选择、TUI 交互界面(whiptail / dialog 回退)。 - RPC 鉴权模型重构:引入
Principal替代单一角色字符串,区分匿名 / Agent / 用户 / API Key。破坏性变更:Admin 不再自动具备 Client 角色权限(如client:report),需显式能力检查。 - 移除 Cloudflare 集成:删除内置 Cloudflare Tunnel 运行管理和 Cloudflare Access OAuth 提供者;Docker 镜像不再打包
cloudflared二进制。 - 移除旧版记录保留设置:
record_enabled、record_preserve_time、ping_record_preserve_time配置项被删除,改为由 metric store 统一管理(通过metric_retention_days)。 - 版本升级自动备份:启动时检测版本变化,自动将
./data打包备份至./backup/,便于迁移异常回滚。
Bug修复
- RPC 敏感操作强制双因素认证(2FA)——修复缺少边界检查的安全缺陷。
- 主题操作(DeleteTheme/UpdateTheme/SetTheme)路径遍历漏洞修复。
- Telegram 非 200 响应时返回 API 错误描述而非仅状态码。
common:getNodesRPC 节点顺序不稳定问题修复(改为 UUID 映射)。- SQLite 数据库锁定导致记录写入失败的问题修复。
- 指标迁移性能优化:批量写入 + keyset 分页。
- 滚动压缩时每个指标的游标独立旋转,避免压缩串话。
- 聚合查询中标签维度丢失问题修复(新增
PreserveSeries选项)。
其他
- CI/CD 重构:前端构建分离为独立 GitHub Action、构建流程缓存优化;新增 Snapshot 发布流水线。
- 启动流程重构为显式生命周期阶段(Bootstrap → InitStores → ... → Shutdown),错误传播更清晰。
- 依赖库清理:移除
coreos/go-oidc、go-jose、golang.org/x/oauth2。 - 新增
EntityIDsAPI 用于查询指标所属的实体列表。
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
- Fix metric rollup compaction and retention (ff358ed) @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-2607121237