tailscale/cmd/tailscaled
Brad Fitzpatrick bb4f458207 feature/captiveportal: move captive portal code out of ipnlocal, netcheck
Captive portal detection was half-migrated: it had a build tag and
buildfeatures constant, but its code still lived in build-tag-gated
files in ipn/ipnlocal and net/netcheck, with its per-backend state
(context, cancel func, signaling channel) as fields on LocalBackend.

Move it under feature/captiveportal. The health-driven detection loop
becomes an ipnext.Extension holding its own state: it starts and
stops the loop from the BackendStateChange hook and subscribes to
health.Change events on the eventbus itself, removing the captive
portal hooks and special cases from LocalBackend entirely. The DERP
map now comes from a new ipnext.NodeBackend.DERPMap method, and the
preferred DERP region from magicsock's last netcheck report (the
same underlying source as the previously used Hostinfo.NetInfo).

The netcheck probe hook is now exported with a signature free of
netcheck internals, and its implementation moves to the small
feature/captiveportal/netcheckhook package, which installs the hook
as an import side effect. That package stays free of tsd/wgengine
dependencies so the tailscale CLI can keep probing for captive
portals in "tailscale netcheck" without linking the daemon-side
extension. The net/captivedetection library itself is unchanged and
stays put; after this change it is only linked when something pulls
in netcheckhook or the feature extension.

tailscaled links the feature by default via condregister as before,
but tsnet no longer does (shrinking tsnet, k8s-operator, and tsidp);
tsnet users who want it can blank-import the feature package, and
tsnet's dep test now locks that in.

Updates #12614

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I3f1d09f9dc03e18f9a648ab5e42d16fa540b3fa9
2026-07-14 20:22:23 -04:00
..
childproc all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
tailscaledhooks all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
debug_forcereflect.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
debug.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
depaware-min.txt net/tstun,wgengine,ipn/ipnlocal: make tstun's peerConfigTable use RouteManager table 2026-07-14 12:41:11 -07:00
depaware-minbox.txt net/tstun,wgengine,ipn/ipnlocal: make tstun's peerConfigTable use RouteManager table 2026-07-14 12:41:11 -07:00
depaware.txt feature/captiveportal: move captive portal code out of ipnlocal, netcheck 2026-07-14 20:22:23 -04:00
deps_test.go wgengine,cmd/tailscaled,feature/bird: move BIRD integration to ./feature 2026-07-14 10:48:09 -07:00
flag.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
generate.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
install_darwin.go all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
install_windows.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
manifest_windows_386.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
manifest_windows_amd64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
manifest_windows_arm64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
netstack.go wgengine,ipn/ipnlocal,tsnet,cmd/tailscaled: remove PeerForIP from the Engine interface 2026-07-13 15:15:16 -07:00
proxy.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
required_version.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
sigpipe.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ssh.go ipn/ipnlocal, feature/ssh: move SSH code out of LocalBackend to feature 2026-03-10 17:27:17 -07:00
syspolicy.go cmd/tailscaled, util/syspolicy: add JSON syspolicy file support 2026-06-30 13:10:16 -07:00
tailscale-online.target cmd/tailscaled/*.{target,unit}: add systemd online target 2026-02-26 18:39:28 -08:00
tailscale-wait-online.service cmd/tailscaled/*.{target,unit}: add systemd online target 2026-02-26 18:39:28 -08:00
tailscaled_drive.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
tailscaled_notwindows.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
tailscaled_test.go cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
tailscaled_windows.go ipn/desktop: move behind feature/condregister 2026-04-07 11:37:47 -07:00
tailscaled.defaults cmd/tailscaled: rename relaynode reference in defaults file comment 2020-03-13 14:38:04 -07:00
tailscaled.go wgengine,cmd/tailscaled,feature/bird: move BIRD integration to ./feature 2026-07-14 10:48:09 -07:00
tailscaled.openrc tstest/integration/vms: use an in-process logcatcher (#2360) 2021-07-08 14:39:45 -04:00
tailscaled.service cmd/tailscaled: update documentation url 2026-02-09 07:09:11 -05:00
webclient.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
windows-manifest.xml cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
with_cli.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00