✨ feat(update): 为原生安装增加备份与托管更新 - #539
Closed
xyzxiaoma wants to merge 4 commits into
Closed
Conversation
xyzxiaoma
force-pushed
the
codex/feat-managed-native-updates
branch
from
August 13, 2026 06:00
7ec338c to
b4806a6
Compare
xyzxiaoma
marked this pull request as ready for review
August 13, 2026 06:00
xyzxiaoma
force-pushed
the
codex/feat-managed-native-updates
branch
from
August 14, 2026 05:52
b4806a6 to
0dd0ac5
Compare
xyzxiaoma
force-pushed
the
codex/feat-managed-native-updates
branch
from
August 17, 2026 02:41
0dd0ac5 to
4e95fb3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
为符合条件的 CPA Manager Plus 原生发布包增加一套显式启用的托管更新流程。用户可以在 Dashboard 中准备经过验证的官方 Release,再由独立更新器重启服务、创建离线回滚快照、切换受管文件并验证目标版本;启动或健康检查失败时会自动恢复旧版本。
该功能有意采用严格的支持边界:只有使用发布包自带控制脚本启动的固定目录原生安装可以启用。Docker、CPA 托管面板、自定义服务、第三方进程管理器以及带额外启动参数的实例仍使用手动更新流程。
Scope
Changes
checksums.txt和update-manifest.json,并拒绝不安全压缩包、路径、链接、事务元数据和不受支持的安装布局。enable-updates注册流程,并限制为默认启动方式和私有更新元数据。User Impact
符合条件的原生包用户只需显式启用一次,后续即可在 Dashboard 中准备并应用兼容 Release,无需手工复制数据或替换二进制文件。下载和校验阶段服务保持在线,仅在创建离线备份和切换程序文件时短暂重启。
不支持的安装方式仍会收到原有 Release 版本提示和手动下载链接。用户未执行
enable-updates前,托管更新始终保持关闭。Compatibility / Runtime Notes
:8317托管的轻量面板不会显示托管更新功能。config.json或环境变量,不支持额外的start [args...]参数。Data / Security Notes
seakee/CPA-Manager-PlusGitHub Release 下载前缀中的资产。checksums.txt和update-manifest.json校验;未知或尾随 JSON、路径穿越、重复条目、链接、超限压缩包和不安全事务布局均会被拒绝。config.json、配置的数据目录和secrets/。备份清单记录每个文件的大小和 SHA-256,并在恢复前重新验证。Risk / Rollback
风险等级:高
该功能会替换运行中的原生程序文件并重启 Manager Server,因此风险等级标记为高。不过它默认关闭、失败时安全终止,并且只允许已知的发布包布局。应用更新前必须创建并验证离线回滚快照;新版本启动失败、版本验证失败或文件切换中断时,会尽可能恢复旧程序和旧数据。无法自动恢复的情况会进入
manual_recovery_required,并阻止启动下一笔更新事务。发布前如需整体移除,可回退本 PR 的四个提交。发布后管理员仍可继续使用原有手动更新方式;保留的备份目录包含旧程序、配置和数据快照,可用于恢复。
Verification
命令与证据:
另外执行了
npm run manager-server:test。所有托管更新相关包均通过;全量命令仍报告仓库既有的 Windows 环境失败:Unix0600权限断言在 Windows 上读取为0666,以及两条 usage-import 符号链接测试因当前 Windows 用户没有创建链接的权限而失败。Linuxgo test -race ./...应由远端 CI 提供证据,本地 Windows 环境不声明 race 通过。此前也在该 Windows 工作区执行过完整前端测试:2221/2223 通过,两个失败均为既有的五秒并行超时,位于
demoPersistIsolation.test.ts和useAuthStore.test.ts。本次新增的前端更新专项测试全部通过。Screenshots / Recordings
桌面端 Dashboard 版本卡片与更新准备弹窗:
另外已在 390x844 窄屏环境检查弹窗布局,无横向溢出。
Docs
文档决定:原生控制指南和更新操作手册已经说明注册方式、支持布局、两阶段流程、备份内容、自动恢复、ACL、清理策略和手动回退。Release Notes 应特别说明:第一个兼容原生版本仍需手动安装,并且用户必须显式执行注册命令。
Related
N/A