feat(tunnel): add make tunnel target; complete WP-0001

- Add `make tunnel` to Makefile: reads first host from
  inventory/servers.yaml and opens a reverse SSH tunnel
  forwarding local state-hub (port 8000) to the remote host
- Mark T02 done and close WP-0001 (all tasks complete)
- WP-0002 T01/T02 task IDs backfilled by consistency checker

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-03-09 19:53:10 +01:00
parent b32dfd4f5a
commit 15bb2978cc
3 changed files with 19 additions and 5 deletions

View file

@ -153,6 +153,11 @@ new-host: ## Add a new host quickly: make new-host NAME=core1 TYPE=cpx11 REGION=
@python3 scripts/new_host.py --name "$(NAME)" --type "$(TYPE)" --region "$(REGION)" --role "$(ROLE)" --image "$(IMG)" --user "$(USER)"
@echo "✔ Added host $(NAME) to inventory/servers.yaml"
tunnel: ## Open reverse SSH tunnel: forwards local state-hub (127.0.0.1:8000) to the first host in inventory
@python3 -c "import yaml; s=yaml.safe_load(open('inventory/servers.yaml'))['servers'][0]; print(s['ssh_user']+'@'+s['ip'])" | \
xargs -I{} ssh -R 8000:127.0.0.1:8000 {}
@echo "Tunnel closed."
remote-set: ## Set origin to your Gitea repo (GITEA/OWNER/REPO vars)
git remote remove origin 2>/dev/null || true
git remote add origin https://$(GITEA)/$(OWNER)/$(REPO).git