From 4d552f5baa9470f0ba3487755beb37f74d6375c1 Mon Sep 17 00:00:00 2001 From: tegwick Date: Tue, 10 Mar 2026 01:19:38 +0100 Subject: [PATCH] feat(state-hub): add make tunnel target for reverse SSH to State Hub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tunnel command belongs here — it opens a reverse SSH tunnel so that a remote host can reach the local State Hub at 127.0.0.1:8000. Usage: make tunnel HOST=user@hostname Co-Authored-By: Claude Sonnet 4.6 --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) 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