feat(shell): 插件密码加密、失败熔断与客户端自动更新(v1.11.3)

- 插件配置中 format=password 字段改为 AES-256-GCM 密文落盘(本机密钥,历史明文自动迁移)
- 同一插件连续失败 3 次自动禁用(仅统计进程启动后失败),升级自动解除
- 检测到新版本后台下载,空闲窗口提前提示并自动重启升级,设置页可配安全窗口
This commit is contained in:
2026-11-26 09:28:18 +08:00
parent 32e28d3aec
commit 9db8c74b7f
22 changed files with 792 additions and 38 deletions
+5 -1
View File
@@ -10,6 +10,7 @@ const platformAuth = require("./platform-auth");
const state = require("./state");
const envSync = require("./env-sync");
const sdkSync = require("./sdk-sync");
const pluginHealth = require("./plugin-health");
const { versionLt } = require("./crypto");
const { makeLogger } = require("./logger");
@@ -65,7 +66,10 @@ async function buildMeta(account) {
if (lic.ok) {
const allowed = new Set((lic.payload || {}).plugins.map((p) => p.pluginId));
for (const entry of registry.listLocalPlugins()) {
if (allowed.has(entry.id)) plugins.push(registry.pluginSchema(entry.id));
if (allowed.has(entry.id)) {
// 附带熔断状态:前端据此显示「连续失败 N 次 / 已自动禁用」与恢复入口
plugins.push({ ...registry.pluginSchema(entry.id), health: pluginHealth.status(entry.id) });
}
}
} else {
authExpired = true;