feat: backup custom services on uninstall, restore on deploy#7
Merged
Conversation
uninstall 前将用户添加的自定义服务 YAML 备份到 ~/.easygate.uninstall-backup/, deploy 完成后检测并询问用户是否恢复,避免重新安装后丢失之前添加的自定义服务。 - _uninstall_backup_user_data: 卸载前备份服务 YAML + .env - _deploy_restore_user_data: deploy 后检测备份,交互式恢复 - deploy --no-restore 跳过恢复 - service-helper.py 单元测试 (add/remove/list/dup/empty) - _deploy_restore_user_data 边界条件测试 (7 场景) - 完整的 uninstall→deploy→restore 集成测试 (compose+native) - 端到端路由验收测试 (local-acceptance + native) - test.sh 新增 Python 语法检查 Co-Authored-By: Claude <[email protected]>
- traefik.yml already has file provider, remove duplicate cat >> - Overwrite commented localhost-services.yml with valid YAML structure before service-helper.py add, so YAML parsing works correctly - Use git checkout to restore file after test Co-Authored-By: Claude <[email protected]>
- README: update uninstall description, add backup/restore note - deployment.md: add --no-restore to tables, update uninstall/backup description, add runtime dir structure for uninstall-backup - testing.md: update test count from 17 to 23, add new test cases, update route acceptance description Co-Authored-By: Claude <[email protected]>
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
uninstall 前将用户通过
easygate service add添加的自定义服务 YAML 备份到~/.easygate.uninstall-backup/,deploy 完成后检测备份并询问用户是否恢复,避免重新安装后丢失之前添加的自定义服务。Changes
Core logic (
scripts/easygate)_uninstall_backup_user_data()— 卸载前将服务 YAML + .env 备份到$HOME/.easygate.uninstall-backup/_deploy_restore_user_data()— deploy 后检测备份,交互式询问恢复,支持重载deploy --no-restore— 跳过恢复询问(适合静默部署)Tests
test.sh— service-helper.py Python 语法service-helper.pyadd/remove/list/dup/empty_deploy_restore_user_data边界条件设计要点
$HOME/.easygate.uninstall-backup/在EASYGATE_HOME之外,卸载删除后仍保留EASYGATE_CI=true)Verification
make test— 全部静态检查 + 行为测试通过easygate deploy --demo --local-only后easygate service add→easygate uninstall→ 验证备份 → 重新easygate deploy→ 恢复Co-Authored-By: Claude [email protected]