Show the tailnet's HTTPS services in the Tailscale panel - #10558
Open
Lethaquell wants to merge 2 commits into
Open
Show the tailnet's HTTPS services in the Tailscale panel#10558Lethaquell wants to merge 2 commits into
Lethaquell wants to merge 2 commits into
Conversation
The panel's README has listed `r` as refresh since the widget landed, but nothing ever bound the key: pressing it did nothing.
A tailnet can advertise services that resolve inside it, and until now the panel had no idea they existed: the machine list answered "which machines do I have", but never "is the thing I actually open still up". The services ride the status poll that already runs. `tailscale status --json` carries them in the node's capability map, so listing them costs no second daemon call — only their reachability needs asking, and that is one curl checking every URL in parallel. There is nothing to configure. The second tab exists only while the tailnet advertises services, so a tailnet without them sees the panel it always had and never runs a probe. Probing follows the panel: with it open the probe rides each status refresh, with it closed at most every five minutes, which is all the icon's dot needs. The dot in the bar icon appears only when an advertised service has been probed and did not answer, so an unmarked icon still means there is nothing to look at. Co-Authored-By: Claude Opus 5 (1M context) <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.
Two commits: the first binds the
rrefresh the panel's README has alwaysdocumented but nothing implemented, the second is the feature below.
The Tailscale panel answers "which machines do I have", but never "is the thing
I actually open still up". A tailnet can advertise services —
svc:docs,svc:wiki— that resolve inside it, and the panel had no idea they existed.This adds a second tab listing them: the URL, the machine currently answering
for it, and the result of a reachability probe. Clicking a row opens it in the
browser.
Nothing to configure
The tab exists only while the tailnet advertises services to this node. A
tailnet without them sees the panel it always had — no chips, no section, and
no probe ever runs. There is no setting because there is no decision to make:
the tailnet already answered the question.
Where the data comes from
tailscale status --jsonalready carries the services in the node's capabilitymap, and the panel already polls it for the machine list — so listing them
costs no second daemon call. Only reachability needs asking, and that is one
curlchecking every URL in parallel.Probing follows the panel: with it open the probe rides each status refresh;
with it closed, at most every five minutes, which is all the bar icon's dot
needs. The dot appears only when an advertised service is not answering, so an
unmarked icon still means there is nothing to look at.
Notes for review
curlexits non-zero as soon as any single transfer fails and still reportsevery URL it tried, so the probe reads its output rather than its exit
status: one unreachable service is a row to colour red, not a failed probe.
~/.curlrc, no proxy, no plaintext, noredirects, no credentials, no unbounded wait — because it runs unattended on
a timer against whatever the tailnet advertises.
is not a valid label is skipped rather than turned into a URL.
functions in
Model.js, so the whole feature is testable without a tailnet.Testing
test/shell.d/tailscale-test.shpasses, with new assertions coveringdiscovery, host selection, the probe command's flags, probe parsing and the
join.
keyboard switching, and the degraded state (one service answering 502,
another with no current host).
neutral rather than red, and the bar dot stays down until a probe has
actually come back.
renders exactly the panel that shipped before — no tabs, no section, no
probe.
Credit
The discovery approach — reading the
services/capabilities, filtering totcp:443, and matching a service's addresses against peers'PrimaryRoutes—comes from digitalbase/omarchy-tailscale-services
(MIT), a third-party bar widget that shows this in a panel of its own. The
implementation here is written from scratch to fit
Model.jsand the existingstatus poll, but the credit for working out where the data lives belongs there.
Preview