summaryrefslogtreecommitdiffhomepage
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05net/dns: unify the OS manager and internal resolver.David Anderson1-1/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-05wgengine: move DNS configuration out of wgengine/router.David Anderson1-0/+7
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-02wgengine/...: split into multiple receive functionsJosh Bleecher Snyder1-1/+1
Upstream wireguard-go has changed its receive model. NewDevice now accepts a conn.Bind interface. The conn.Bind is stateless; magicsock.Conns are stateful. To work around this, we add a connBind type that supports cheap teardown and bring-up, backed by a Conn. The new conn.Bind allows us to specify a set of receive functions, rather than having to shoehorn everything into ReceiveIPv4 and ReceiveIPv6. This lets us plumbing DERP messages directly into wireguard-go, instead of having to mux them via ReceiveIPv4. One consequence of the new conn.Bind layer is that closing the wireguard-go device is now indistinguishable from the routine bring-up and tear-down normally experienced by a conn.Bind. We thus have to explicitly close the magicsock.Conn when the close the wireguard-go device. One downside of this change is that we are reliant on wireguard-go to call receiveDERP to process DERP messages. This is fine for now, but is perhaps something we should fix in the future. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-04-01wgengine/router: move DNS cleanup into the DNS package.David Anderson1-0/+2
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-01cmd/tailscaled: rename isUserspace to useNetstackBrad Fitzpatrick1-8/+8
The bool was already called useNetstack at the caller. isUserspace (to mean netstack) is confusing next to wgengine.NewUserspaceEngine, as that's a different type of 'userspace'. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-04-01net/dns/resolver: add live reconfig, plumb through to ipnlocal.David Anderson1-1/+1
The resolver still only supports a single upstream config, and ipn/wgengine still have to split up the DNS config, but this moves closer to unifying the DNS configs. As a handy side-effect of the refactor, IPv6 MagicDNS records exist now. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-31net/dns/resolver: factor the resolver out into a sub-package.David Anderson1-0/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-31ipn: replace SetWantRunning(bool) with EditPrefs(MaskedPrefs)Brad Fitzpatrick1-1/+6
This adds a new ipn.MaskedPrefs embedding a ipn.Prefs, along with a bunch of "has bits", kept in sync with tests & reflect. Then it adds a Prefs.ApplyEdits(MaskedPrefs) method. Then the ipn.Backend interface loses its weirdo SetWantRunning(bool) method (that I added in 483141094c for "tailscale down") and replaces it with EditPrefs (alongside the existing SetPrefs for now). Then updates 'tailscale down' to use EditPrefs instead of SetWantRunning. In the future, we can use this to do more interesting things with the CLI, reconfiguring only certain properties without the reset-the-world "tailscale up". Updates #1436 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-31cmd/tailscaled: remove tailscaled binary on uninstall-system-daemonMaisem Ali1-6/+15
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2021-03-31cmd/tailscale, ipn/localapi: add "tailscale bugreport" subcommandMaisem Ali2-0/+39
Adding a subcommand which prints and logs a log marker. This should help diagnose any issues that users face. Fixes #1466 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2021-03-31cmd/tailscale, ipn/localapi: move IP forwarding check to tailscaled, APIBrad Fitzpatrick1-34/+2
Instead of having the CLI check whether IP forwarding is enabled, ask tailscaled. It has a better idea. If it's netstack, for instance, the sysctl values don't matter. And it's possible that only the daemon has permission to know. Fixes #1626 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-31cmd/tailscale/cli: split out web.css fileDavid Crawshaw3-1340/+1347
CSS formatted with: npx prettier --use-tabs --write cmd/tailscale/cli/web.css Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-03-31cmd/tailscale: add initial web UI (#1621)Ross Zurowski2-38/+1552
Signed-off-by: Ross Zurowski <ross@rosszurowski.com>
2021-03-30ipn/{ipnlocal,localapi}, client/tailscale: add file get/delete APIsBrad Fitzpatrick1-0/+28
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-30cmd/tailscale/cli: add debug --ipn modeBrad Fitzpatrick1-0/+23
To watch the IPN message bus. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-30client/tailscale, cmd/tailscale/cli: plumb --socket throughDavid Crawshaw1-0/+3
Without this, `tailscale status` ignores the --socket flag on macOS and always talks to the IPNExtension, even if you wanted it to inspect a userspace tailscaled. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-03-29cmd/tailscale/cli: factor out filename selectionBrad Fitzpatrick1-7/+25
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-29cmd/tailscale/cli: add push subcommandBrad Fitzpatrick2-0/+156
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-29cmd/tailscale/cli: factor out tailscaleIPFromArg from ping commandBrad Fitzpatrick1-29/+31
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-29net/{packet,tstun}: send peerapi port in TSMP pongsBrad Fitzpatrick2-2/+9
For discovery when an explicit hostname/IP is known. We'll still also send it via control for finding peers by a list. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-29cmd/tailscale: add web subcommandDavid Crawshaw5-4/+275
Used as an app frontend UI on Synology. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-03-28wgengine: make Tun optional again, default to fake.David Anderson2-8/+6
This makes setup more explicit in prod codepaths, without requiring a bunch of arguments or helpers for tests and userspace mode. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-28wgengine: default Router to a no-op router.David Anderson2-1/+14
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-28wgengine: remove Config.TUN argument.David Anderson1-1/+0
2021-03-27wgengine: make the tun.Device required at construction.David Anderson2-5/+6
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: rename NewFakeTUN to NewFake.David Anderson1-1/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: merge in wgengine/tstun.David Anderson2-6/+4
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: rename from net/tun.David Anderson3-6/+6
We depend on wireguard-go/tun, identical leaf packages can be confusing in code. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26wgengine: pass in an explicit router.Router, rather than a generator.David Anderson1-1/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26cmd/tailscaled: readd tun.Diagnose call, mistakenly lost during refactor.David Anderson1-0/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26wgengine: remove Config.TUNName, require caller to create device.David Anderson3-13/+33
Also factors out device creation and associated OS workarounds to net/tun. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26control/controlclient: sign RegisterRequest (#1549)Adrian Dewhurst1-1/+3
control/controlclient: sign RegisterRequest Some customers wish to verify eligibility for devices to join their tailnets using machine identity certificates. TLS client certs could potentially fulfill this role but the initial customer for this feature has technical requirements that prevent their use. Instead, the certificate is loaded from the Windows local machine certificate store and uses its RSA public key to sign the RegisterRequest message. There is room to improve the flexibility of this feature in future and it is currently only tested on Windows (although Darwin theoretically works too), but this offers a reasonable starting place for now. Updates tailscale/coral#6 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2021-03-25wgengine/router/dns: move to net/dns.David Anderson1-4/+3
Preparation for merging the APIs and whatnot. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-25Revert "cmd/tailscaled: split package main into main shim + package"Brad Fitzpatrick7-46/+29
This reverts commit b81bd8025b71f35295201d18011855c1cfae630e. Not needed. See: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
2021-03-24cmd/tailscaled: split package main into main shim + packageBrad Fitzpatrick7-29/+46
So we can empty import the guts of cmd/tailscaled from another module for go mod tidy reasons. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-24cmd/tailscale: add "tailscale ip [-4] [-6]" commandBrad Fitzpatrick2-0/+70
This adds an easy and portable way for us to document how to get your Tailscale IP address. $ tailscale ip 100.74.70.3 fd7a:115c:a1e0:ab12:4843:cd96:624a:4603 $ tailscale ip -4 100.74.70.3 $ tailscale ip -6 fd7a:115c:a1e0:ab12:4843:cd96:624a:4603 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-24net/packet, wgengine/{filter,tstun}: add TSMP pingBrad Fitzpatrick1-1/+11
Fixes #1467 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-20net/packet, wgengine/filter: support SCTPBrad Fitzpatrick2-0/+2
Add proto to flowtrack.Tuple. Add types/ipproto leaf package to break a cycle. Server-side ACL work remains. Updates #1516 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-19cmd/tailscale/cli: use double hypens, make default usage func more clearBrad Fitzpatrick4-9/+82
Mash up some code from ffcli and std's flag package to make a default usage func that's super explicit for those not familiar with the Go style flags. Only show double hyphens in usage text (but still accept both), and show default values, and only show the proper usage of boolean flags. Fixes #1353 Fixes #1529 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-19control, ipn, tailcfg: remove golang.org/x/oauth2 dep, add tailcfg.Oauth2TokenBrad Fitzpatrick2-9/+3
golang.org/x/oauth2 pulls in App Engine and grpc module dependencies, screwing up builds that depend on this module. Some background on the problem: https://go.googlesource.com/proposal/+/master/design/36460-lazy-module-loading.md Fixes tailscale/corp#1471 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-19net/interfaces: use windows API to get the default route instead of parsing ↵Aleksandar Pesic2-2/+2
`route print` output Fixes: #1470 Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
2021-03-18cmd/tailscale, ipn/localapi: get daemon version from localapi statusBrad Fitzpatrick1-25/+6
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-18cmd/tailscale, ipn/localapi: use localapi for status, not IPN acrobaticsBrad Fitzpatrick5-71/+28
Yay simpler code. Tested on Linux, macOS and Windows. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-18cmd/tailscale/cli: fix typo in commentBrad Fitzpatrick1-1/+1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-18logpolicy: set log target on windows based on a registry key (#1542)Christine Dodrill1-0/+1
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-03-17wgengine/netstack: use inet.af/netstack, remove 64-bit only limitationBrad Fitzpatrick1-32/+32
This reverts the revert commit 84aba349d9a8d4e43585856c8155385f2569d35a. And changes us to use inet.af/netstack. Updates #1518 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-16Revert "wgengine/netstack: update gvisor to remove 64-bit only limitation"David Anderson1-5/+5
Breaks our corp repo due to gRPC dependency hell. This reverts commit d42f8b7f9a29a288058a03ebdf740e11b843bf26.
2021-03-16Revert "cmd/tailscaled, ipn/{ipnlocal,ipnserver}: let netstack get access to ↵Brad Fitzpatrick1-4/+0
LocalBackend" This reverts commit 2bc518dcb248abb0a84f0ebf7a2d12203d106c66. @namansood didn't end up needing it in his 770aa71ffbfbb01f7c8bfc65ce5e0505c783efde.
2021-03-15wgengine/netstack: update gvisor to remove 64-bit only limitationBrad Fitzpatrick1-5/+5
gVisor fixed their google/gvisor#1446 so we can include gVisor mode on 32-bit machines. A few minor upstream API changes, as normal. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-15cmd/tailscale/cli: include GOOS in BSD warning messageBrad Fitzpatrick1-1/+1
instead of just lowercase "bsd" Updates #1475 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>