主要更新内容
- 新增插件系统:支持 ZIP 包安装、
komari-plugin.json清单校验、Komari 版本约束检查和权限审批;插件加载失败会自动禁用并保留错误信息 - 插件运行时新增
server模块:路由(server.route)、静态目录(server.static)、请求/响应钩子(server.hook)、HTML 注入(server.injectHTML)、RPC(server.call/server.registerRPC)、配置读取(server.getConfig)与定时任务(server.cron) - 插件新增持久化数据目录(
data/plugin-data/<short>),重装插件时数据保留;插件市场默认源设为官方市场 - 重构并模块化 JavaScript 运行时:新增
crypto、node:stream、child_process、events、fetch、fs等内置模块,并补充接口与兼容性文档 - 通知新增
SendNotification,事件载荷支持任意字段类型 - metricstore 迁移至
internal/metricstore并按组件拆分;RPC 已注册方法可通过rpc.help发现
Bug修复
process.exit(0)按正常终止处理,并改进错误报告- 限制插件响应钩子的缓冲大小,修复重装插件时的卸载问题
- 修复插件钩子路径过滤规则,按插件声明限制请求体大小
- 修复受限根目录下
fsno-follow 操作被拒绝的问题 - 修复无客户端可通知时仍加载通知的问题
其他
- 启动时自动创建
data/plugin与data/plugin-data目录,新增PluginConfiguration数据表 - 移除多处未使用的旧版兼容代码(如
GetAllMessageSenderConfigs、GetAllOidcConfigs等) database/metricstore迁移至internal/metricstore,外部引用需更新导入路径- 调整 Go 依赖
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
Full Changelog: 1.3.2...Snapshot-2608022325