Repository navigation
Check this computer's Tailscale before deploying a Hub - #20
Merged
Merged
Conversation
Set up on a server no longer shows the existing-Hub Connect and Sign in steps under the Deploy button. They appear once the deployment hands the new Hub over, to show connection progress and offer retries. The selected setup path is highlighted. Maintenance shows one update button, and only when there is something to update to: an image chosen in Advanced options, otherwise the version of this Portal. The always-visible Update Hub button did nothing unless the image had been changed. Docs: the Hub README links to the install paths instead of repeating them. The manual deployment guide is the one place for running the Hub by hand, including the legacy forced-command mode. It no longer sends owners to /admin or asks for a web port, installs Tailscale from its own packages and builds with -p portal-hub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Advanced options repeated the whole setup as manual steps: check server, a Docker checkbox, install, open Tailscale, enable HTTPS, create the owner passkey and verify the connection. Deploy Hub / Resume setup already does all of this, can be repeated safely and recovers interrupted runs, so Advanced now holds only the Tailscale name, owner account name, Hub image and local image tar, plus Refresh status, Check readiness and View diagnostics. Two manual steps had no other route, so they move to the main view. Picking a saved server (or Manage server in Settings) now checks its status right away, which shows where setup stopped or the maintenance options; before, that needed Advanced → Refresh status. A ready Hub that this device is not signed in to offers Connect this device, which signs in without another SSH round trip. Removes the manual-only state and messages (preflight, install_docker, OpenEnrollment) and the per-phase guidance text. Installation requests always allow adding Docker; starting setup is the consent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A deployed Hub answers only on its private tailnet HTTPS name. When this computer was not on Tailscale, setup installed Docker, the Hub, Tailscale login and HTTPS, and only then reported that the Hub was unreachable. Deploy Hub and Resume setup now first ask the local tailscaled for its state over its socket (read-only, as tailscale status does, no new dependency). If Tailscale is missing or not connected, Portal says so and changes nothing on the server; the next click (Deploy anyway / Resume anyway) continues without checking again, for setups Portal cannot detect. The recovery record is saved only once setup starts. Tested against a fake local API and once against the real tailscaled on a connected Linux desktop. 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.
Third of three stacked PRs (after #19, base
hub-setup-advanced). Retarget once #19 merges.A deployed Hub answers only on its private tailnet HTTPS name. When this computer wasn't on Tailscale, setup went through Docker install, the Hub, Tailscale login and HTTPS, and only then reported "this computer cannot reach the Hub".
Deploy Hub / Resume setup now first asks the local
tailscaledfor itsBackendState. It sendsGET /localapi/v0/status?peers=falseover/run/tailscale/tailscaled.sock, falling back to/var/run/.... That is the same read-only accesstailscale statushas as a normal user, and it adds no dependency.NeedsLogin) or not found: Portal explains why it matters and changes nothing on the server. The button becomes Deploy anyway / Resume anyway, and that next click continues without checking again, for setups Portal can't detect (custom socket, sandbox, non-Linux).The end-of-setup "cannot reach" message stays as the fallback.
Tests
src/hub/tailnet.rsis tested against a fake local API on a temp Unix socket: running, needs-login, 403, bad JSON, missing socket.local_tailnet()once against the realtailscaledon this desktop; it returnedConnected. That throwaway test is not committed.cargo test --lib: 1236 passed. Clippy and fmt are clean; the deploy helper tests pass (69).🤖 Generated with Claude Code