主要更新内容
- 指标存储后端重构:监控数据(records、GPU、Ping)已从主数据库迁移至独立的 metric store(默认 SQLite
./data/metrics.db,支持切换至 MySQL/PostgreSQL),新增保留策略管理和启动时自动迁移功能。 - 数据库维护 API:新增数据库 VACUUM 和存储空间查询端点,支持手动回收 SQLite 碎片空间。
- 安全加固:RPC 边界强制对敏感操作进行双因素认证(2FA);在
DeleteTheme/UpdateTheme/SetTheme中防范路径穿越漏洞。 - 安装脚本增强:支持 stable/snapshot 通道选择、TUI(whiptail/dialog)交互菜单和输入框。
- 移除内置 Cloudflare 集成:移除 Cloudflare Tunnel 和 Cloudflare Access OAuth provider,相关依赖不再内置。
- 启动流程重构:将服务器启动拆分为显式生命周期阶段(App),引入 ReloadManager 统一热重载处理。
Bug修复
- 修复主题名路径穿越漏洞,防止未授权文件访问。
- 修复 Telegram 通知在非 200 响应时仅返回状态码而不附带 API 错误描述的问题。
- 修复
common:getNodesRPC 不保持节点排序的问题。 - 修复 SQLite 数据库锁定错误(
database is locked)和迁移过程中的表锁问题。 - 修复 metric store 聚合查询中序列标签身份丢失的问题(设备级标签在 rollup 结果中独立保留)。
- 修复私有站点模式(private-site)下临时分享链接被错误拦截的问题。
- 修复临时分享访客被私有站点拦截的问题。
- 修复 metric store 启动迁移中孤儿状态修复和进度计数重置问题。
其他
- 配置项变更:旧的
record_enabled、record_preserve_time、ping_record_preserve_time配置已移除,改用metric_retention_days;内置cloudflare_tunnel_token配置已移除。 - 权限模型调整:RPC 权限改为基于 Principal 的能力集模型,admin 角色不再自动获得 agent(client)角色的上报权限。
- CI 优化:前端构建抽离为可复用的 GitHub Actions,新增 Snapshot 发布工作流,限制构建工作流仅在 PR 触发。
- 二进制安装/升级:install-komari.sh 添加通道选择、Zig 编译器和一键升级支持。
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
- refactor: improve metric store lifecycle management with context-aware close and operation gate (c828653) @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-2607121654