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
@@ -2,6 +2,8 @@ framework:
debug: true
name: SenSu
version: v0.7.0
branch: dev
repo_url: https://git.yeij.top/AskaEth/SenSu
logging:
debug_level_file: true
level: DEBUG