You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn
Nick Khyl b48c8db69c ipn/ipnlocal: set WantRunning upon an interactive login, but not during a seamless renewal or a profile switch
The LocalBackend's state machine starts in NoState and soon transitions to NeedsLogin if there's no auto-start profile,
with the profileManager starting with a new empty profile. Notably, entering the NeedsLogin state blocks engine updates.
We expect the user to transition out of this state by logging in interactively, and we set WantRunning to true when
controlclient enters the StateAuthenticated state.

While our intention is correct, and completing an interactive login should set WantRunning to true, our assumption
that logging into the current Tailscale profile is the only way to transition out of the NeedsLogin state is not accurate.
Another common transition path includes an explicit profile switch (via LocalBackend.SwitchProfile) or an implicit switch
when a Windows user connects to the backend. This results in a bug where WantRunning is set to true even when it was
previously set to false, and the user expressed no intention of changing it.

A similar issue occurs when switching from (sic) a Tailnet that has seamlessRenewalEnabled, regardless of the current state
of the LocalBackend's state machine, and also results in unexpectedly set WantRunning. While this behavior is generally
undesired, it is also incorrect that it depends on the control knobs of the Tailnet we're switching from rather than
the Tailnet we're switching to. However, this issue needs to be addressed separately.

This PR updates LocalBackend.SetControlClientStatus to only set WantRunning to true in response to an interactive login
as indicated by a non-empty authURL.

Fixes #6668
Fixes #11280
Updates #12756

Signed-off-by: Nick Khyl <nickk@tailscale.com>
3 months ago
..
conffile cmd/tailscaled, ipn/conffile: support ec2 user-data config file 6 months ago
ipnauth ipn/{ipnauth,ipnlocal,ipnserver,localapi}: start baby step toward moving access checks from the localapi.Handler to the LocalBackend 3 months ago
ipnlocal ipn/ipnlocal: set WantRunning upon an interactive login, but not during a seamless renewal or a profile switch 3 months ago
ipnserver ipn/{ipnauth,ipnlocal,ipnserver,localapi}: start baby step toward moving access checks from the localapi.Handler to the LocalBackend 3 months ago
ipnstate cmd/tl-longchain: tool to re-sign nodes with long rotation signatures 3 months ago
localapi ipn/{ipnauth,ipnlocal,ipnserver,localapi}: start baby step toward moving access checks from the localapi.Handler to the LocalBackend 3 months ago
policy ipn,tailconfig: clean up unreleased and removed app connector service 1 year ago
store all: add test for package comments, fix, add comments as needed 5 months ago
backend.go health: begin work to use structured health warnings instead of strings, pipe changes into ipn.Notify (#12406) 5 months ago
conf.go ipn,wgengine/magicsock: allow setting static node endpoints via tailscaled configfile (#12882) 4 months ago
doc.go all: update copyright and license headers 2 years ago
ipn_clone.go cmd/cloner, cmd/viewer, util/codegen: add support for generic types and interfaces 5 months ago
ipn_test.go all: do not depend on the testing package 6 months ago
ipn_view.go ipn,wgengine: remove vestigial Prefs.AllowSingleHosts 6 months ago
prefs.go ipn: allow FQDN in exit node selection 4 months ago
prefs_test.go ipn: allow FQDN in exit node selection 4 months ago
serve.go cmd/serve: don't convert localhost to 127.0.0.1 5 months ago
serve_test.go cmd/serve: don't convert localhost to 127.0.0.1 5 months ago
store.go ipn: add comment about thread-safety to StateStore 9 months ago
store_test.go ipn: avoid useless no-op WriteState calls 1 year ago