主要更新内容
- 新增插件系统:支持通过 ZIP 包安装/卸载插件,内置官方插件市场源,插件拥有独立配置与持久化数据目录(
data/plugin-data);server模块提供route、static、hook、injectHTML、call、registerRPC、getConfig、cron等能力,并引入权限审批机制(系统 RPC、路由、钩子、HTML 注入等需显式授权)。 - 重构 JavaScript 运行时:模块化内置库,新增
node:stream与crypto模块支持,补充 API 与兼容性文档;不再支持的方法会明确抛错而非静默无效。 - 指标存储优化:写路径增加 zstd 压缩,降低磁盘占用;优化数据库读写 IO;
metricstore拆分为独立内部包。 - 通知系统扩展:
event、message、emoji字段支持任意类型,新增SendNotification,可发送任意事件载荷;无客户端需要通知时跳过加载。 - RPC 已注册方法现在可通过
rpc.help发现。 - 新增插件市场数据源配置
plugin_market_sources,默认使用官方插件市场。
Bug修复
- 修复更新 Ping 任务排序时权重未变化导致误报“记录不存在”的问题。
- 修复 Ping 任务未按权重排序的问题,现按
weight、id升序返回。 - 修复
process.exit(0)被误判为异常终止的问题,并改进错误上报。 - 修复插件响应钩子缓冲无上限以及重装运行中插件时可能不安全的问题。
- 修复插件钩子过滤,并按插件声明限制可处理的请求体大小。
- 修复受限根目录下无法执行不跟随符号链接的 fs 操作的问题(避免符号链接逃逸)。
- 修复无客户端可通知时仍加载负载通知的问题。
其他
- 启动时自动创建
data/plugin与data/plugin-data目录。 - 清理旧版本兼容代码,
database/metricstore迁移至internal/metricstore并拆分组件。 - 补充 jsruntime 接口说明及插件功能测试。
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
Full Changelog: 1.3.2...Snapshot-2608032100