tailscale/cmd/tailscale
Brad Fitzpatrick 87c804b481 cmd/tailscale: rewrite the "up" checker, fix bugs
The old way was way too fragile and had felt like it had more special
cases than normal cases. (see #1874, #1860, #1834, etc) It became very
obvious the old algorithm didn't work when we made the output be
pretty and try to show the user the command they need to run in
5ecc7c7200 for #1746)

The new algorithm is to map the prefs (current and new) back to flags
and then compare flags. This nicely handles the OS-specific flags and
the n:1 and 1:n flag:pref cases.

No change in the existing already-massive test suite, except some ordering
differences (the missing items are now sorted), but some new tests are
added for behavior that was broken before. In particular, it now:

* preserves non-pref boolean flags set to false, and preserves exit
  node IPs (mapping them back from the ExitNodeID pref, as well as
  ExitNodeIP),

* doesn't ignore --advertise-exit-node when doing an EditPrefs call
  (#1880)

* doesn't lose the --operator on the non-EditPrefs paths (e.g. with
  --force-reauth, or when the backend was not in state Running).

Fixes #1880

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit 5190435d6e)
2021-05-07 09:32:33 -07:00
..
cli cmd/tailscale: rewrite the "up" checker, fix bugs 2021-05-07 09:32:33 -07:00
depaware.txt cmd/tailscale: make 'file cp' have better error messages on bad targets 2021-05-03 10:33:55 -07:00
tailscale.go cmd/tailscale: add web subcommand 2021-03-29 12:13:19 -07:00