Komari 1.4.0 正式发布
Komari 1.4.0 正式发布——这是 Komari 有史以来最具里程碑意义的一次版本更新!插件系统横空出世,管理后台仪表盘焕然一新,数据库占用再度降低。Komari 不再只是一个出色的服务器监控工具,而是一个真正开放、可编程、属于你的监控平台。
隆重登场:插件系统。 从这一版本开始,任何人都可以像安装 App 一样,从官方插件市场一键安装插件,或用 ZIP 包本地安装。插件可以注册 HTTP 路由、调用系统 RPC、编写定时任务、托管静态页面、拦截 HTTP 与 WebSocket 数据流,甚至向页面注入自定义 HTML。
全新仪表盘。 管理后台首页仪表盘正式上线,Top CPU / 内存 / 延迟排行尽收眼底;新增 pprof 性能分析视图与可访问性优化,一切尽在掌握。
数据库再优化。 读写 IO 大幅优化;磁盘占用显著下降;保留期可配置,存储策略尽在掌握。
更新日志
主要更新内容
- 新增插件系统:支持 ZIP 安装、插件市场源管理、权限审批(HTML 注入、
server模块等权限门控)、持久化插件数据目录(data/plugin-data/) - 插件运行时新增
server模块:注册路由、调用系统 RPC、server.cron定时任务、server.static静态文件服务、WebSocket / HTTP 请求响应钩子 - 插件市场默认源设为官方市场;管理后台新增插件页面:市场浏览、更新、卸载,第三方插件加载警告
- 重构并扩展 JavaScript 运行时:内置模块拆分,新增
node:stream与crypto模块,补充 API 与兼容性文档 - 仪表盘升级:管理后台新增首页仪表盘(Top CPU / 内存 / 延迟排行);新增
km-*class 钩子与 ARIA 可访问性标注 - 再次优化数据库占用:指标存储迁移至
internal/metricstore并拆分组件;指标数据 zstd 压缩;Rollup 保留期可配置;优化指标库读写 IO - 消息通知支持任意负载字段,新增
SendNotification方法 - 新增 pprof 性能分析视图;OAuth 登录后跳转管理后台首页
- 移除旧版兼容代码及冗余数据库查询函数
Bug修复
- 修复 Ping 任务排序与顺序更新:按权重和 ID 排序;更新权重时避免误报记录不存在
相关文档
- 插件开发指南:https://komari-document.pages.dev/dev/plugin/
- 插件清单(manifest)规范:https://komari-document.pages.dev/dev/plugin/manifest
- 插件运行时与沙箱:https://komari-document.pages.dev/dev/plugin/runtime
- 插件 RPC 调用:https://komari-document.pages.dev/dev/plugin/rpc
- 插件
serverAPI:https://komari-document.pages.dev/dev/plugin/server-api - 插件市场接入:https://komari-document.pages.dev/dev/plugin/market
- 主题开发(
km-*class 钩子):https://komari-document.pages.dev/dev/theme - 插件 SDK:https://www.npmjs.com/package/@komari-monitor/plugin-sdk
Commits
- style: 移除没有使用的旧版本兼容代码,移动 database/metricstore 到 internal/metricstore 并拆分组件 (4077201) @Akizon77
- refactor: javascript runtime (df6ffba) @Akizon77
- refactor(jsruntime): modularize built-ins (3c58382) @Akizon77
- docs(jsruntime): add API and compatibility documentation (54851bd) @Akizon77
- docs(jsruntime): clarify unsupported methods throw instead of no-op (91ae9ed) @Akizon77
- fix(jsruntime): treat process.exit(0) as normal termination and improve error reporting (91cbeb3) @Akizon77
- feat: add plugin system and refactor jsruntime deadline handling (8985adc) @Akizon77
- feat(plugin): enforce server module permission gates (68bf4ed) @Akizon77
- feat(jsruntime): add node:stream module and embed nexttick JS (965afb3) @Akizon77
- feat: crypto module support (91d5f92) @Akizon77
- feat(plugin): set official plugin market as default source (f967ba0) @Akizon77
- fix(plugin): limit response hook buffering and safely reinstall (c27c21d) @Akizon77
- feat(plugin): add persistent storage dir for plugins (01c4816) @Akizon77
- feat: add plugin data storage and remove preview field (4040a5d) @Akizon77
- feat: add HTML injection permission and support for plugins (1f139ba) @Akizon77
- feat(plugin): add server.static for serving plugin static folders (eab03a1) @Akizon77
- fix: hook 过滤 + 按插件 body 上限 (d9713aa) @Akizon77
- feat(plugin): add server.cron scheduled task support (5488189) @Akizon77
- fix(rpc): make registered methods discoverable via rpc.help (28abafb) @Akizon77
- feat: add SendNotification and support any event payload fields (996dd90) @Akizon77
- fix(jsruntime/fs): allow no-follow operations on confined root (956b933) @Akizon77
- fix(notifier): skip load notification when no clients to notify (a714637) @Akizon77
- pref: metrics db IO Read/Write (08067bc) @Akizon77
- feat:metrics zstd compress & fix pingtask order (cba8153) @Akizon77
- fix(oauth): redirect to admin dashboard after OAuth login (d92f60f) @Akizon77
- feat(metricstore): make rollup retention configurable (9646252) @Akizon77
- feat(plugin): add WebSocket hook support to server.hook (e5d6768) @Akizon77
Full Changelog: 1.3.2...1.4.0