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/cmd/tailscale
Simon Law e9324236e8 cmd/tailscale: fix default for `tailscale set --accept-routes`
The default values for `tailscale up` and `tailscale set` are supposed
to agree for all common flags. But they don’t for `--accept-routes`
on Windows and from the Mac OS App Store, because `tailscale up`
computes this value based on the operating system:

    user@host:~$ tailscale up --help 2>&1 | grep -A1 accept-routes
      --accept-dns, --accept-dns=false
            accept DNS configuration from the admin panel (default true)
    user@host:~$ tailscale set --help 2>&1 | grep -A1 accept-routes
      --accept-dns, --accept-dns=false
            accept DNS configuration from the admin panel

Luckily, `tailscale set` uses `ipn.MaskedPrefs`, so the default values
don’t logically matter. But someone will get the wrong idea if they
trust the `tailscale set --help` documentation.

In addition, `ipn.Prefs.RouteAll` defaults to true so it disagrees
with both of the flags above.

This patch makes `--accept-routes` use the same logic for in both
commands by hoisting the logic that was buried in `cmd/tailscale/cli`
to `ipn.Prefs.DefaultRouteAll`. Then, all three of defaults can agree.

Fixes: #15319

Signed-off-by: Simon Law <sfllaw@sfllaw.ca>
9 months ago
..
cli cmd/tailscale: fix default for `tailscale set --accept-routes` 9 months ago
depaware.txt tsweb: split promvarz into an optional dependency 9 months ago
generate.go cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS 3 years ago
manifest_windows_386.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
manifest_windows_amd64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
manifest_windows_arm64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago
tailscale.go all: update copyright and license headers 3 years ago
tailscale_test.go net/ipset, wgengine/filter/filtertype: add split-out packages 1 year ago
windows-manifest.xml cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 3 years ago