Listen on loopback and tailnet by default; make the plain-HTTP LAN opt-in

The web proxy binds the wildcard and drops connections that are not
loopback or Tailscale at both ends. A LAN listener is opt-in (web.lan) and
refuses sign-in and signed-in pages over plain HTTP unless
web.lan_plain_login is set. Existing installs keep their bind address with
a warning. Without the LAN the mDNS advert carries only the tailnet and
public routes (lan=0).
This commit is contained in:
2026-11-10 01:02:02 +00:00
parent a706739088
commit ad6cdab418
18 changed files with 677 additions and 35 deletions
@@ -113,11 +113,16 @@ class DiscoveredServer {
DiscoveredAddress(route: DiscoveredRoute.public, endpoint: public),
);
}
// lan=0: the web proxy refuses LAN connections, so the address record is
// not a LAN route; the first tailnet or public route is the endpoint.
if (attributes['lan'] == '0') routes.removeAt(0);
if (routes.isEmpty) return null;
final first = routes.first.endpoint;
return DiscoveredServer(
name: name.isEmpty ? instance : name,
host: host,
port: port,
secure: secure,
host: first.host,
port: first.port,
secure: first.scheme == 'wss',
path: cleanPath,
passwordRequired: attributes['auth'] != 'none',
version: attributes['v'],