restart-power-monitor
重啟 Strix Halo Power Monitor 電源監控服務與 Tailscale 旁路容器(sidecar)。當使用者要求重啟服務、Tailscale 網址無法載入、度數與電費計算異常、網頁 WebSockets 連線失敗或斷線,或是使用 /restart-power-monitor 時。此技能會依序重構並重新部署後端服務、重新建立 Tailscale 代理容器、自動偵測並修復 Tail
SKILL.mdrestart-power-monitor/SKILL.md
GitHubRestart Strix Halo Power Monitor
Use this skill when the Strix Halo Power Monitor web app or its Tailscale endpoint is unhealthy, non-responsive, or when the user explicitly requests /restart-power-monitor or "重啟 power-monitor / 電源監控 / 電費監控服務".
Just run it
Run the automated restart and diagnostic script on the host:
bash ~/.hermes/restart-power-monitor/scripts/restart.sh
The script automatically performs the following actions:
- Rebuilds and restarts the
power-monitorcontainer (FastAPI + WebSocket backend). - Force-recreates the
tailscalecontainer (sharing network namespace with the backend). - Verifies local API responsiveness at
http://localhost:8085/api/statswith a 30-second retry window. - Validates the Tailscale node status and resolves transient offline states (auto-restarting container if network is reported down).
- Tests the public HTTPS endpoint
https://power.crayfish-monitor.ts.net/to verify SSL reverse-proxying and Funnel reachability.
Live Architecture
| Piece | What | Managed by | Location |
|---|---|---|---|
| Backend & UI | FastAPI + SQLite database + HTML templates | Docker Compose service power-monitor (Port 8085:8000) |
main.py |
| Tailscale Sidecar | Tailscale node providing SSL HTTPS + Funnel on power.crayfish-monitor.ts.net |
Docker Compose service tailscale (network_mode: service:power-monitor) |
ts-entrypoint.sh |
[!IMPORTANT] Because the
tailscalesidecar usesnetwork_mode: service:power-monitor, any recreation of thepower-monitorcontainer invalidates the old network namespace. You MUST recreate/restart thetailscalecontainer as well. Do not restart them individually via simpledocker restart.
Manual Troubleshooting
If the script fails, follow these steps to manually diagnose the service:
A. Inspect Logs
# Check FastAPI backend logs
docker compose -f ~/src/power-monitor/docker-compose.yml logs power-monitor
# Check Tailscale sidecar and proxy logs
docker compose -f ~/src/power-monitor/docker-compose.yml logs tailscale
B. Verify Tailscale Status inside Container
If the public FQDN doesn't resolve, check if the Tailscale daemon inside the container is authenticated:
docker exec power-monitor-ts tailscale --socket=/tmp/tailscaled.sock status
If it shows "Tailscale cannot connect because the network is down", run:
docker compose -f ~/src/power-monitor/docker-compose.yml restart tailscale
C. Manual Deploy
If Compose configuration changes:
cd ~/src/power-monitor
docker compose up -d --build power-monitor
docker compose up -d --force-recreate tailscale