summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2023-10-30tool: download helm CLIirbekrm/chartandcliIrbe Krumina5-18/+97
Updates tailscale/tailscale#9222 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-26cmd/k8s-operator: allow to install operator via helmIrbe Krumina13-2/+311
Initial helm manifests. Updates tailscale/tailscale#9222 Signed-off-by: Irbe Krumina <irbe@tailscale.com> Co-authored-by: Maisem Ali <maisem@tailscale.com> Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-22go.toolchain.rev: bump Tailscale Go toolchainBrad Fitzpatrick1-1/+1
Updates tailscale/go#77 Change-Id: I367465fb90cd4369cfbafd913c3964bfe5553dd0 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-10-20ipn/ipnlocal: prevent changing serve config if conf.Lockedc761d10Maisem Ali2-4/+13
This adds a check to prevent changes to ServeConfig if tailscaled is run with a Locked config. Missed in 1fc3573446a9bb2411bb6b68864368fd1e465b7e. Updates #1412 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-20cmd/tailscale/cli: update serve/funnel CLI help text (#9895)Tyler Smalley1-14/+21
updates #8489 ENG-2308 Signed-off-by: Tyler Smalley <tyler@tailscale.com>
2023-10-20control/controlclient: support certstore without cgoAdrian Dewhurst5-12/+9
We no longer build Windows releases with cgo enabled, which automatically turned off certstore support. Rather than re-enabling cgo, we updated our fork of the certstore package to no longer require cgo. This updates the package, cleans up how the feature is configured, and removes the cgo build tag requirement. Fixes tailscale/corp#14797 Fixes tailscale/coral#118 Change-Id: Iaea34340761c0431d759370532c16a48c0913374 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2023-10-20ipn/localapi,client/web: clean up auth error handlingSonia Appasamy2-16/+12
This commit makes two changes to the web client auth flow error handling: 1. Properly passes back the error code from the noise request from the localapi. Previously we were using io.Copy, which was always setting a 200 response status code. 2. Clean up web client browser sessions on any /wait endpoint error. This avoids the user getting in a stuck state if something goes wrong with their auth path. Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-10-20clientupdate: change Mac App Store support (#9891)Andrew Lytvynov4-154/+35
In the sandboxed app from the app store, we cannot check `/Library/Preferences/com.apple.commerce.plist` or run `softwareupdate`. We can at most print a helpful message and open the app store page. Also, reenable macsys update function to mark it as supporting c2n updates. macsys support in `tailscale update` was fixed. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-20ipn/ipnlocal: close connections for removed proxy transports (#9884)Irbe Krumina3-55/+170
Ensure that when a userspace proxy config is reloaded, connections for any removed proxies are safely closed Updates tailscale/tailscale#9725 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-19client/web: use auth ID in browser sessionsSonia Appasamy2-68/+134
Stores ID from tailcfg.WebClientAuthResponse in browser session data, and uses ID to hit control server /wait endpoint. No longer need the control url cached, so removed that from Server. Also added optional timeNow field, initially to manage time from tests. Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-10-19taildrop: fix theoretical race condition in fileDeleter.Init (#9876)Joe Tsai5-29/+40
It is possible that upon a cold-start, we enqueue a partial file for deletion that is resumed shortly after startup. If the file transfer happens to last longer than deleteDelay, we will delete the partial file, which is unfortunate. The client spent a long time uploading a file, only for it to be accidentally deleted. It's a very rare race, but also a frustrating one if it happens to manifest. Fix the code to only delete partial files that do not have an active puts against it. We also fix a minor bug in ResumeReader where we read b[:blockSize] instead of b[:cs.Size]. The former is the fixed size of 64KiB, while the latter is usually 64KiB, but may be less for the last block. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-19ipn/ipnlocal: send ClientVersion to Apple frontends (#9887)Andrew Lytvynov1-10/+1
Apple frontends will now understand this Notify field and handle it. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-19tailcfg: add ID field to WebClientAuthResponseSonia Appasamy1-5/+7
Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-10-19appctype: move to types/appctypeTom DNetto4-2/+2
Having a types package at the top level was almost certainly unintentional. Signed-off-by: Tom DNetto <tom@tailscale.com> Updates: https://github.com/tailscale/corp/issues/15038
2023-10-19appc: implement app connector Server typeTom DNetto4-0/+686
This change refactors & moves the bulk of the app connector logic from ./cmd/sniproxy. A future change will delete the delta in sniproxy and wire it to this type. Signed-off-by: Tom DNetto <tom@tailscale.com> Updates: https://github.com/tailscale/corp/issues/15038
2023-10-19cmd/tailscale: improve taildrop progress printer on Linux (#9878)Joe Tsai2-45/+73
The progress printer was buggy where it would not print correctly and some of the truncation logic was faulty. The progress printer now prints something like: go1.21.3.linux-amd64.tar.gz 21.53MiB 13.83MiB/s 33.88% ETA 00:00:03 where it shows * the number of bytes transferred so far * the rate of bytes transferred (using a 1-second half-life for an exponentially weighted average) * the progress made as a percentage * the estimated time (as calculated from the rate of bytes transferred) Other changes: * It now correctly prints the progress for very small files * It prints at a faster rate (4Hz instead of 1Hz) * It uses IEC units for byte quantities (to avoid ambiguities of "kb" being kilobits or kilobytes) Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-19cmd/tailscale/cli: [serve/funnel] support omitting scheme for TCP (#9856)Tyler Smalley2-49/+57
The `serve` command for TCP has always required the scheme of the target to be specified. However, when it's omitted the error message reported is misleading ``` error: failed to apply TCP serve: invalid TCP target "localhost:5900": missing port in address ``` Since we know the target is TCP, we shouldn't require it to be specified. This aligns with the changes for HTTP proxies in https://github.com/tailscale/tailscale/issues/8489 closes #9855 Signed-off-by: Tyler Smalley <tyler@tailscale.com>
2023-10-19cmd/tailscale/cli: [serve/funnel] provide correct command for disabling (#9859)Tyler Smalley2-7/+121
The `off` subcommand removes a serve/funnel for the corresponding type and port. Previously, we were not providing this which would result in an error if someone was using something than the default https=443. closes #9858 Signed-off-by: Tyler Smalley <tyler@tailscale.com>
2023-10-19ipn/ipnlocal: initiate proxy transport once (#9883)Irbe Krumina2-11/+34
Initiates http/h2c transport for userspace proxy backend lazily and at most once. Updates tailscale/tailscale#9725 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-19client/web: hook up auth flowSonia Appasamy5-65/+459
Connects serveTailscaleAuth to the localapi webclient endpoint and pipes auth URLs and session cookies back to the browser to redirect users from the frontend. All behind debug flags for now. Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-10-19ipn/ipnlocal: proxy gRPC requests over h2c if needed. (#9847)Irbe Krumina2-13/+114
Updates userspace proxy to detect plaintext grpc requests using the preconfigured host prefix and request's content type header and ensure that these will be proxied over h2c. Updates tailscale/tailscale#9725 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-18wgengine/magicsock: simplify tryEnableUDPOffload() (#9872)Jordan Whited1-5/+1
Don't assume Linux lacks UDP_GRO support if it lacks UDP_SEGMENT support. This mirrors a similar change in wireguard/wireguard-go@177caa7 for consistency sake. We haven't found any issues here, just being overly paranoid. Updates #cleanup Signed-off-by: Jordan Whited <jordan@tailscale.com>
2023-10-18taildrop: fix TestResume (#9874)Joe Tsai1-6/+13
Previously, the test simply relied on: defer close() to cleanup file handles. This works fine on Unix-based systems, but not on Windows, which dislikes deleting files where an open file handle continues to exist. Fix the test by explicitly closing the file handle after we are done with the resource. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-18cmd/tsconnect/wasm: add missing tstun.Wrapper.Start callBrad Fitzpatrick1-0/+1
It's required as of the recent 5297bd2cff8e. Updates #7894 Updates #9394 (sure would be nice) Change-Id: Id6672408dd8a6c82dba71022c8763e589d789fcd Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-10-18taildrop: disable TestResume (#9873)Joe Tsai1-0/+1
This test is currently failing on Windows. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-18syncs: add Map.LoadFunc (#9869)Joe Tsai2-3/+30
The LoadFunc loads a value and calls a user-provided function. The utility of this method is to ensure that the map lock is held while executing user-provided logic. This allows us to solve TOCTOU bugs that would be nearly imposible to the solve without this API. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-18.github/workflows: update golangci-lintJames Tucker1-2/+2
Updates #cleanup Signed-off-by: James Tucker <james@tailscale.com>
2023-10-18client/web: add tests for authorizeRequestSonia Appasamy2-35/+138
Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-10-18util/linuxfw: add additional nftable detection logicMaisem Ali3-20/+119
We were previously using the netlink API to see if there are chains/rules that already exist. This works fine in environments where there is either full nftable support or no support at all. However, we have identified certain environments which have partial nftable support and the only feasible way of detecting such an environment is to try to create some of the chains that we need. This adds a check to create a dummy postrouting chain which is immediately deleted. The goal of the check is to ensure we are able to use nftables and that it won't error out later. This check is only done in the path where we detected that the system has no preexisting nftable rules. Updates #5621 Updates #8555 Updates #8762 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-18util/linuxfw: fix broken testsMaisem Ali1-178/+68
These tests were broken at HEAD. CI currently does not run these as root, will figure out how to do that in a followup. Updates #5621 Updates #8555 Updates #8762 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-18taildrop: fix theoretical race condition (#9866)Joe Tsai1-2/+2
WaitGroup.Wait should not be concurrently called WaitGroup.Add. In other words, we should not start new goroutines after shutodwn is called. Thus, add a conditional to check that shutdown has not been called before starting off a new waitAndDelete goroutine. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-18licenses: update win/apple licensesLicense Updater2-11/+13
Signed-off-by: License Updater <noreply+license-updater@tailscale.com>
2023-10-17taildrop: switch hashing to be streaming based (#9861)Joe Tsai4-142/+119
While the previous logic was correct, it did not perform well. Resuming is a dance between the client and server, where 1. the client requests hashes for a partial file, 2. the server then computes those hashes, 3. the client computes hashes locally and compares them. 4. goto 1 while the partial file still has data While step 2 is running, the client is sitting idle. While step 3 is running, the server is sitting idle. By streaming over the block hash immediately after the server computes it, the client can start checking the hash, while the server works on the next hash (in a pipelined manner). This performs dramatically better and also uses less memory as we don't need to hold a list of hashes, but only need to handle one hash at a time. There are two detriments to this approach: * The HTTP API relies on a JSON stream, which is not a standard REST-like pattern. However, since we implement both client and server, this is fine. * While the stream is on-going, we hold an open file handle on the server side while the file is being hashed. On really slow streams, this could hold a file open forever. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net> Co-authored-by: Rhea Ghosh <rhea@tailscale.com>
2023-10-17ipn: fix localapi and peerapi protocol for taildrop resume (#9860)Joe Tsai2-10/+15
Minor fixes: * The branch for listing or hashing partial files was inverted. * The host for peerapi call needs to be real (rather than bogus). * Handle remote peers that don't support resuming. * Make resume failures non-fatal (since we can still continue). This was tested locally, end-to-end system test is future work. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net> Co-authored-by: Rhea Ghosh <rhea@tailscale.com>
2023-10-17clientupdate: fix background install for linux tarballs (#9852)Andrew Lytvynov2-2/+5
Two bug fixes: 1. when tailscale update is executed as root, `os.UserCacheDir` may return an error because `$XDG_CACHE_HOME` and `$HOME` are not set; fallback to `os.TempDir` in those cases 2. on some weird distros (like my EndeavourOS), `/usr/sbin` is just a symlink to `/usr/bin`; when we resolve `tailscale` binary path from `tailscaled`, allow `tailscaled` to be in either directory Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-17client/web: refactor authorizeRequestSonia Appasamy1-36/+48
Moves request authorization back into Server.serve to be run at the start of any request. Fixes Synology unstable track bug where client would get stuck unable to auth due to not rendering the Synology redirect auth html on index.html load. Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-10-17taildrop: implement asynchronous file deletion (#9844)Joe Tsai10-363/+557
File resumption requires keeping partial files around for some time, but we must still eventually delete them if never resumed. Thus, we implement asynchronous file deletion, which could spawn a background goroutine to delete the files. We also use the same mechanism for deleting files on Windows, where a file can't be deleted if there is still an open file handle. We can enqueue those with the asynchronous file deleter as well. Updates tailscale/corp#14772 Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-17tailcfg,cmd/tailscale: add UrgentSecurityUpdate flag to ClientVersion (#9848)Andrew Lytvynov3-5/+17
This flag is used in clients to surface urgent updates more prominently. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-17cmd/k8s-operator: users can configure firewall mode for kube operator ↵Irbe Krumina5-98/+204
proxies (#9769) * cmd/k8s-operator: users can configure operator to set firewall mode for proxies Users can now pass PROXY_FIREWALL_MODE={nftables,auto,iptables} to operator to make it create ingress/egress proxies with that firewall mode Also makes sure that if an invalid firewall mode gets configured, the operator will not start provisioning proxy resources, but will instead log an error and write an error event to the related Service. Updates tailscale/tailscale#9310 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2023-10-17cmd/tailscale: promote new serve/funnel CLI to be default (#9833)Tyler Smalley5-22/+14
The change is being kept to a minimum to make a revert easy if necessary. After the release, we will go back for a final cleanup. updates #8489 Signed-off-by: Tyler Smalley <tyler@tailscale.com>
2023-10-17cmd/k8s-operator: use our own container image instead of busyboxMaisem Ali4-4/+10
We already have sysctl in the `tailscale/tailscale` image, just use that. Updates #cleanup Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-17ipn/{conffile,ipnlocal}: start booting tailscaled from a config file w/ auth keyBrad Fitzpatrick7-10/+126
Updates #1412 Change-Id: Icd880035a31df59797b8379f4af19da5c4c453e2 Co-authored-by: Maisem Ali <maisem@tailscale.com> Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-10-16tstest/tstest: add t.Parallel that can be disabled by TS_SERIAL_TESTS=trueBrad Fitzpatrick2-17/+27
Updates #9841 Change-Id: I1b8f4d6e34ac8540e3b0455a7c79bd400e2721b7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-10-16tstest, tstest/integration, github/workflows: shard integration testsBrad Fitzpatrick4-0/+58
Over four jobs for now. Updates #cleanup Change-Id: Ic2b1a739a454916893945a3f9efc480d6fcbd70b Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-10-16cmd/testwrapper: parse args betterMaisem Ali4-55/+250
Previously we were just smushing together args and not trying to parse the values at all. This resulted in the args to testwrapper being limited and confusing. This makes it so that testwrapper parses flags in the exact format as `go test` command and passes them down in the provided order. It uses tesing.Init to register flags that `go test` understands, however those are not the only flags understood by `go test` (such as `-exec`) so we register these separately. Updates tailscale/corp#14975 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-16ipn/ipnlocal/peerapi: refactoring taildrop to just one endpoint (#9832)Rhea Ghosh3-97/+68
Updates #14772 Signed-off-by: Rhea Ghosh <rhea@tailscale.com>
2023-10-16cmd/containerboot: revert to using tailscale upMaisem Ali2-130/+60
This partially reverts commits a61a9ab087e16270bc039252e7620aae4de3d56e and 7538f386710b80c6b4c1997797be28a661210d4a and fully reverts 4823a7e591ef859250114ad20b337d4358af9ead. The goal of that commit was to reapply known config whenever the container restarts. However, that already happens when TS_AUTH_ONCE was false (the default back then). So we only had to selectively reapply the config if TS_AUTH_ONCE is true, this does exactly that. This is a little sad that we have to revert to `tailscale up`, but it fixes the backwards incompatibility problem. Updates tailscale/tailscale#9539 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-10-16ipn/ipnlocal: fix AllowsUpdate disable after enable (#9827)Andrew Lytvynov1-1/+1
The old code would always retain value `true` if it was set once, even if you then change `prefs.AutoUpdate.Apply` to `false`. Instead of using the previous value, use the default (envknob) value to OR with. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-16cmd/tailscaled,*: add start of configuration file supportBrad Fitzpatrick16-1/+323
Updates #1412 Co-authored-by: Maisem Ali <maisem@tailscale.com> Change-Id: I38d559c1784d09fc804f521986c9b4b548718f7d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-10-16ipn/{ipnlocal/peerapi, localapi} initial taildrop resume api plumbing (#9798)Rhea Ghosh4-24/+130
This change: * adds a partial files peerAPI endpoint to get a list of partial files * adds a helper function to extract the basename of a file * updates the peer put peerAPI endpoint * updates the file put localapi endpoint to allow resume functionality Updates #14772 Signed-off-by: Rhea Ghosh <rhea@tailscale.com>