Commit Graph
162 Commits
Author SHA1 Message Date
Simeng He 11a1a9096d More logging :( 2021-05-28 16:58:15 -04:00
Simeng He bb3db20e74 2021-05-27 15:04:56 -04:00
Simeng He 5d1be01d44 Obnoxious changes 2021-05-26 11:08:40 -04:00
Simeng He 6725596a0a Morelogs 2021-05-25 13:00:32 -04:00
Simeng He 93b5da680c Added Pingrequest addition, not hard coded added test stubs 2021-05-20 15:27:55 -04:00
Simeng He da8b9adc51 Update todos 2021-05-19 15:55:29 -04:00
Simeng He 16b8233459 Logging and testing what happened in disco 2021-05-19 13:53:04 -04:00
Simeng He be14720df4 More tests added and logging 2021-05-19 10:59:31 -04:00
Simeng He 7de0421f17 HTTP server added, fixing engine netmap problem 2021-05-18 09:45:04 -04:00
Simeng He 01be3630b9 Merge branch 'main' of github.com:tailscale/tailscale into simeng-pingtest 2021-05-17 11:17:35 -04:00
Simeng He d52cf5e99b Added Pinger interface, plumbed down to Direct, Trying some integration tests 2021-05-17 11:17:31 -04:00
Josh Bleecher Snyder 25df067dd0 all: adapt to opaque netaddr types
This commit is a mishmash of automated edits using gofmt:

gofmt -r 'netaddr.IPPort{IP: a, Port: b} -> netaddr.IPPortFrom(a, b)' -w .
gofmt -r 'netaddr.IPPrefix{IP: a, Port: b} -> netaddr.IPPrefixFrom(a, b)' -w .

gofmt -r 'a.IP.Is4 -> a.IP().Is4' -w .
gofmt -r 'a.IP.As16 -> a.IP().As16' -w .
gofmt -r 'a.IP.Is6 -> a.IP().Is6' -w .
gofmt -r 'a.IP.As4 -> a.IP().As4' -w .
gofmt -r 'a.IP.String -> a.IP().String' -w .

And regexps:

\w*(.*)\.Port = (.*)  ->  $1 = $1.WithPort($2)
\w*(.*)\.IP = (.*)  ->  $1 = $1.WithIP($2)

And lots of manual fixups.

Signed-off-by: Josh Bleecher Snyder <[email protected]>
2021-05-16 14:52:00 -07:00
Simeng He 65879efae4 Incredible 2021-05-14 12:31:02 -04:00
Simeng He 940e1c7690 Proper url style 2021-05-13 15:00:47 -04:00
Simeng He 49e733773c Put placeholder code for the customping 2021-05-13 13:48:52 -04:00
Simeng He c56829eff7 Direct tests 2021-05-13 13:05:28 -04:00
Simeng He 73bb80e42b Merge branch 'main' of github.com:tailscale/tailscale into simeng-pingtest 2021-05-13 09:45:19 -04:00
Avery Pennarun 6307a9285d controlclient: update Persist.LoginName when it changes.
Well, that was anticlimactic.

Fixes tailscale/corp#461.

Signed-off-by: Avery Pennarun <[email protected]>
2021-05-12 23:21:11 -04:00
Simeng He 2455f1035c More Templates temporarily commented out existing ping 2021-05-11 13:08:02 -04:00
Simeng He f894fad4f7 Small log additions for my own sake 2021-05-10 12:24:07 -04:00
Simeng He e1b16b6b52 Added brad's structs, trying some logging 2021-05-10 09:57:58 -04:00
Avery Pennarun b4d04a065f controlclient: extract a Client interface and rename Client->Auto.
This will let us create a mock or fake Client implementation for use
with ipn.Backend.

Signed-off-by: Avery Pennarun <[email protected]>
2021-04-30 00:09:35 -04:00
Brad Fitzpatrick 3411bb959a control/controlclient: fix signRegisterRequest log suppression check on Windows
Fixes #1774

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-22 11:59:19 -07:00
Brad Fitzpatrick 6f52fa02a3 control/controlclient, tailcfg: add Debug.SleepSeconds (mapver 19)
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-21 22:05:41 -07:00
Brad Fitzpatrick e9d24341e0 tailcfg, control/controlclient: accept nil MapResponse.Node (mapver 18)
All MapResponse fields can not be omitted and are tagged "omitempty".

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-19 11:53:21 -07:00
Brad Fitzpatrick 5092cffd1f control/controlclient: add start of some MapResponse->NetworkMap tests
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-18 20:27:51 -07:00
Brad Fitzpatrick aef3c0350c control/controlclient: break direct.go into map.go (+tests), add mapSession
So the NetworkMap-from-incremental-MapResponses can be tested easily.

And because direct.go was getting too big.

No change in behavior at this point. Just movement.

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-18 19:56:03 -07:00
Brad Fitzpatrick b993d9802a ipn/ipnlocal, etc: require file sharing capability to send/recv files
tailscale/corp#1582

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-16 10:58:19 -07:00
Brad Fitzpatrick 670838c45f tailcfg, control/controlclient: (mapver 16) add Node.Online, MapResponse.OnlineChange
And fix PeerSeenChange bug where it was ignored unless there were
other peer changes.

Updates tailscale/corp#1574

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-15 20:07:24 -07:00
David Anderson 7055f870f8 control/controlclient: only use a single DNS label as the hostname.
Fixes #971

Signed-off-by: David Anderson <[email protected]>
2021-04-15 17:08:58 -07:00
Brad Fitzpatrick 34d2f5a3d9 tailcfg: add Endpoint, EndpointType, MapRequest.EndpointType
Track endpoints internally with a new tailcfg.Endpoint type that
includes a typed netaddr.IPPort (instead of just a string) and
includes a type for how that endpoint was discovered (STUN, local,
etc).

Use []tailcfg.Endpoint instead of []string internally.

At the last second, send it to the control server as the existing
[]string for endpoints, but also include a new parallel
MapRequest.EndpointType []tailcfg.EndpointType, so the control server
can start filtering out less-important endpoint changes from
new-enough clients. Notably, STUN-discovered endpoints can be filtered
out from 1.6+ clients, as they can discover them amongst each other
via CallMeMaybe disco exchanges started over DERP. And STUN endpoints
change a lot, causing a lot of MapResposne updates. But portmapped
endpoints are worth keeping for now, as they they work right away
without requiring the firewall traversal extra RTT dance.

End result will be less control->client bandwidth. (despite negligible
increase in client->control bandwidth)

Updates tailscale/corp#1543

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-13 10:12:14 -07:00
Brad Fitzpatrick ccb322db04 tailcfg, control/controlclient: make nil MapResponse.DNSConfig mean unchanged (mapver15)
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-12 12:46:32 -07:00
Simon Kirillov a64b57e2fb control/controlclient: create tls client config with server hostname instead of serverURL.Host
Signed-off-by: Simon Kirillov <[email protected]>
2021-04-10 11:20:10 -07:00
Brad Fitzpatrick 3167e55ddf ipn/{ipnlocal,localapi}, cmd/tailscale: add logout command
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-09 13:26:35 -07:00
Brad Fitzpatrick 597c19ff4e control/controlclient: refactor some internals
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-04-07 21:20:17 -07:00
Brad Fitzpatrick 1bd14a072c cmd/tailscale, ipn/localapi: move IP forwarding check to tailscaled, API
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 <[email protected]>
2021-03-31 12:09:16 -07:00
Brad Fitzpatrick a998fe7c3d control/controlclient: support lazy machine key generation
It's not done in the caller yet, but the controlclient does it now.

Updates #1573

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-31 08:52:57 -07:00
Brad Fitzpatrick ddaacf0a57 control/controlclient: document a few things
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-31 08:26:05 -07:00
Brad Fitzpatrick 12ae2d73b3 control/controlclient: fix TS_DEBUG_MAP on requests
The concrete type being encoded changed from a value to pointer
earlier and this was never adjusted.

(People don't frequently use TS_DEBUG_MAP to see requests, so it went
unnoticed until now.)

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-29 12:51:19 -07:00
Adrian Dewhurst 04dd6d1dae control/controlclient: sign RegisterRequest (#1549)
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 <[email protected]>
2021-03-26 10:01:08 -04:00
Brad Fitzpatrick 0a02aaf813 control, ipn, tailcfg: remove golang.org/x/oauth2 dep, add tailcfg.Oauth2Token
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 <[email protected]>
2021-03-19 10:40:48 -07:00
Brad Fitzpatrick 232cfda280 wgengine/router: report to control when setPrivateNetwork fails
Fixes #1503

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-15 16:19:40 -07:00
Brad Fitzpatrick ba8c6d0775 health, controlclient, ipn, magicsock: tell health package state of things
Not yet checking anything. Just plumbing states into the health package.

Updates #1505

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-15 15:20:55 -07:00
David Anderson 1bc3c03562 control/controlclient: allow for an unset linkMon.
Signed-off-by: David Anderson <[email protected]>
2021-03-11 21:21:15 -08:00
David Anderson 0b66cfe1e0 control/controlclient: report broken IP forwarding more precisely.
IP forwarding is not required when advertising a machine's local IPs
over Tailscale.

Fixes #1435.

Signed-off-by: David Anderson <[email protected]>
2021-03-11 10:49:57 -08:00
Brad Fitzpatrick f45a9e291b tailcfg, control/controlclient: add MapResponse.PingRequest
So the control server can test whether a client's actually present.

Most clients are over HTTP/2, so these pings (to the same host) are
super cheap.

This mimics the earlier goroutine dump mechanism.

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-05 16:28:56 -08:00
Brad Fitzpatrick affd859121 ipn/ipnlocal, control/controlclient: propagate link monitor to controlclient
Don't use it yet, but get it down there.

Updates #1455

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-04 20:11:55 -08:00
Brad Fitzpatrick 92cdb30b26 tailcfg, control/controlclient: add goroutine dump debug feature
Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-03 10:56:01 -08:00
Brad Fitzpatrick 9df4185c94 control/controlclient, net/{dnscache,dnsfallback}: add DNS fallback mechanism
Updates #1405
Updates #1403

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-03-01 18:42:03 -08:00
Brad Fitzpatrick fd8e070d01 health, control/controlclient, wgengine: report when router unhealthy
Updates tailscale/corp#1338

Signed-off-by: Brad Fitzpatrick <[email protected]>
2021-02-18 11:48:48 -08:00