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
+3 -2
View File
@@ -380,9 +380,10 @@ def print_web_urls(manifest, lan_host=None):
if not web.get("port"):
return
host = web.get("host", "0.0.0.0")
local = "localhost" if host in ("0.0.0.0", "127.0.0.1") else host
local = "localhost" if host in ("0.0.0.0", "127.0.0.1", "tailnet") else host
urls = [f"http://{local}:{web['port']}/"]
if host == "0.0.0.0":
# The LAN URL only where a LAN browser can sign in (see web_access.py).
if host == "0.0.0.0" or (host == "tailnet" and web.get("lan") is True and web.get("lan_plain_login") is True):
lan_host = lan_host or urlsplit(manifest.get("public_url", "")).hostname
if lan_host and lan_host not in ("localhost", "127.0.0.1", "0.0.0.0"):
urls.append(f"http://{lan_host}:{web['port']}/")