From 299e412518c922468899761e74b8e83ed3514dcf Mon Sep 17 00:00:00 2001 From: marvin Date: Sat, 26 Sep 2026 16:32:29 +0200 Subject: [PATCH] Add scripts/expose.sh: tailcat tunnel for remote access tailcat (Tailscale data plane, no control plane) forwards the VM's web UI and SSH ports to another machine via a stable saved-key address; outbound-only, so it works through the nested slirp NAT. --- README.md | 17 +++++++++++++++++ scripts/expose.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 scripts/expose.sh diff --git a/README.md b/README.md index ff0e9f1..3d1200d 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,23 @@ scripts/run.sh - Ops SSH: `ssh -i configs/ssh/id_ed25519 -p 2222 marvin@localhost` - QEMU runs foreground; quit with `ctrl-a x` +### Access from another machine (tailcat) + +`localhost` above is the machine running QEMU. To reach the VM from +elsewhere, run `scripts/expose.sh` next to it — a tailcat tunnel +(WireGuard over Tailscale's DERP relays, outbound-only, no account): + +``` +host $ scripts/expose.sh +# 🐈 Server listening with saved key "default": tcpGFwWCCH... + +your $ tailcat forward tcpGFwWCCH... 8080:8080 2222:2222 +``` + +Then browse `http://localhost:8080` / `ssh -p 2222 marvin@localhost` +from *your* machine. The address is stable across VM restarts (saved +key) and is a bearer secret — share it only privately. + ### LLM backend `[models.tensorx]` in `configs/turnstone/config.toml` points at the diff --git a/scripts/expose.sh b/scripts/expose.sh new file mode 100755 index 0000000..91089f7 --- /dev/null +++ b/scripts/expose.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Expose the turnstone VM to another machine via tailcat (Tailscale's +# data plane without its control plane — outbound-only, works through +# the nested slirp NAT). +# +# scripts/expose.sh # foreground; ctrl-c to stop +# +# Prints a stable tailcat address (saved key at +# ~/.config/tailcat/keys/default.private.json). On the client machine: +# +# tailcat forward 8080:8080 2222:2222 +# +# then browse http://localhost:8080 and ssh -p 2222 as usual. +set -euo pipefail +cd "$(dirname "$0")/.." + +TC="${TAILCAT_BIN:-$HOME/.local/bin/tailcat}" +PORTS="${TAILCAT_PORTS:-8080,2222}" + +if ! command -v "$TC" >/dev/null 2>&1; then + echo "tailcat not found at $TC" >&2 + echo "install it first: https://github.com/tailscale/tailcat (INSTALL.md)" >&2 + exit 1 +fi + +# Stable address across restarts: create the saved key once +if [ ! -f "$HOME/.config/tailcat/keys/default.private.json" ]; then + "$TC" genkey --key=default +fi + +exec "$TC" serve --key=default "$PORTS"