summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2022-07-25logtail: perform zstd compression with single-segment modedsnet/logtail-zstd-single-segmentJoe Tsai4-36/+39
The "single-segment" mode encodes the expected uncompressed size in the zstd frame, which the server can use as an optimization. Also, add a new Config.CompressTransport flag. Compression is an implementation detail of log uploading. It could be zstd today or a different format in the future. Most users of logtail should not care what compression is used. Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2022-06-07logtail: do not panic in PrivateID.PublicID (#4815)Joe Tsai1-4/+0
It is not idiomatic for Go code to panic for situations that can be normal. For example, if a server receives PrivateID from a client, it is normal for the server to call PrivateID.PublicID to validate that the PublicID matches. However, doing so would panic prior to this change. Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2022-06-07ipn/ipnstate: add ExitNodeStatus to share the exit node if it is in use, the ↵Melanie Warrick3-0/+40
IP, ID and whether its online. (#4761) - Updates #4619 Signed-off-by: nyghtowl <warrick@tailscale.com>
2022-06-07wasm: add test for disallowed JS/WASM dependenciesMihai Parparita2-0/+78
Ensures that binary size gains like the ones from #4802 and #4813 don't regress. Updates #3517 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-06-07wasm: drop pprof dependencyMihai Parparita4-0/+32
We can use the browser tools to profile, pprof adds 200K to the binary size. Updates #3157 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-06-07tailcfg: add TailscaleSSHEnabled helper check (#4812)Ross Zurowski2-0/+35
This commit adds a helper to check if Tailscale SSH is enabled. We're currently checking the SSH_HostKeys field in a few places, but later plan to add an explicit bool. This helper makes the check and any future changes easier. Signed-off-by: Ross Zurowski <ross@rosszurowski.com>
2022-06-07tsnet: use proper log IDWill Norris2-35/+95
refactor logpolicy config loading to make it easier to reuse from outside the package. Within tsnet, setup a basic logtail config. Signed-off-by: Will Norris <will@tailscale.com>
2022-06-07net/wsconn: remove homegrown wrapper for turning a websocket.Conn into a ↵Mihai Parparita7-115/+7
net.Conn The one from the nhooyr/websocket package seems to work equally well. Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-06-06VERSION.txt: this is v1.27.0Denton Gentry1-1/+1
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2022-06-06go.toolchain.rev: bump Go to 1.18.3 (+ Tailscale patches)Brad Fitzpatrick1-1/+1
See https://github.com/tailscale/go/commits/04d67b90d8cfd6f822664220f79e0e69cacb6b5c Diff: https://github.com/tailscale/go/compare/bb6009ec7cd24dbcf2a32034893c9cfbc1f8c36b..04d67b90d8cfd6f822664220f79e0e69cacb6b5c Change-Id: Ic0abd3058f3696c3f8007e1004ab4bf377c5323c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-06wasm: exclude code that's not used on iOS for Wasm tooMihai Parparita11-20/+24
It has similar size constraints. Saves ~1.9MB from the Wasm build. Updates #3157 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-06-06cmd/controlclient: wire up PingRequest peerapi pings tooBrad Fitzpatrick2-12/+16
Updates tailscale/corp#754 Change-Id: I61ac3fc44783b54bd02455bcb0baf19159b7a9d2 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-07build_docker.sh: add run.sh as an entrypoint to the docker imageMaisem Ali11-87/+75
Fixes #4071 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-06-07go.mod: pin github.com/tailscale/mkctr (try #2)Maisem Ali3-3/+42
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-06-06cmd/tailscale/cli: disable 'tailscale ssh' on sandboxed macOSBrad Fitzpatrick1-0/+4
Updates #3802 Updates #4518 Fixes #4628 Change-Id: I194d2cc30fc8e38b66d4910787efbce14317b0ff Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-05tsweb: fix Port80Handler redirect to https with FQDN unsetBrad Fitzpatrick2-1/+43
Fixes the current http://pkgs.tailscale.com/ redirect to https:/// as that server doesn't configure the Port80Handler.FQDN field. Change-Id: Iff56e6127a46c306ca97738d91b217bcab32a582 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-05hostinfo,distro: Identify Western Digital MyCloud devices.Denton Gentry2-10/+19
root@WDMyCloud HD_a2 # ./tailscale debug hostinfo { "IPNVersion": "1.25.0-dev20220605-t7fea52e02", "OS": "linux", "OSVersion": "5.22.113", "Desktop": false, "DeviceModel": "WD My Cloud Gen2: Marvell Armada 375", "Hostname": "WDMyCloud", "GoArch": "arm" } Updates https://github.com/tailscale/tailscale/issues/4622 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2022-06-04logpolicy: put Synology logs buffer in /tmpDenton Gentry1-2/+19
Ongoing log writing keeps the spinning disks from hibernating. Fixes https://github.com/tailscale/tailscale/issues/3551 Tested on DSM6 and DSM7. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2022-06-03ipn/ipnlocal: prevent attempting to run SSH on Synology for nowBrad Fitzpatrick1-1/+4
On DSM7 as a non-root user it'll run into problems. And we haven't tested on DSM6, even though it might work, but I doubt it. Updates #3802 Updates tailscale/corp#5468 Change-Id: I75729042e4788f03f9eb82057482a44b319f04f3 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-03Revert "cmd/tailscale/cli: disallow --ssh on Synology"Brad Fitzpatrick1-4/+1
This reverts commit 03e3e6abcd39239eca710144e329d5e8ef935a2d in favor of #4785. Change-Id: Ied65914106917c4cb8d15d6ad5e093a6299d1d48 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-04cmd/tailscale/cli: disallow --ssh on SynologyMaisem Ali1-1/+4
Updates tailscale/corp#5468 Updates #3802 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-06-03ipn/ipnserver, cmd/tailscaled: fix peerapi on WindowsBrad Fitzpatrick4-32/+40
We weren't wiring up netstack.Impl to the LocalBackend in some cases on Windows. This fixes Windows 7 when run as a service. Updates #4750 (fixes after pull in to corp repo) Change-Id: I9ce51b797710f2bedfa90545776b7628c7528e99 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-03cmd/tailscale: surface authentication errors in status.Health (#4748)Jordan Whited5-10/+41
Fixes #3713 Signed-off-by: Jordan Whited <jordan@tailscale.com>
2022-06-03words: The lists continue to drag-on. (#4780)Charlotte Brandhorst-Satzkorn2-1/+9
For Zaku and Pretzel. Signed-off-by: Charlotte Brandhorst-Satzkorn <charlotte@tailscale.com>
2022-06-02control/controlhttp: allow client and server to communicate over WebSocketsMihai Parparita10-30/+132
We can't do Noise-over-HTTP in Wasm/JS (because we don't have bidirectional communication), but we should be able to do it over WebSockets. Reuses derp WebSocket support that allows us to turn a WebSocket connection into a net.Conn. Updates #3157 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-06-02net/dns/resolver: add support for <IPv4>.via-<site-id>Maisem Ali2-16/+34
Currently we only support "via-<site-id>.<IPv4>", however that does not work with Google Chrome which parses `http://via-1.10.0.0.1` as a search string and not as a URL. This commit introduces "<IPv4>.via-<site-id>" (`http://10.0.0.1.via-1`) which is parsed correctly by Chrome. Updates #3616 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-06-02wgengine/netstack: replace a 1500 with a const + docBrad Fitzpatrick1-1/+6
Per post-submit code review feedback of 1336fb740b7f from @maisem. Change-Id: Ic5c16306cbdee1029518448642304981f77ea1fd Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-02ssh/tailssh: add metricsBrad Fitzpatrick1-2/+44
Updates #3802 Change-Id: Ic9a4b8c51cff6dfe148a1c78bc0e5074195b7f80 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-02cmd/tailscale/cli: add lose-ssh riskMaisem Ali5-2/+185
This makes it so that the user is notified that the action they are about to take may result in them getting disconnected from the machine. It then waits for 5s for the user to maybe Ctrl+C out of it. It also introduces a `--accept-risk=lose-ssh` flag for automation, which allows the caller to pre-acknowledge the risk. The two actions that cause this are: - updating `--ssh` from `true` to `false` - running `tailscale down` Updates #3802 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-06-01wgengine/netstack: make netstack MTU be 1280 alsoBrad Fitzpatrick3-11/+19
Updates #3878 Change-Id: I1850085b32c8a40d85607b4ad433622c97d96a8d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-06-01build_docker.sh: pin github.com/tailscale/mkctrMaisem Ali4-19/+25
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-06-01hostinfo: use ByteSliceToString from golang.org/x/sys/unixTobias Klauser2-12/+3
Use unix.ByteSliceToString in osVersionFreebsd and osVersionLinux to convert the Utsname.Release []byte field to string. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2022-06-01hostinfo: use Uname from golang.org/x/sys/unix in osVersionLinuxTobias Klauser1-3/+2
As already done in osVersionFreebsd. This will allow to use the Utsname fields as []byte for easier conversion to string. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2022-05-30ipn/ipnlocal: shutdown sshServer on tailscale downMaisem Ali3-18/+38
Also lazify SSHServer initialization to allow restarting the server on a subsequent `tailscale up` Updates #3802 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-05-28cmd/tailscale, ipn/ipnlocal: add "peerapi" ping typeBrad Fitzpatrick5-0/+86
For debugging when stuff like #4750 isn't working. RELNOTE=tailscale ping -peerapi Change-Id: I9c52c90fb046e3ab7d2b121387073319fbf27b99 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-05-28ssh/tailssh: terminate sessions on stdout copy failuresMaisem Ali1-5/+6
Currently, killing a SCP copy with a Ctrl+C leaves the session hanging even though the stdout copy goroutine fails with an io.EOF. Taking a step back, when we are unable to send any more data back to the client we should just terminate the session as the client will stop getting any response from the server anyways. Updates #3802 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-05-28ssh/tailssh: terminate sessions when tailscaled shutsdownMaisem Ali2-8/+51
Ideally we would re-establish these sessions when tailscaled comes back up, however we do not do that yet so this is better than leaking the sessions. Updates #3802 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-05-28ssh/tailssh: only use `login` with TTY sessionsMaisem Ali1-2/+4
Otherwise, the shell exits immediately causing applications like mosh and VSCode to fail. Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-05-27logtail: use http.NewRequestWithContextBrad Fitzpatrick1-6/+5
Saves some allocs. Not hot, but because we can now. And a const instead of a var. Change-Id: Ieb2b64534ed38051c36b2c0aa2e82739d9d0e015 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-05-27wgengine/router: delete hardcoded link-local address on Windows (#4740)Tom2-3/+17
Fixes #4647 It seems that Windows creates a link-local address for the TUN driver, seemingly based on the (fixed) adapter GUID. This results in a fixed MAC address, which for some reason doesn't handle loopback correctly. Given the derived link-local address is preferred for lookups (thanks LLMNR), traffic which addresses the current node by hostname uses this broken address and never works. To address this, we remove the broken link-local address from the wintun adapter. Signed-off-by: Tom DNetto <tom@tailscale.com>
2022-05-27net/dns, paths, util/winutil: change net/dns/windowsManager NRPT management ↵Aaron Klotz6-131/+466
to support more than 50 domains. AFAICT this isn't documented on MSDN, but based on the issue referenced below, NRPT rules are not working when a rule specifies > 50 domains. This patch modifies our NRPT rule generator to split the list of domains into chunks as necessary, and write a separate rule for each chunk. For compatibility reasons, we continue to use the hard-coded rule ID, but as additional rules are required, we generate new GUIDs. Those GUIDs are stored under the Tailscale registry path so that we know which rules are ours. I made some changes to winutils to add additional helper functions in support of both the code and its test: I added additional registry accessors, and also moved some token accessors from paths to util/winutil. Fixes https://github.com/tailscale/coral/issues/63 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2022-05-27ipn/localapi: implement LoginInteractive via localapiJoel Cressy1-0/+16
Updates: #4738 Signed-off-by: Joel Cressy <joel@jtcressy.net>
2022-05-27scripts/installer: fix elementaryOSDenton Gentry1-2/+17
c2b907c965d18eeacff3d7796f486b45f7fb662b moved UBUNTU_VERSION out of the ubuntu case and into linuxmint, but linuxmint wasn't the only Ubuntu-based system which needed it. Restore UBUNTU_VERSION handling in the ubuntu case. Break elementaryOS out into its own handling so we can get the version number handling correct for keyring support. Tested on an elementaryOS 6.1 VM. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2022-05-26cmd/tailscaled: fix state path for windows svcJames Tucker2-7/+10
Signed-off-by: James Tucker <james@tailscale.com>
2022-05-26util/winutil, util/winutil/vss: remove winrestore and vss as they are ↵Aaron Klotz4-571/+0
unnecessary. I wrote this code way back at the beginning of my tenure at Tailscale when we had concerns about needing to restore deleted machine keys from backups. We never ended up using this functionality, and the code is now getting in the way, so we might as well remove it. Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2022-05-20wgengine/netstack: handle multiple magicDNS queries per UDP socket (#4708)Tom1-11/+26
Fixes: #4686 Signed-off-by: Tom DNetto <tom@tailscale.com>
2022-05-20control/controlclient: avoid Noise protocol for js/wasm for nowBrad Fitzpatrick1-0/+6
Updates #3157 Change-Id: I04accc09783a68257d28cadde5818bf0724a8013 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-05-20install.sh: add RHEL9.Denton Gentry1-1/+2
Fixes https://github.com/tailscale/tailscale/issues/4718 Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2022-05-20.github/workflows: fix duplicated build target in Wasm actionMihai Parparita1-1/+1
Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-05-19.github/workflows: add cross-builder for WasmMihai Parparita1-0/+47
For now just checks that we can build cmd/tailscale/cli, will be broadened once we can actually build more things. Updates #3157 Signed-off-by: Mihai Parparita <mihai@tailscale.com>