Repository navigation
Open in editor: allow configuring the advertised SSH host instead of <hostname>.local #10326
Replies: 6 comments
|
Adding a second case here per the close on #10906, plus a concrete option for the fix. Case: T3 server on an exe.dev VM (machine hostname Option: prefer the hostname the client paired through. The client already holds a name it has proven it can reach. Proposed precedence:
Keep an empty advertised list as "No SSH route" so a server without sshd is unchanged. Relay and T3 Connect targets have no direct URL and keep today's behavior. LAN IPs work as SSH hosts, so LAN pairings benefit too. Client-only change in Where it falls short: an HTTP-only tunnel hostname in front of the server (Cloudflare tunnel, ngrok) would be preferred and then fail on SSH. The Happy to send a PR for the paired-hostname change, or for the flag, whichever the maintainers prefer. |
|
I hit the same wall on a headless NixOS host where sshd sits on a non-default port and the tailnet name is not what clients have in their I will open a PR against |
|
Another case for the "prefer the host the client connected through" option above. The server is on two tailnets. The default I opened #17252 with that precedence: SSH alias, then the host of the route the client is connected over (names and IPs, IPv6 handled for Remote-SSH and Zed), then the advertised targets for T3 Connect, SSH tunnels and loopback. It's client-only, and a configured target from #11207 could slot in ahead of the connection host. (Claude Opus 5.5 in OpenCode wrote this from my notes.) |
|
@juliusmarminge #17252 was closed pending a maintainer call on this, so asking here: is it OK for "Open in editor" to prefer the host the client connected through over the advertised SSH targets by default? What it does: the desktop SSH alias still wins; otherwise the host of the route the client is connected over (names and IPs) goes first; relay, loopback, SSH-forward and not-yet-connected clients fall back to the advertised list as today, and an empty list still means no sshd. That fixes the cases above, where the advertised name doesn't resolve for the client (two tailnets, a cloud VM reached by DNS name). The tradeoff: a client that reaches T3 through a reverse proxy or tunnel on another machine (a Cloudflare tunnel, say) would get the proxy's hostname, which doesn't take SSH. Before, that setup only worked if the first advertised host happened to be a Tailscale name the client could reach. An operator-configured host (#11207) would cover it and should take precedence once it exists. If that default is fine, I'll ask to reopen #17252. If you'd rather keep the advertised list first, say so and I'll drop it. |
|
This came up for me when using a VPS provider that vended me a public IP address with no DNS. I set it up on T3 via IP, but "Open in VS Code" failed, as it tried to use a I also support reopening #17252. |
|
Adding a concrete case, plus where each existing proposal stops short. The conclusion is that this needs no redesign of host selection — an override is enough, and the only real decision is where it lives. Setup. T3 server on a headless Linux box, #27236 does not reach a browser client#27236 fixes a real bug (a saved SSH route ignored when the preferred route is not SSH) by scanning every saved route and taking the first #17252 gets the host right but drops the userPreferring the host the client connected over is the only client-side change that yields the right host here ( An override is enough — the placement is the only real choiceEither placement fixes the reported case:
Both can accept The one thing a host override cannot carry on its own is the port: Proposal for the direction call: approve an override, server-side target first, with the client-side override as the follow-up for clients that need their own name, and |
Uh oh!
There was an error while loading. Please reload this page.
Problem
"Open in VS Code" from a browser/desktop client against a headless
t3 servehost only ever offers two SSH targets, computed server-side inRemoteOpenTargets(packages/server/.../remoteOpenTargets): the Tailscale MagicDNS name, else<os.hostname() first label>.local.On a LAN/VPN setup without Tailscale and without mDNS, the button produces
vscode://vscode-remote/ssh-remote+t3code.local/..., which no client can resolve:t3code.localnever answers on the LAN;t3code-ssh.example.com) that every client, on any machine, resolves through the internal DNS.Today the only workaround is a
Host t3code.localalias in~/.ssh/configon every client machine.Related but different: #7530 (same-machine LAN IP classified as remote), #8278 (Docker hop). Both are about whether the SSH path is taken; this one is about which host it advertises.
Proposal
Let the operator name the advertised SSH host, e.g. a
--remote-open-host <fqdn>flag ont3 serveor aT3CODE_REMOTE_OPEN_HOSTenv var (fits the existingT3CODE_HOSTpattern for the background service drop-in). When set, it becomes the firstRemoteOpenTarget(a new kind"configured", or reuse"tailscale"semantics of "reachable from anywhere"), ahead of the auto-detected tailnet/mDNS targets.Optionally also accept a
user@hostform so the deep link can carry the SSH user.Version:
[email protected], Linux host (Debian 13 LXC), background service.All reactions