feat(state-hub): add make tunnel target for reverse SSH to State Hub

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 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 01:19:38 +01:00
parent 651df73e3a
commit 4d552f5baa

View File

@@ -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