主要更新内容
- Metrics 存储重构:路由全部指标读写至专用 metrics store,首次启动自动从旧表迁移数据;支持 MySQL/PostgreSQL 后端切换与一键数据搬运
- 指标压缩与保留策略:默认启用时分级降采样(1m/5m/1h)与原始数据保留窗口,支持下采样开关配置与保留期管理
- Web 前端构建分离:CI 流程拆出独立 frontend 构建步骤(
.github/actions/build-frontend),支持版本化主题打包与缓存 - 安装向导:首次运行显示引导界面,指导创建管理员账号、站点元数据与数据库配置,不再依赖环境变量预设默认账户
- 新增 loong64 架构支持:二进制产物与 Docker 镜像增加
linux/loong64平台 - 废弃功能移除:删除内置 Cloudflare tunnel 支持、Cloudflare Access OAuth 提供者、Nezha 兼容模块、旧
records/gpu_records表读写与压缩逻辑 - 主题市场管理:新增主题源管理、归档校验与路径遍历防护
- 配置热重载管理器:统一收敛订阅逻辑,panic 隔离,各处理器互不影响
- 数据库维护 API:支持主库与 metrics 库的空间检查与 VACUUM 回收(SQLite)
- 低资源模式自动探测:根据物理内存自动调优 SQLite 连接池与 batch 写入窗口
- Visitor Audit RPC 端点:新增公开访客审计事件查询接口
- Metrics Store 配置热加载:保存前测试连接,自动推断驱动类型,支持保留期动态更新
Bug修复
- 安全:主题路径遍历:修复
DeleteTheme/UpdateTheme/SetTheme中文件名未校验导致的目录穿越漏洞 - Telegram 非 200 响应:返回 API 错误描述而非仅状态码
- Visitor Audit 日志:加固写入逻辑避免异常数据
- Metrics 系列身份保持:聚合查询时确保系列标识不丢失
- SQLite 表锁:避免指标写入和迁移时
database is locked错误 - 时间字段标准化:全部模型时间字段改为
time.Time(UTC),修复事件日志时区偏移问题 - Metrics 保留期边界:修复零保留期定义跨操作被覆盖、内置指标默认保留期测试值不准确
- Compaction 错误隔离:单个 metric 压缩失败不再阻塞后续指标
其他
- CI 重构:复用 frontend/toolchain action,增加 snapshot 构建验证、重建已有 release 工作流、Docker 推送分离
- 重构启动生命周期:将 Server 拆为 Bootstrap/InitStores/Providers/Background/Router/Run/Shutdown 显式阶段
- 日志系统:stdlib log 替换为自定义 logger,Gin 强制 release 模式
- 废弃代码清理:移除
KOMARI_DB_HOST/PORT/USER/PASS/NAME环境变量、CreateDefaultAdminAccount、旧SaveReport/RecordOne函数 - 文档更新:README 与日语版改为引导式安装说明
What's Changed
- fix(security): prevent path traversal in theme name (DeleteTheme/UpdateTheme/SetTheme) by @guocn in #584
- fix(telegram): 非 200 响应时返回 API 错误描述而非仅状态码 by @Torther in #583
- feat(rpc): add public visitor audit event endpoint by @sanrokamlan-prog in #597
- fix: harden visitor audit logging by @sanrokamlan-prog in #602
Commits
- 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
- disable downsampling by default (724dd3b) @Akizon77
- feat: add visitor audit rpc endpoint (7679430) @sanrokamlan-prog
- Update generate-release-notes.yml (5c73eba) @Akizon77
- Merge pull request #597 from sanrokamlan-prog/visitor-audit-rpc (1eb3549) @Akizon77
- fix: harden visitor audit logging (0c80f0f) @sanrokamlan-prog
- Merge pull request #602 from sanrokamlan-prog/fix/visitor-audit-hardening (5fa59ab) @Akizon77
- refactor: replace static retention config with dynamic retention summary (7f36881) @Akizon77
- fix: preserve zero-retention metric definitions across operations (66b7691) @Akizon77
- refactor(metrics): remove DefaultRetentionDays config option and enforce explicit retention (7baf2ed) @Akizon77
- fix: reduce default built-in metric retention to 1 day for testing (c1178eb) @Akizon77
- fix(metricstore): use Series to read ping records for rollup support (e2a8284) @Akizon77
- feat: clean metric store before deleting client or ping task (43547b9) @Akizon77
- feat(metric): add compaction watermark upsert and update storage queries (5b90804) @Akizon77
- feat: #414 add support for loong64 architecture (fc3febc) @Akizon77
- refactor: remove unused database functions for sessions, clients, and metric store (0f6f2f4) @Akizon77
- refactor: remove Nezha compatibility (f42cfe7) @Akizon77
- Make metric chart gaps adaptive (73c3c43) @Akizon77
- refactor: remove deprecated WriteRecord/WriteGPURecord and refactor cron jobs (312e320) @Akizon77
- feat(metricstore): batch metric report writes in single transactions (a78ef87) @Akizon77
- refactor(jsonrpc): remove deprecated Tag field from public metric types (d853a83) @Akizon77
- feat: add legacy upgrade server and refactor OAuth initialization (3c27823) @Akizon77
- feat(admin): add database compression inspection and configuration endpoints (fee8c86) @Akizon77
- Revert "feat(admin): add database compression inspection and configuration endpoints" (7f12850) @Akizon77
- refactor: clean up metric constants and refactor record downsampling (99fda6b) @Akizon77
- refactor: standardize time fields (42b290f) @Akizon77
- remove unused database connection parameters (be3daa4) @Akizon77
- fix: #609 #612 continue compaction on per-metric errors and add separate compaction gate (5a66f28) @Akizon77
- fix: remove orphaned metric data before space reclaim and reject unknown metrics (cdfd5bd) @Akizon77
- feat: drop obsolete builtin metrics and expose definition creation (b554368) @Akizon77
- feat: make metric deletion async and add UpdateMetricRetention (b4d3977) @Akizon77
- feat: add automatic low resource mode detection and SQLite tuning (f59e0e8) @Akizon77
- fix(resourceprobe): cast Totalram to uint64 to avoid overflow (eb7ecc6) @Akizon77
- feat: migrate legacy monitoring to hourly P95 aggregation (7a95546) @Akizon77
- feat: use aligned, unbuffered I/O for disk write benchmark (0bac110) @Akizon77
- fix(ci): only tag Docker latest for latest release (a402cc6) @Akizon77
- fix(ci): build maintenance releases with matching frontend (99c684e) @Akizon77
- fix(ci): promote Docker latest explicitly (9d7e24a) @Akizon77
- ci: add workflow to rebuild existing releases (9d149ab) @Akizon77
- feat: add theme market source management and archive validation (312834f) @Akizon77
- refactor: replace stdlib log with custom logger, enforce gin release mode (db2ed8e) @Akizon77
- feat: first-run installation guide (5a84889) @Akizon77
- perf(metric): skip digests for non-percentile rollup queries (11617b4) @Akizon77
- feat(metricstore): batch ping records for improved performance (887381a) @Akizon77
- fix: format event time in local timezone instead of UTC (f07bd74) @Akizon77
New Contributors
- @guocn made their first contribution in #584
- @Torther made their first contribution in #583
- @sanrokamlan-prog made their first contribution in #597
Full Changelog: 1.2.5-fix2...Snapshot-2607212346