Brad Fitzpatrick
4cf5ac3060
ipn/ipnserver: remove unnecessary closure parameter
2020-03-03 19:38:01 -08:00
Brad Fitzpatrick
724c37fb41
wgengine/magicsock: start tracking nearest DERP node
2020-03-03 17:50:17 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
e371520cc5
tsweb, derp: add expvar http.Handler for Prometheus's format
...
And add some opinions.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-03 13:59:16 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
89a2c3eb04
wgengine: don't create duplicate iptables rules on Linux, clean up
...
Fixes #131
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-03 13:46:53 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
dd68debd64
cmd/derper: set autocert Email
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-03 13:30:50 -08:00
Brad Fitzpatrick
68ff31a0ba
ipn: have NewFileStore try to create directories as needed
2020-03-03 11:51:44 -08:00
Brad Fitzpatrick
b3d9eab1fe
safesocket: make some effort to create parent directory of sock
2020-03-03 11:47:21 -08:00
Brad Fitzpatrick
383d86df5f
paths: remove some debug logging I left in
2020-03-03 11:45:49 -08:00
Brad Fitzpatrick
65e7c58aa4
cmd/tailscale, cmd/tailscaled, paths: add paths package for default paths
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-03 09:36:18 -08:00
Brad Fitzpatrick
06092a3af3
ipn/ipnserver: document potential race, start on test for it
2020-03-03 09:15:11 -08:00
Brad Fitzpatrick
ef1f967ec0
ipn: remove an unnecessary named parameter in doc
2020-03-03 08:05:11 -08:00
Brad Fitzpatrick
844d991baf
netcheck: add Report.Clone, return cloned report to avoid races on late replies
2020-03-02 15:02:34 -08:00
Brad Fitzpatrick
657f9593ae
Reduce some logspam.
2020-03-02 14:55:12 -08:00
Brad Fitzpatrick
4675c70464
wgengine/magicsock: check STUN regularly
2020-03-02 12:37:52 -08:00
Brad Fitzpatrick
7172f3dbf4
version: add IsMobile func
...
And use it control/controlclient.
2020-03-02 12:37:28 -08:00
Brad Fitzpatrick
11489a6e67
go.sum: add lines
2020-03-02 11:07:42 -08:00
Brad Fitzpatrick
bc7bc43fb8
magicsock, interfaces: move some code from magicsock to interfaces
2020-03-02 10:38:44 -08:00
Brad Fitzpatrick
af7a01d6f0
wgengine/magicsock: drop donec channel, rename epUpdateCtx to serve its purpose
2020-03-02 09:31:25 -08:00
Brad Fitzpatrick
a399ef3dc7
cmd/derper: appease staticcheck
2020-03-02 08:59:50 -08:00
Brad Fitzpatrick
051b6ef141
cmd/derper: accept more LetsEncrypt hostnames without explicit config
2020-03-02 08:55:44 -08:00
Brad Fitzpatrick
bcf3719b9e
netcheck: add hairpinning detection
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 14:26:51 -08:00
Brad Fitzpatrick and David Crawshaw
1abf2da392
wgengine/magicsock: reset favorite address on handshakes
...
Updates #92 (not a complete fix; could be better/faster?)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 17:23:09 -05:00
Brad Fitzpatrick
517a91de75
derp/derphttp: fix reconnect behavior
...
I broke it in today's 752146a70f .
Added some comments to prevent recurrences.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 13:39:48 -08:00
Brad Fitzpatrick
38acccad09
derp: remove some debug noise I left in
...
:(
2020-02-28 13:20:56 -08:00
Brad Fitzpatrick
752146a70f
derp: clean up derphttp client code, use contexts
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 13:18:59 -08:00
Brad Fitzpatrick
67ede8d6d2
wgengine, magicsock: fix SetPrivateKey data race
...
Updates #112
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 11:15:07 -08:00
Brad Fitzpatrick
4cd3e82bbd
go.mod: bump wireguard-go
...
Updates #112
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 11:15:07 -08:00
Brad Fitzpatrick
a6c695ba6b
types/key: add IsZero methods
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 11:15:07 -08:00
Brad Fitzpatrick
07f0fd0fdc
version: add a manual date as version for now
...
Maybe we'll auto-bump this with a bot over time.
See golang/go#37475 & golang/go#29814
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 09:44:34 -08:00
Brad Fitzpatrick
f3c0ea23d9
netcheck, stunner: reduce log spam
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 09:40:25 -08:00
Brad Fitzpatrick
19b54d0ae7
wgengine: fix a data race on StatusCallback
...
Updates tailscale/tailscale#112
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-28 09:32:06 -08:00
Brad Fitzpatrick
25797c8c2a
all: rename deep "Copy" methods to conventional Go name "Clone"
2020-02-27 12:20:29 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
14559340ee
Start of netcheck package & including network state in Hostinfo.
...
* adds new packet "netcheck" to do the checking of UDP, IPv6, and
nearest DERP server, and the Report type for all that (and more
in the future, probably pulling in danderson's natprobe)
* new tailcfg.NetInfo type
* cmd/tailscale netcheck subcommand (tentative name, likely to
change/move) to print out the netcheck.Report.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-27 11:05:27 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
a07af762e4
types/opt: add opt package for a new opt.Bool JSON type
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-27 10:39:42 -08:00
Brad Fitzpatrick
c185e6b4b0
stunner: support IPv6, add latency info to callbacks, use unique TxIDs per retry
...
And some more docs.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-27 09:23:51 -08:00
Brad Fitzpatrick
00ad93ec25
cmd/derper: add a STUN server
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-26 19:11:14 -08:00
Brad Fitzpatrick
0e128f8f22
stun: add server support
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-26 15:19:32 -08:00
Brad Fitzpatrick
74650d6fb5
go.mod, go.sum: update
2020-02-26 15:19:10 -08:00
Brad Fitzpatrick
14abc82033
stun: check high bits in Is, add tests
...
Also use new stun.TxID type in stunner.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-26 11:34:01 -08:00
Brad Fitzpatrick
2489ea4268
stun: fix IPv6 bug, refactor a bit
...
Fixes #104
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-26 09:20:46 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
eefafad9f8
ipn: fix some mutex/ownership issues
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-25 14:07:43 -08:00
Brad Fitzpatrick
3988ddc85d
types/logger: add WithPrefix, use it in two places
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-25 11:35:46 -08:00
Brad Fitzpatrick
d8de11a01b
control: make Hostinfo accessed by pointer
...
Fix potential races in copying aliased slices by value.
Also few little doc updates.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-25 10:35:51 -08:00
Brad Fitzpatrick
824f825552
tsweb, cmd/derper: move common web/debug stuff from derper to new tsweb
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-25 10:06:56 -08:00
Brad Fitzpatrick
367ffde21a
ipn: misc cleanup
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-25 10:05:14 -08:00
Brad Fitzpatrick
04e6b77774
safesocket: delete incorrect build tag
...
Leftover from copying one file to another to create safesocket.go
in the earlier documentation change (29f7d64091 ).
2020-02-25 09:02:52 -08:00
Brad Fitzpatrick
29f7d64091
safesocket: document
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-25 08:46:34 -08:00
Brad Fitzpatrick
8696b17b5f
wgengine/magicsock: turn off DERP log spamminess by default
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-24 10:24:12 -08:00
Brad Fitzpatrick
f473965ca1
go.sum: update
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-24 08:48:06 -08:00
Brad Fitzpatrick
7a3b91390b
wgengine/magicsock: fix crash in Send when Endpoint isn't an AddrSet
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-24 08:47:20 -08:00
Brad Fitzpatrick
cc7b9b0dff
control/controlclient: fix priority of DERP server, add comment
2020-02-21 14:47:05 -08:00
Brad Fitzpatrick
3317531021
derp: fix JSON field typo, sort fields to make it easier to see inconsistencies
2020-02-21 14:18:09 -08:00
Brad Fitzpatrick
6cd81d5d1f
derp: add more derp stats for dropped and received packets
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-21 14:13:50 -08:00
Brad Fitzpatrick
c02f4b5a1f
control/controlclient: add temporary mechanism to force derp on
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-21 14:09:24 -08:00
Brad Fitzpatrick
525bf1f3d2
wgengine/magicsock: remember fixed port number preference
...
So LinkChange events rebind to the same port when possible.
2020-02-21 13:51:18 -08:00
Brad Fitzpatrick
c763901b1a
cmd/derper: provide debug access over port 80 to trusted (tailscale) IPs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-21 11:52:27 -08:00
Brad Fitzpatrick
2612e54ad1
derp, cmd/derper: add debug handlers, stats
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-21 09:35:53 -08:00
Brad Fitzpatrick
433b917977
interfaces, cmd/tsshd: move interface lookup from tsshd to its own package
...
For reuse by derper, etc.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-21 08:13:21 -08:00
Brad Fitzpatrick
37e115834e
cmd/derper: support logging to logtail
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-21 07:53:22 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
379a3125fd
derp, wgengine/magicsock: support more than just packets from Client.Recv
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 22:08:13 -08:00
Brad Fitzpatrick and Dave Anderson
88f1cc0c98
derp, cmd/derper: add rate limiting support, add default 5Mbps limit
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 15:26:30 -08:00
Brad Fitzpatrick
1166c34f6c
derp: fix staticcheck warning
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 14:49:47 -08:00
Brad Fitzpatrick
322cb58b14
derp: deflake test I flaked up in earlier change
...
I broke an invariant in 11048b8932 (it was even nicely
documented then).
Also clean up the test a bit from while I was debugging it.
Fixes #84
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 14:41:39 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
f029c4c82d
derp: change the protocol framing to always include a length
...
Addresses one of crawshaw's TODOs.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 13:37:44 -08:00
Brad Fitzpatrick
11048b8932
derp: add docs on current protocol overview, break accept apart a bit
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 09:57:05 -08:00
Brad Fitzpatrick
79af6054bf
derp: don't start sending keepalives to client until after serverInfo sent
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 09:34:01 -08:00
Brad Fitzpatrick
1155716318
derp: rename some things in the client, add some docs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 09:11:56 -08:00
Brad Fitzpatrick
4b461c2e77
derp: rename some things in the server, add some docs
2020-02-20 08:50:25 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
d298d5b1f8
wgengine/magicsock: support multiple derp servers, and not just for handshakes
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-20 08:10:12 -08:00
Brad Fitzpatrick
f266e2d1eb
version: add CmdName func for future use by logpolicy
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
Change-Id: I02a7c907844f71242ef06ed097f2a92ece7ae091
2020-02-19 11:34:45 -08:00
Brad Fitzpatrick
b72e6446e2
cmd/derper: add a basic DERP server
...
Mostly Crawshaw's earlier code, refactored a bit.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-18 11:25:11 -08:00
Brad Fitzpatrick
fd1aa4f7f6
wgengine/magicsock: add a reSTUN method
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-18 10:55:36 -08:00
Brad Fitzpatrick
619697063e
derp: more misc cleanups
...
And add an explicit derphttp.Client.Connect in the test now that it's
done lazily.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-18 10:09:37 -08:00
Brad Fitzpatrick
e06ca40650
wgengine, magicsock, derp: misc cleanups, docs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-18 08:58:00 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
259406e797
derp: move away from [32]byte key types
...
And some minor cleanup in the process.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-17 14:18:09 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
769e25e37b
derp: use new types/key package
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-17 13:29:49 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
997678f540
wgengine/monitor: make Close not block forever on Linux
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-17 11:39:33 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
7f5e3febe5
wgengine: move link monitor to be owned by the engine, not the router
...
And make the monitor package portable with no-op implementations on
unsupported operating systems.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-17 09:53:17 -08:00
Brad Fitzpatrick
80d5d4bdfe
ipn: fix test breakage from earlier 79295b1138
...
This test is skipped in tailscale/tailscale because it depends on
parts that haven't been released yet and was thus overlooked in the
git commit 79295b1138 cleanup.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-17 08:19:50 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
79295b1138
wgengine: simplify, change some signatures
...
* make RouterGen return an error, not take both tunname and tundev
* also remove RouteGen taking a wireguard/device.Device; currently unused
* remove derp parameter (it'll work differently)
* unexport NewUserspaceRouter in per-OS impls, add documented wrapper
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-17 08:04:31 -08:00
Brad Fitzpatrick
9dbc52bb5b
go.mod: fix wireguard-go dep
...
Fixes #59
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-15 18:50:05 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
2896be60db
Move "logger" package to under types, now that we have it.
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-14 20:23:05 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
c393f0bfae
Dockerfile: optimize incremental build a bit, copy all binaries to output
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-14 13:39:59 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
747c7d7ce2
types/empty: add Message, stop using mysterious *struct{}
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-14 13:35:49 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
587c3fcac4
control/controlclient, wgengine/magicsock: misc cleanups
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-14 09:50:08 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
fbfe474492
logpolicy: add some docs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-14 07:51:51 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
b5346fe7b4
meta: move cross-compiled builds to their own parallel jobs
...
And add FreeBSD.
Fixes #37
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-13 11:28:07 -08:00
Brad Fitzpatrick
c773abde77
wgengine: fix nil pointer deref crash from earlier change
...
Fixes #45
2020-02-13 08:59:31 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
745c8c92b1
wgengine: fix windows build for winipcfg-go
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-12 22:05:13 -08:00
Brad Fitzpatrick
13dc12814e
cmd/tsshd: fix log text
2020-02-12 14:51:47 -08:00
Brad Fitzpatrick
d404f1caed
cmd/tsshd: add basic SSH server
2020-02-12 14:46:59 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
7e5e32775a
wgengine: flesh out some docs, minor cleanups
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-12 13:37:45 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
819daf10e2
wgengine: flesh out some docs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-12 13:37:45 -08:00
Brad Fitzpatrick
a59dc5f155
Use logger.Logf consistently. It was used in most places.
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-02-11 09:38:32 -08:00
Brad Fitzpatrick
fef2548981
README: https, links, mention Go version, DCO
2020-02-10 14:01:37 -08:00
Brad Fitzpatrick
516a15ee58
cmd: add import comments
...
See https://golang.org/cmd/go/#hdr-Import_path_checking
2020-02-10 13:32:37 -08:00
Brad Fitzpatrick
1f1dc3ad14
version: fix path for git describe of version for redo
2020-02-10 09:19:57 -08:00
Brad Fitzpatrick
a1fbf25f77
version: add stub; use rsc.io/goversion/version later
2020-02-10 09:00:30 -08:00