主要更新内容
- 指标存储全面迁移:运行期监控数据读写(records、ping_records、GPU 记录)全部走 metric store(默认 SQLite
./data/metrics.db或配置的 MySQL/PostgreSQL),旧表仅作为一次性迁移数据源。 - 新增数据库运维 API:支持 vacuum 和查询数据库大小(PR #578)。
- 指标保留策略管理:可配置
metric_retention_days,按时间自动清理过期数据。 - 指标滚动聚合(Rollup):定时压缩原始数据并保留分桶摘要,支持可配置保留层级(1min/5min/1h)。
- 存储后端热迁移:支持运行时切换 metric DB(如 SQLite → MySQL),可暂停/恢复/查询进度。
- 安装脚本增强:支持稳定版/快照版通道选择,新增 TUI 交互(whiptail/dialog 及纯文本回退)。
- 身份模型重构:引入
Principal结构体,区分匿名、Agent、管理员、API Key 四种主体,权限由角色集合判定(不再是线性等级)。 - 统一身份识别入口:
IdentifyPrincipal集中处理 API Key / Session / Client Token 三种认证,消除三处重复逻辑。 - 移除废弃功能:内置 Cloudflare Tunnel 支持、Cloudflare Access OAuth 提供者、旧
record_*和ping_record_*配置项。 - 构建 CI 优化:前端构建提取为独立 Action,新增 Snapshot 自动发布工作流。
Bug修复
- 安全:RPC 边界强制要求敏感操作(如
admin:exec)通过双因素认证(2FA)(PR #571)。 - 安全:修复
DeleteTheme/UpdateTheme/SetTheme中的路径穿越漏洞,主题名称仅允许字母数字下划线连字符(PR #584)。 - 修复:
common:getNodesRPC 返回 uuid-keyed map 而非数组,确保节点顺序不变(PR #566)。 - 修复:Telegram 通知在非 200 响应时返回 API 错误描述而非仅状态码(PR #583)。
- 修复:临时分享访客绕过私有站点限制。
- 修复:SQLite 数据库锁定问题,避免并发 record 写入报
database is locked。 - 修复:指标聚合查询保留系列身份(Tags),不同标签序列不再被错误合并。
- 修复:metrics 迁移性能优化,使用批量写入和 keyset 分页。
其他
- 配置文件模型清理:删除
cloudflare_tunnel_token、record_enabled、record_preserve_time、ping_record_preserve_time,统一使用metric_retention_days。 - 启动阶段重构为显式生命周期(
Bootstrap → InitStores → InitProviders → StartBackground → BuildRouter → Run → Shutdown)。 - 热重载管理统一到
ReloadManager,每个 handler 独立 panic 隔离。 - 删除
utils/cloudflared包及相关测试。 - 重构
traffic_report通知模块,改用 metric store 查询流量增量。 - CI 工作流精简:复用前端构建 Action、Zig 工具链缓存,仅限 PR 触发构建。
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
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-2607112238