Repository navigation
feat: restore ollama_tailnet fish function - #45
Merged
Merged
Conversation
Brings back ollama_tailnet (removed in 9aef945), which serves the host's Ollama at https://ollama.<tailnet>.ts.net through a Tailscale container. Changes from the previous version: - Ctrl-c now stops the container. The old fish SIGINT handler never fired because the signal goes to the foreground process, so the container kept running. It now waits with `docker attach --sig-proxy`, which forwards ctrl-c to the container. - Pulls tailscale/tailscale:latest on each start so the node doesn't drift behind, falling back to the cached image if the pull fails. - Trimmed comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Start Ollama on 127.0.0.1 instead of 0.0.0.0. OrbStack containers can reach the host's localhost, so the LAN never needs access. - Attach to the container right after starting it and run the startup checks in a background process, so ctrl-c at any point stops the container. - Fail with an actionable message if the tailnet has HTTPS certificates disabled or the serve config isn't applied, instead of reporting success. - Print the node's real DNS name (Tailscale may rename it, e.g. ollama-1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require a non-empty CertDomains list. Tailscale reports "CertDomains": null when HTTPS is disabled, which passed the old check. - Track the container by the ID from docker run, so a second `up` in another terminal can't have its container removed by the first one's cleanup. - Show the last few container log lines before removing it on failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uests Ollama bound to 127.0.0.1 rejects requests whose Host header isn't localhost-like (403), and Tailscale Serve forwards the original ollama.<tailnet>.ts.net Host. Route Serve through a Caddy container that shares the Tailscale container's network and rewrites Host before proxying to the host's Ollama. Co-Authored-By: Claude Opus 5.5 <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.
Summary
Restores the
ollama_tailnetfish function (removed in 9aef945). It serves the host's Ollama athttps://ollama.<tailnet>.ts.netby running a Tailscale container in OrbStack that joins the tailnet as its ownollamanode.Changes from the previous version
127.0.0.1instead of0.0.0.0(OrbStack containers can still reach the host's localhost).*.ts.netHost. A Caddy container sharing the Tailscale container's network rewrites it.--on-signal SIGINThandler never fired (ctrl-c goes to the foreground process, not fish), so the container kept running.docker attach --sig-proxynow runs in the foreground right after start, with startup checks in a background process, so ctrl-c at any point stops and removes both containers.upcan't be removed by the first one's cleanup.ollama-1ifollamais taken).tailscale/tailscale:latestandcaddy:2on each start, falling back to cached images if the pull fails.Testing
End to end in an interactive fish under a pty, against a loopback-only Ollama:
ollama_tailnetstarts, HTTPS request over the tailnet returns{"version": ...}, a real ctrl-c keystroke removes both containers.upwhile the first runs: the first stops cleanly, the second keeps serving.*.ts.netHost, and Tailscale Serve preserves the incoming Host.Reviewed with Codex over 4 rounds; the last round had no findings.
🤖 Generated with Claude Code