From a5a0cda295885b0da37a1d452d647c2838ca20dc Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Tue, 16 Dec 2025 14:35:25 -0800 Subject: [PATCH] Fix tailscale serve: use localhost:PORT, helpful error on Linux Tailscale serve only supports localhost or 127.0.0.1 as proxy targets. On Linux, prompts user to run `sudo tailscale set --operator=$USER` if access denied. --- bin/dev | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/dev b/bin/dev index 8c03122d0..f5e4d8d67 100755 --- a/bin/dev +++ b/bin/dev @@ -35,7 +35,11 @@ if [ "$USE_TAILSCALE" = "1" ]; then stop_tailscale() { tailscale serve --https=$TS_PORT off >/dev/null 2>&1; } trap stop_tailscale EXIT INT TERM - sudo tailscale serve --bg --https=$TS_PORT "http://fizzy.localhost:$PORT" >/dev/null 2>&1 + tailscale serve --bg --https=$TS_PORT localhost:$PORT >/dev/null 2>&1 + if ! tailscale serve status --json 2>/dev/null | jq -e ".TCP.\"$TS_PORT\"" >/dev/null 2>&1; then + echo "Error: tailscale serve failed. On Linux, run once: sudo tailscale set --operator=\$USER" >&2 + exit 1 + fi echo "Login with david@example.com to: https://$TS_HOSTNAME:$TS_PORT/" else echo "Login with david@example.com to: http://fizzy.localhost:$PORT/"