feat: 更新服务 — ZIP下载/备份/回滚/重启

UpdateService:
- 分支感知: 从 base_config 读取 branch, 拼接 archive/{branch}.zip
- 定时检查: 每6h 拉取 version.json 比对版本
- 更新前自动打包备份 (zip, 保留最新5个)
- 保护用户配置: base_config.yaml / plugins/*/config.yaml / data/
- 子进程 pip install 依赖

API:
- GET /api/updates — 更新状态
- POST /api/updates/check — 手动检查
- POST /api/updates/apply — 执行更新

回滚:
- python main.py --rollback  — 恢复到最新备份
- 无备份时提示

重启:
- .restart_flag 信号文件 → 优雅退出 → systemd 拉起

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
qinglong
2026-06-13 20:32:42 +08:00
parent 6e0ed23012
commit c20417ff93
7 changed files with 401 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
http_port: 4200
last_updated: 29386.797962851
last_updated: 35916.617063641
plugin_routes:
example_plugin:
- methods: