diff --git a/Makefile b/Makefile index db1b097..914e55c 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,15 @@ dashboard: check: curl -sf http://127.0.0.1:8000/state/health | python3 -m json.tool +## Open a reverse SSH tunnel so a remote host can reach the local State Hub. +## Usage: make tunnel HOST=user@hostname +## The remote host will then reach the hub at http://127.0.0.1:8000 +tunnel: + @test -n "$(HOST)" || (echo "ERROR: HOST is required. Usage: make tunnel HOST=user@hostname"; exit 1) + @echo "Opening reverse tunnel → $(HOST) (remote :8000 → local :8000)" + @echo "Keep this terminal open. Ctrl-C to close the tunnel." + ssh -R 8000:127.0.0.1:8000 $(HOST) + start: db sleep 3 $(MAKE) migrate