nn: serve Hugo over the tailscale IP when the host has one#986
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a Hugo project is detected and the host has a tailscale IPv4,
bin/nnnow sets up the sandbox to serve the site over tailscale and inspect it:1313–1316) via--open-portsohugo server --bind $TAILSCALE_IPcan bind+listen (the default chain'sopen_portdoesn't cover 1313).$TAILSCALE_IPand prints a copy-pasteable serve command.NO_PROXYso 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/nnso the grant follows the project even when a pre-generated.nono/profile.jsonor a--profileoverride skips the mixin auto-gen block. Gated on a tailscale IP existing, so non-tailnet Hugo sandboxes keep the ports closed andNO_PROXYat 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.batscases (39 pass total): ports +TAILSCALE_IP+NO_PROXYwired when a tailscale IP exists; nothing opened when it doesn't; no tailscale probing outside Hugo projects.nono/CLAUDE.mdgains a §2c documenting the mechanism.🤖 Generated with Claude Code