From 74ad1967fa00a93004742546db3e02ccd47c426e Mon Sep 17 00:00:00 2001 From: yunyingk Date: Wed, 23 Sep 2026 10:28:05 +0800 Subject: [PATCH] Run release sync through local WSL mihomo --- ops/README.md | 10 ++++++++-- ops/infra-healthcheck.sh | 3 ++- ops/systemd/mihomo.service | 16 ++++++++++++++++ ops/systemd/seal-use-release-sync.service | 7 ++++--- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 ops/systemd/mihomo.service diff --git a/ops/README.md b/ops/README.md index d02fac6..c05f969 100644 --- a/ops/README.md +++ b/ops/README.md @@ -15,8 +15,13 @@ The Homebrew tap is updated immediately after the first two assets are present in Gitea and the macOS arm64 checksum is available. The remaining assets are idempotent retries and do not make a valid Homebrew installation unavailable. -The worker uses mac13's `http://192.168.3.62:7897` proxy only for GitHub. Local -Gitea traffic stays direct through `127.0.0.1:3001`. +The WSL worker uses its local mihomo listener at `http://127.0.0.1:7897` only +for GitHub. It does not enable TUN or expose a LAN listener. Local Gitea +traffic stays direct through `127.0.0.1:3001`. + +The WSL mihomo service is defined by `systemd/mihomo.service`. Its runtime +config is a private copy of the selected mac15 Clash profile at +`/home/dev/.config/mihomo/config.yaml`; the profile is not committed. Useful WSL commands: @@ -24,6 +29,7 @@ Useful WSL commands: systemctl status seal-use-release-sync.timer systemctl start seal-use-release-sync.service journalctl -u seal-use-release-sync.service -n 100 --no-pager +systemctl status mihomo.service ``` Credentials are stored as `0600` files under diff --git a/ops/infra-healthcheck.sh b/ops/infra-healthcheck.sh index 015617d..ac66ab1 100755 --- a/ops/infra-healthcheck.sh +++ b/ops/infra-healthcheck.sh @@ -38,10 +38,11 @@ results=( "$(check_local_proxy)" "$(check_ssh wsl_tailscale wsl-dev 'tailscale ip -4')" "$(check_ssh wsl_frp wsl-dev 'docker inspect -f "{{.State.Status}}" frpc-wsl-gateway')" + "$(check_ssh wsl_mihomo wsl-dev 'systemctl is-active --quiet mihomo.service && ss -ltn | grep -q "127.0.0.1:7897" && printf "service=active,listener=127.0.0.1:7897"')" "$(check_ssh wsl_release_sync_timer wsl-dev 'test "$(systemctl is-enabled seal-use-release-sync.timer 2>/dev/null)" = enabled && test "$(systemctl is-active seal-use-release-sync.timer 2>/dev/null)" = active && printf "timer=enabled,active"')" "$(check_ssh wsl_release_sync_last_success wsl-dev 'journalctl -q -u seal-use-release-sync.service -n 200 --no-pager | grep -E "fully synchronized to Gitea and Homebrew" | tail -1')" "$(check_ssh wsl_gitea wsl-dev 'curl -sS -o /dev/null -w "gitea_http=%{http_code}" http://127.0.0.1:3001/api/v1/version')" - "$(check_ssh wsl_github_proxy wsl-dev 'HTTPS_PROXY=http://192.168.3.62:7897 HTTP_PROXY=http://192.168.3.62:7897 NO_PROXY=127.0.0.1,localhost curl -sS -o /dev/null --connect-timeout 8 --max-time 15 -w "github_http=%{http_code}" https://github.com')" + "$(check_ssh wsl_github_proxy wsl-dev 'NO_PROXY= no_proxy= curl -sS -o /dev/null --proxy http://127.0.0.1:7897 --connect-timeout 8 --max-time 15 -w "github_http=%{http_code}" https://github.com')" "$(check_ssh windows_tailscale windows '"C:\Program Files\Tailscale\tailscale.exe" ip -4')" "$(check_ssh windows_wifi windows 'netsh wlan show interfaces | findstr /C:"SSID"')" "$(check_ssh mac13_proxy mac13 'curl -sS -o /dev/null --proxy http://127.0.0.1:7897 --connect-timeout 5 --max-time 15 -w "github_http=%{http_code}" https://github.com')" diff --git a/ops/systemd/mihomo.service b/ops/systemd/mihomo.service new file mode 100644 index 0000000..407159d --- /dev/null +++ b/ops/systemd/mihomo.service @@ -0,0 +1,16 @@ +[Unit] +Description=Local mihomo proxy for WSL services +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=dev +ExecStart=/usr/local/bin/mihomo -d /home/dev/.config/mihomo +Restart=on-failure +RestartSec=15 +LimitNOFILE=1048576 +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target diff --git a/ops/systemd/seal-use-release-sync.service b/ops/systemd/seal-use-release-sync.service index 9febbbc..cb84add 100644 --- a/ops/systemd/seal-use-release-sync.service +++ b/ops/systemd/seal-use-release-sync.service @@ -1,14 +1,15 @@ [Unit] Description=Promote GitHub releases to Gitea and Homebrew -After=network-online.target docker.service +After=network-online.target docker.service mihomo.service Wants=network-online.target +Requires=mihomo.service [Service] Type=oneshot User=dev WorkingDirectory=/home/dev/apps/seal-use-release-sync Environment=HOME=/home/dev -Environment=HTTP_PROXY=http://192.168.3.62:7897 -Environment=HTTPS_PROXY=http://192.168.3.62:7897 +Environment=HTTP_PROXY=http://127.0.0.1:7897 +Environment=HTTPS_PROXY=http://127.0.0.1:7897 Environment=NO_PROXY=127.0.0.1,localhost,100.82.151.105,git.ying-qing.cn ExecStart=/home/dev/apps/seal-use-release-sync/release-sync.sh