feat(deploy,gateway): add dual-edition deployment/migration/rollback and TUN route reconciliation

- Add standalone edition (`Dockerfile.standalone`, `docker-compose.standalone.yml`) alongside sandbox edition and publish both in `.github/workflows/release.yml`.
- Implement `scripts/deploy-lib.sh`, `install.sh`, `update.sh`, and `scripts/artex-sandbox-firewall.sh --cleanup` with edition detection, legacy standalone -> sandbox migration (symlink-safe workspace permissions), automatic snapshots with pinned `artex-rollback/*` images + PG dump, auto/manual cross-edition rollback, and post-rollback upstream unpinning.
- Update `ensureWritableDir` in `internal/sandbox/manager.go` to safely migrate nested root-owned workspace files without following symlinks.
- Expose `deploy_edition` in `/api/update/check` and update `UpdateCard` UI/i18n warnings for sandbox vs standalone in-app update/rollback.
- Reconcile `artex-gateway` TUN policy routing (`priority 218`, `raw PREROUTING`, `nat POSTROUTING`, `DOCKER-USER`) every 15s to self-heal after host network rule flushes or bridge changes.
- Add unit and shell tests (`scripts/deploy_test.sh`, `cmd/artex-gateway/tun_linux_test.go`, `internal/sandbox/sandbox_test.go`, `server/update_test.go`) and update `README.md` / `.env.example`.
This commit is contained in:
ji ruo committed 2026-12-02 13:31:05 +08:00
1 parent d786de90af
commit 07309e4530
23 files changed
+2107 -144

No files matched your search

+7
View File
@@ -1,7 +1,14 @@
# Docker 部署配置(复制为 .env)
# 部署形态:sandbox(沙箱隔离版,docker-compose.yml)或 standalone(单容器版,docker-compose.standalone.yml)
ARTEX_DEPLOY_EDITION=sandbox
# 本仓库发布的 Docker Hub 镜像地址;参见 README 的部署说明。
ARTEX_IMAGE=ruoji6/artex
ARTEX_TAG=latest
# 单容器版(docker-compose.standalone.yml)使用的镜像标签:
# 默认 standalone(新版全功能镜像);如需回退拆分前历史版本(如 v0.3.32)可直接填 v0.3.32
ARTEX_STANDALONE_TAG=standalone
# 沙箱隔离版透明代理网关镜像
ARTEX_GATEWAY_IMAGE=ruoji6/artex-gateway
POSTGRES_USER=artex
POSTGRES_PASSWORD=change-me-please
POSTGRES_DB=artex