Skip to content

nn: serve Hugo over the tailscale IP when the host has one#986

Merged
oalders merged 1 commit into
mainfrom
hugo-tailscale-serve
Jul 8, 2026
Merged

nn: serve Hugo over the tailscale IP when the host has one#986
oalders merged 1 commit into
mainfrom
hugo-tailscale-serve

Conversation

@oalders

@oalders oalders commented Jul 8, 2026

Copy link
Copy Markdown
Owner

What

When a Hugo project is detected and the host has a tailscale IPv4, bin/nn now sets up the sandbox to serve the site over tailscale and inspect it:

  • Opens Hugo's serve ports (1313–1316) via --open-port so hugo server --bind $TAILSCALE_IP can bind+listen (the default chain's open_port doesn't cover 1313).
  • Exports $TAILSCALE_IP and prints a copy-pasteable serve command.
  • Appends the tailscale IP to NO_PROXY so an in-sandbox client (curl, the Playwright MCP) reaches the served site directly instead of through the credential proxy.

Hugo detection is factored to the top of bin/nn so the grant follows the project even when a pre-generated .nono/profile.json or a --profile override skips the mixin auto-gen block. Gated on a tailscale IP existing, so non-tailnet Hugo sandboxes keep the ports closed and NO_PROXY at loopback.

Why

nono's network mediation is port-based, so serving on the tailscale IP just needs the serve port opened; the IP is what Hugo binds to. This lets the site be served to other tailnet devices and inspected from inside the sandbox.

Tests

3 new test/nn.bats cases (39 pass total): ports + TAILSCALE_IP + NO_PROXY wired when a tailscale IP exists; nothing opened when it doesn't; no tailscale probing outside Hugo projects. nono/CLAUDE.md gains a §2c documenting the mechanism.

🤖 Generated with Claude Code

When a Hugo project is detected and the host has a tailscale IPv4, open
Hugo's serve ports (1313-1316) so `hugo server --bind $TAILSCALE_IP` can
bind+listen, export $TAILSCALE_IP, and append the IP to NO_PROXY so an
in-sandbox client (curl, the Playwright MCP) reaches the served site
directly instead of through the credential proxy. This lets the site be
served to other tailnet devices and inspected from inside the sandbox.

Hugo detection is factored out to the top of bin/nn so the grant follows
the project even when a pre-generated .nono/profile.json or a --profile
override skips the mixin auto-gen block. Gated on a tailscale IP existing
so non-tailnet Hugo sandboxes keep the ports closed and NO_PROXY at
loopback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@oalders oalders merged commit 642946a into main Jul 8, 2026
1 check passed
@oalders oalders deleted the hugo-tailscale-serve branch July 8, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant