diff --git a/AGENTS.md b/AGENTS.md index d44497a..9b844d0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -111,7 +111,7 @@ Recent commits use concise imperative subjects, often `Add ...` or `Refine ...`, git push origin refs/tags/vX.Y.Z ``` - GitHub Actions (`release.yml`) is responsible only for cross-compiling all 5 target binaries and publishing the GitHub Release. - - **Gitea Pull-Based Promotion & Mirroring**: On WSL (`wsl-dev`), `seal-use-release-sync.timer` polls GitHub every 15 minutes (or can be triggered immediately via `systemctl start seal-use-release-sync.service`), mirrors Git repository refs (branches and tags) and pulls release assets into Gitea (`wsl-infra/systemd/`). + - **Gitea Pull-Based Promotion & Mirroring**: On WSL (`wsl-dev`), `seal-use-release-sync.timer` polls GitHub every 15 minutes (or can be triggered immediately via `systemctl start seal-use-release-sync.service`), mirrors Git repository refs (branches and tags) and pulls release assets into Gitea (`host-infra/systemd/`). - The workflow enforces the merge-before-tag rule rather than trusting the operator: `release.yml` refuses to publish unless the tagged commit is an ancestor of `origin/main`. Actions in both workflows are pinned to commit SHAs rather than moving tags for supply-chain integrity. ## Security & Configuration Tips diff --git a/README.md b/README.md index 3884cc4..a6cb196 100644 --- a/README.md +++ b/README.md @@ -354,4 +354,4 @@ bun run bump 0.8.5 **CI & Promotion Pipeline:** - GitHub Actions triggers automatically upon pushing a `v*` tag to `origin`; - Cross-compiles standalone binaries for 5 target platforms (macOS Apple Silicon/Intel, Linux x86_64/ARM64, Windows x64) and publishes them to **[GitHub Releases](https://github.com/yunyingk/seal-use/releases)**; -- WSL `seal-use-release-sync.timer` polls the latest GitHub Release and promotes all assets to **[Gitea Releases](https://git.ying-qing.cn/gitea/seal-use/releases)** (`wsl-infra/README.md`). +- WSL `seal-use-release-sync.timer` polls the latest GitHub Release and promotes all assets to **[Gitea Releases](https://git.ying-qing.cn/gitea/seal-use/releases)** (`host-infra/README.md`). diff --git a/wsl-infra/README.md b/host-infra/README.md similarity index 86% rename from wsl-infra/README.md rename to host-infra/README.md index 515bb49..012cda3 100644 --- a/wsl-infra/README.md +++ b/host-infra/README.md @@ -42,7 +42,7 @@ Credentials are stored as `0600` files under From mac15, run: ```sh -./ops/infra-healthcheck.sh +./host-infra/infra-healthcheck.sh ``` It emits JSON checks for mac15, the Mac15-to-WSL Tailscale/SSH path, WSL, @@ -52,16 +52,16 @@ does not restart or mutate any service. ## Workspace backups -The repository is the source of truth. After the ops changes are committed to -`main`, back up the tracked `ops/` directory to each machine's global workspace: +The repository is the source of truth. After the host-infra changes are committed to +`main`, back up the tracked `host-infra/` directory to each machine's global workspace: ```sh -./ops/backup-workspace-scripts.sh +./host-infra/backup-workspace-scripts.sh ``` Each run creates a commit-named snapshot under `~/Workspace/ops-backups/seal-use/` on mac15 and mac13, and under `~/workspace/ops-backups/seal-use/` on WSL and Aliyun. Each snapshot includes a -manifest with its source commit and backup time. Only tracked `ops/` files are +manifest with its source commit and backup time. Only tracked `host-infra/` files are copied; private runtime configuration and credentials are excluded. Run the backup command again after changing operational scripts or service templates. diff --git a/wsl-infra/backup-workspace-scripts.sh b/host-infra/backup-workspace-scripts.sh similarity index 79% rename from wsl-infra/backup-workspace-scripts.sh rename to host-infra/backup-workspace-scripts.sh index dc710c9..a65b4f2 100755 --- a/wsl-infra/backup-workspace-scripts.sh +++ b/host-infra/backup-workspace-scripts.sh @@ -2,8 +2,8 @@ set -uo pipefail repo_root=$(git rev-parse --show-toplevel) -if [ -n "$(git -C "$repo_root" status --porcelain -- ops)" ]; then - echo "Refusing to back up uncommitted ops files; commit them first." >&2 +if [ -n "$(git -C "$repo_root" status --porcelain -- host-infra)" ]; then + echo "Refusing to back up uncommitted host-infra files; commit them first." >&2 exit 1 fi @@ -12,7 +12,7 @@ snapshot="commit-$commit" stage=$(mktemp -d) trap 'rm -rf "$stage"' EXIT -git -C "$repo_root" archive --format=tar HEAD ops | tar -xf - -C "$stage" +git -C "$repo_root" archive --format=tar HEAD host-infra | tar -xf - -C "$stage" printf 'source_commit=%s\ncreated_at_utc=%s\n' \ "$(git -C "$repo_root" rev-parse HEAD)" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ > "$stage/BACKUP-MANIFEST.txt" @@ -27,9 +27,9 @@ sync_remote() { local host="$1" relative_target="$2" if ssh -o BatchMode=yes -o ConnectTimeout=8 "$host" \ "mkdir -p '$relative_target' && find '$relative_target' -type f -name '._*' -delete" \ - && scp -q -r "$stage/ops" "$stage/BACKUP-MANIFEST.txt" "$host:$relative_target/" \ + && scp -q -r "$stage/host-infra" "$stage/BACKUP-MANIFEST.txt" "$host:$relative_target/" \ && ssh -o BatchMode=yes -o ConnectTimeout=8 "$host" \ - "test -s '$relative_target/BACKUP-MANIFEST.txt' && test -f '$relative_target/ops/README.md'"; then + "test -s '$relative_target/BACKUP-MANIFEST.txt' && test -f '$relative_target/host-infra/README.md'"; then printf 'ok\t%s\t%s\n' "$host" "$relative_target" return 0 fi diff --git a/wsl-infra/infra-healthcheck.sh b/host-infra/infra-healthcheck.sh similarity index 100% rename from wsl-infra/infra-healthcheck.sh rename to host-infra/infra-healthcheck.sh diff --git a/wsl-infra/release-sync.sh b/host-infra/release-sync.sh similarity index 100% rename from wsl-infra/release-sync.sh rename to host-infra/release-sync.sh diff --git a/wsl-infra/systemd/mihomo.service b/host-infra/systemd/mihomo.service similarity index 100% rename from wsl-infra/systemd/mihomo.service rename to host-infra/systemd/mihomo.service diff --git a/wsl-infra/systemd/seal-use-release-sync.service b/host-infra/systemd/seal-use-release-sync.service similarity index 100% rename from wsl-infra/systemd/seal-use-release-sync.service rename to host-infra/systemd/seal-use-release-sync.service diff --git a/wsl-infra/systemd/seal-use-release-sync.timer b/host-infra/systemd/seal-use-release-sync.timer similarity index 100% rename from wsl-infra/systemd/seal-use-release-sync.timer rename to host-infra/systemd/seal-use-release-sync.timer