HH-635: let SSClash own Mihomo lifecycle #6

Merged
rogee merged 2 commits from agent/agent/96670445-web-state into main 2026-08-25 10:42:08 +08:00
Owner

Root cause

Bootstrap started Mihomo directly while SSClash Web UI only tracked Mihomo processes it started. This split lifecycle ownership made /api/status report stopped while Mihomo was running, so Web Start failed with “Mihomo already running”. Read-only host inspection found one SSClash and one Mihomo process and no stale PID files.

A review follow-up also found that volumes created before PR #4 retained the packaged GEOIP,CN rule and could attempt a runtime geoip.metadb download.

Fix

  • Make ssclash serve the only bootstrap-supervised process and let SSClash exclusively own Mihomo Start/Stop/status.
  • Keep the validated subscription as a managed in-memory provider link and validate updates against the persistent core/config.
  • Atomically migrate only the exact legacy packaged config to managed config version 1 with the local ChinaIp provider. Preserve customized legacy configs and fail with explicit remediation.
  • Use SSClash Web readiness for health checks and document the Web Start step.
  • Cover initial/same-volume Web Start, offline legacy-volume migration, and rollback failure through a fake controller.

Verification

  • ./scripts/test.sh (coverage 75.5%, minimum 65%)
  • ./tests/container-smoke.sh mohomo-docker:hh-635-config-migration
  • git diff --check

Fixes HH-635

## Root cause Bootstrap started Mihomo directly while SSClash Web UI only tracked Mihomo processes it started. This split lifecycle ownership made `/api/status` report stopped while Mihomo was running, so Web Start failed with “Mihomo already running”. Read-only host inspection found one SSClash and one Mihomo process and no stale PID files. A review follow-up also found that volumes created before PR #4 retained the packaged `GEOIP,CN` rule and could attempt a runtime `geoip.metadb` download. ## Fix - Make `ssclash serve` the only bootstrap-supervised process and let SSClash exclusively own Mihomo Start/Stop/status. - Keep the validated subscription as a managed in-memory provider link and validate updates against the persistent core/config. - Atomically migrate only the exact legacy packaged config to managed config version 1 with the local `ChinaIp` provider. Preserve customized legacy configs and fail with explicit remediation. - Use SSClash Web readiness for health checks and document the Web Start step. - Cover initial/same-volume Web Start, offline legacy-volume migration, and rollback failure through a fake controller. ## Verification - `./scripts/test.sh` (coverage 75.5%, minimum 65%) - `./tests/container-smoke.sh mohomo-docker:hh-635-config-migration` - `git diff --check` Fixes HH-635
rogee added 1 commit 2026-08-25 10:08:12 +08:00
HH-635: let SSClash own Mihomo lifecycle
Docker image / Test (pull_request) Successful in 2m29s
Docker image / Build and publish (pull_request) Successful in 2m43s
1c9c91f63e
Co-authored-by: multica-agent <github@multica.ai>
rogee added 1 commit 2026-08-25 10:30:02 +08:00
HH-635: migrate legacy managed configs
Docker image / Test (pull_request) Successful in 1m24s
Docker image / Build and publish (pull_request) Successful in 2m20s
6348abd765
Co-authored-by: multica-agent <github@multica.ai>
rogee merged commit f29a3fc855 into main 2026-08-25 10:42:08 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rogee/mohomo-docker#6