主要更新内容
- 新增插件系统:支持通过 ZIP 包安装、卸载插件,插件清单
komari-plugin.json声明名称、入口脚本、权限、配置项与注入页面 - 插件默认使用官方插件市场作为来源,可通过新增的
plugin_market_sources配置键调整 - 新增插件权限管控:
server.route、server.hook、server.call(系统 RPC)等能力需在清单中声明并经管理员批准,未授权的能力在加载时失败或调用被拒绝 - 新增插件持久化存储目录
data/plugin-data,插件更新时保留数据,卸载时一并删除 - 重构 JavaScript 运行时并模块化内置能力,新增
node:stream、Node.js 兼容crypto模块及child_process支持(受AllowExec权限控制) - 为插件提供
server模块 API:route、hook、call、registerRPC、getConfig - 未实现的运行时接口不再静默无操作,改为明确抛错;新增 jsruntime 接口与兼容性文档
Bug修复
- 修复
process.exit(0)被误判为异常终止的问题,并改进插件错误报告 - 修复插件响应钩子缓冲无上限可能导致内存占用过高的问题
- 修复启用响应钩子时流式响应(如实时监控画面)被缓冲吞掉、客户端收不到数据的问题
- 修复插件重装时运行中插件未安全卸载、安装成功后未恢复启用状态的问题
其他
- metricstore 从
database/迁移至internal/metricstore并拆分模块,纯内部结构调整 - 移除旧版本遗留的兼容代码及不再使用的数据库辅助函数
- 新增
PluginConfiguration数据表,服务启动时自动创建data/plugin目录 - 依赖调整:移除
golang.org/x/image,新增base64dec
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
Full Changelog: 1.3.2...Snapshot-2608020044