summaryrefslogtreecommitdiffhomepage
path: root/clientupdate/clientupdate.go
AgeCommit message (Collapse)AuthorFilesLines
2026-01-23all: remove AUTHORS file and references to itWill Norris1-1/+1
This file was never truly necessary and has never actually been used in the history of Tailscale's open source releases. A Brief History of AUTHORS files --- The AUTHORS file was a pattern developed at Google, originally for Chromium, then adopted by Go and a bunch of other projects. The problem was that Chromium originally had a copyright line only recognizing Google as the copyright holder. Because Google (and most open source projects) do not require copyright assignemnt for contributions, each contributor maintains their copyright. Some large corporate contributors then tried to add their own name to the copyright line in the LICENSE file or in file headers. This quickly becomes unwieldy, and puts a tremendous burden on anyone building on top of Chromium, since the license requires that they keep all copyright lines intact. The compromise was to create an AUTHORS file that would list all of the copyright holders. The LICENSE file and source file headers would then include that list by reference, listing the copyright holder as "The Chromium Authors". This also become cumbersome to simply keep the file up to date with a high rate of new contributors. Plus it's not always obvious who the copyright holder is. Sometimes it is the individual making the contribution, but many times it may be their employer. There is no way for the proejct maintainer to know. Eventually, Google changed their policy to no longer recommend trying to keep the AUTHORS file up to date proactively, and instead to only add to it when requested: https://opensource.google/docs/releasing/authors. They are also clear that: > Adding contributors to the AUTHORS file is entirely within the > project's discretion and has no implications for copyright ownership. It was primarily added to appease a small number of large contributors that insisted that they be recognized as copyright holders (which was entirely their right to do). But it's not truly necessary, and not even the most accurate way of identifying contributors and/or copyright holders. In practice, we've never added anyone to our AUTHORS file. It only lists Tailscale, so it's not really serving any purpose. It also causes confusion because Tailscalars put the "Tailscale Inc & AUTHORS" header in other open source repos which don't actually have an AUTHORS file, so it's ambiguous what that means. Instead, we just acknowledge that the contributors to Tailscale (whoever they are) are copyright holders for their individual contributions. We also have the benefit of using the DCO (developercertificate.org) which provides some additional certification of their right to make the contribution. The source file changes were purely mechanical with: git ls-files | xargs sed -i -e 's/\(Tailscale Inc &\) AUTHORS/\1 contributors/g' Updates #cleanup Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
2025-11-18all: rename variables with lowercase-l/uppercase-IAlex Chan1-4/+4
See http://go/no-ell Signed-off-by: Alex Chan <alexc@tailscale.com> Updates #cleanup Change-Id: I8c976b51ce7a60f06315048b1920516129cc1d5d
2025-09-29feature/clientupdate: move clientupdate to a modular feature, disabled for tsnetBrad Fitzpatrick1-2/+7
Updates #12614 Change-Id: I5f685dec84a5396b7c2b66f2788ae3d286e1ddc6 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-03-24clientupdate: cache CanAutoUpdate, avoid log spam when falseBrad Fitzpatrick1-1/+6
I noticed logs on one of my machines where it can't auto-update with scary log spam about "failed to apply tailnet-wide default for auto-updates". This avoids trying to do the EditPrefs if we know it's just going to fail anyway. Updates #282 Change-Id: Ib7db3b122185faa70efe08b60ebd05a6094eed8c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-02-04clientupdate: refuse to update in tsnet binaries (#14911)Andrew Lytvynov1-0/+7
When running via tsnet, c2n will be hooked up so requests to update can reach the node. But it will then apply whatever OS-specific update function, upgrading the local tailscaled instead. We can't update tsnet automatically, so refuse it. Fixes #14892 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-10-10clientupdate: don't link distsign on platforms that don't downloadBrad Fitzpatrick1-9/+0
Updates tailscale/corp#20099 Change-Id: Ie3b782379b19d5f7890a8d3a378096b4f3e8a612 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-10-09clientupdate, ipn/localapi: don't use google/uuid, thin iOS depsBrad Fitzpatrick1-199/+0
We were using google/uuid in two places and that brought in database/sql/driver. We didn't need it in either place. Updates #13760 Updates tailscale/corp#20099 Change-Id: Ieed32f1bebe35d35f47ec5a2a429268f24f11f1f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-07-08clientupdate: return true for CanAutoUpdate for macsys (#12746)Andrew Lytvynov1-0/+5
While `clientupdate.Updater` won't be able to apply updates on macsys, we use `clientupdate.CanAutoUpdate` to gate the EditPrefs endpoint in localAPI. We should allow the GUI client to set AutoUpdate.Apply on macsys for it to properly get reported to the control plane. This also allows the tailnet-wide default for auto-updates to propagate to macsys clients. Updates https://github.com/tailscale/corp/issues/21339 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-06-17clientupdate: allow switching from unstable to stable tracks (#12477)Andrew Lytvynov1-25/+34
Previously, we would only compare the current version to resolved latest version for track. When running `tailscale update --track=stable` from an unstable build, it would almost always fail because the stable version is "older". But we should support explicitly switching tracks like that. Fixes #12347 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-06-06ipn/ipnlocal,clientupdate: allow auto-updates in contaienrs (#12391)Andrew Lytvynov1-15/+13
We assume most containers are immutable and don't expect tailscale running in them to auto-update. But there's no reason to prohibit it outright. Ignore the tailnet-wide default auto-update setting in containers, but allow local users to turn on auto-updates via the CLI. RELNOTE=Auto-updates are allowed in containers, but ignore the tailnet-wide default. Fixes #12292 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-05-31clientupdate: mention when Alpine system upgrade is needed (#12306)Andrew Lytvynov1-0/+34
Alpine APK repos are versioned, and contain different package sets. Older APK releases and repos don't have the latest tailscale package. When we report "no update available", check whether pkgs.tailscale.com has a newer tarball release. If it does, it's possible that the system is on an older Alpine release. Print additional messages to suggest the user to upgrade their OS. Fixes #11309 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-04-29clientupdate: exec systemctl instead of using dbus to restart (#11923)Andrew Lytvynov1-0/+14
Shell out to "systemctl", which lets us drop an extra dependency. Updates https://github.com/tailscale/corp/issues/18935 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-04-19ipn/ipnlocal,clientupdate: disallow auto-updates in containers (#11814)Andrew Lytvynov1-13/+15
Containers are typically immutable and should be updated as a whole (and not individual packages within). Deny enablement of auto-updates in containers. Also, add the missing check in EditPrefs in LocalAPI, to catch cases like tailnet default auto-updates getting enabled for nodes that don't support it. Updates #11544 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-04-19clientupdate: return OS-specific version from LatestTailscaleVersion (#11812)Andrew Lytvynov1-3/+16
We don't always have the same latest version for all platforms (like with 1.64.2 is only Synology+Windows), so we should use the OS-specific result from pkgs JSON response instead of the main Version field. Updates #11795 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-04-16all: use Go 1.22 range-over-intBrad Fitzpatrick1-1/+1
Updates #11058 Change-Id: I35e7ef9b90e83cac04ca93fd964ad00ed5b48430 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-03-13clientupdate: do not allow msiexec to reboot the OS (#11409)Andrew Lytvynov1-1/+1
According to https://learn.microsoft.com/en-us/windows/win32/msi/standard-installer-command-line-options#promptrestart, `/promptrestart` is ignored with `/quiet` is set, so msiexec.exe can sometimes silently trigger a reboot. The best we can do to reduce unexpected disruption is to just prevent restarts, until the user chooses to do it. Restarts aren't normally needed for Tailscale updates, but there seem to be some situations where it's triggered. Updates #18254 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-02-29clientupdate: handle multiple versions in "apk info tailscale" output (#11310)Andrew Lytvynov1-1/+8
The package info output can list multiple package versions, and not in descending order. Find the newest version in the output, instead of the first one. Fixes #11309 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-02-14clientupdate: disable auto update on NixOS (#11136)Patrick O'Doherty1-0/+11
Updates #cleanup NixOS packages are immutable and attempts to update via our tarball mechanism will always fail as a result. Instead we now direct users to update their nix channel or nixpkgs flake input to receive the latest Tailscale release. Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
2023-12-11clientupdate: add explicit Track to Arguments (#10548)Andrew Lytvynov1-35/+44
Instead of overloading the Version field, add an explicit Track field. This fixes a bug where passing a track name in `args.Version` would keep the track name in `updater.Version` and pass it down the code path to commands like `apt-get install`. Now, `updater.Version` should always be a version (or empty string). Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-08clientupdate: remove TS_NOLAUNCH and GUI restart hacks from autoupdateAaron Klotz1-14/+1
We've fixed the underlying issue in github.com/tailscale/corp/issues/13998. Fixes #10513 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2023-12-01client/web: show features based on platform supportSonia Appasamy1-0/+7
Hiding/disabling UI features when not available on the running client. Updates #10261 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2023-11-30clientupdate: cleanup tailscale binary copies on Windows (#10433)Andrew Lytvynov1-0/+1
When updating on Windows, we make a copy of the tailscale.exe file in a temp directory to perform the update, because the original tailscale.exe gets deleted during the update. This can eat up disk space if a machine is stuck doing repeated failed update attempts. Clean up old copies explicitly before making a new one, same as we do with MSIs. Updates #10082 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-28clientupdate: implement update for Unraid (#10344)Andrew Lytvynov1-4/+59
Use the [`plugin` CLI](https://forums.unraid.net/topic/72240-solved-is-there-a-way-to-installuninstall-plugins-from-script/#comment-676870) to fetch and apply the update. Updates https://github.com/tailscale/tailscale/issues/10184 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-13ipn/ipnlocal: run "tailscale update" via systemd-run on Linux (#10229)Andrew Lytvynov1-9/+17
When we run tailscled under systemd, restarting the unit kills all child processes, including "tailscale update". And during update, the package manager will restart the tailscaled unit. Specifically on Debian-based distros, interrupting `apt-get install` can get the system into a wedged state which requires the user to manually run `dpkg --configure` to recover. To avoid all this, use `systemd-run` where available to run the `tailscale update` process. This launches it in a separate temporary unit and doesn't kill it when parent unit is restarted. Also, detect when `apt-get install` complains about aborted update and try to restore the system by running `dpkg --configure tailscale`. This could help if the system unexpectedly shuts down during our auto-update. Fixes https://github.com/tailscale/corp/issues/15771 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-09clientupdate: add support for QNAP (#10179)Andrew Lytvynov1-0/+73
Use the `qpkg_cli` to check for updates and install them. There are a couple special things about this compare to other updaters: * qpkg_cli can tell you when upgrade is available, but not what the version is * qpkg_cli --add Tailscale works for new installs, upgrades and reinstalling existing version; even reinstall of existing version takes a while Updates #10178 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-08clientupdate,ipn/ipnlocal: fix c2n update on freebsd (#10168)Andrew Lytvynov1-6/+12
The c2n part was broken because we were not looking up the tailscale binary for that GOOS. The rest of the update was failing at the `pkg upgrade` confirmation prompt. We also need to manually restart tailscaled after update. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-07clientupdate: check whether running as root early (#10161)Andrew Lytvynov1-15/+15
Check for root early, before we fetch the pkgs index. This avoids several seconds delay for the command to tell you to sudo. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-02clientupdate: do not recursively delete dirs in cleanupOldDownloads (#10093)Andrew Lytvynov1-2/+13
In case there's a wild symlink in one of the target paths, we don't want to accidentally delete too much. Limit `cleanupOldDownloads` to deleting individual files only. Updates https://github.com/tailscale/tailscale/issues/10082 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-02clientupdate: cleanup SPK and MSI downloads (#10085)Andrew Lytvynov1-0/+15
After we're done installing, clean up the temp files. This prevents temp volumes from filling up on hosts that don't reboot often. Fixes https://github.com/tailscale/tailscale/issues/10082 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-01clientupdate: clarify how to run update as Administrator on Windows (#10043)Andrew Lytvynov1-1/+6
Make the error message a bit more helpful for users. Updates #9456 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-11-01clientupdate: disable on Unraid (#10048)Derek Kaser1-0/+5
* clientupdate: disable on Unraid Updates dkaser/unraid-tailscale#94 Signed-off-by: Derek Kaser <derek.kaser@gmail.com> * Update clientupdate/clientupdate.go Signed-off-by: Andrew Lytvynov <andrew@awly.dev> --------- Signed-off-by: Derek Kaser <derek.kaser@gmail.com> Signed-off-by: Andrew Lytvynov <andrew@awly.dev> Co-authored-by: Andrew Lytvynov <andrew@awly.dev>
2023-10-31clientupdate: mention release track when running latest (#10039)Andrew Lytvynov1-2/+2
Not all users know about our tracks and versioning scheme. They can be confused when e.g. 1.52.0 is out but 1.53.0 is available. Or when 1.52.0 is our but 1.53 has not been built yet and user is on 1.51.x. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-27clientupdate: check for privileges earlier (#9964)Chris Palmer1-9/+9
Fixes #9963 Signed-off-by: Chris Palmer <cpalmer@tailscale.com>
2023-10-25clientupdate: disable auto-updates on Synology for now (#9965)Andrew Lytvynov1-1/+5
Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-24cmd/tailscale/cli: set Sparkle auto-update on macsys (#9952)Andrew Lytvynov1-1/+3
On `tailscale set --auto-update`, set the Sparkle plist option for it. Also make macsys report not supporting auto-updates over c2n, since they will be triggered by Sparkle locally. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-23clientupdate: distinguish when auto-updates are possible (#9896)Andrew Lytvynov1-23/+43
clientupdate.Updater will have a non-nil Update func in a few cases where it doesn't actually perform an update: * on Arch-like distros, where it prints instructions on how to update * on macOS app store version, where it opens the app store page Add a new clientupdate.Arguments field to cause NewUpdater to fail when we hit one of these cases. This results in c2n updates being "not supported" and `tailscale set --auto-update` returning an error. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-23clientupdate: manually restart Windows GUI after update (#9906)Andrew Lytvynov1-17/+72
When updating via c2n, `tailscale.exe update` runs from `tailscaled.exe` which runs as SYSTEM. The MSI installer does not start the GUI when running as SYSTEM. This results in Tailscale just existing on auto-update, which is ungood. Instead, always ask the MSI installer to not launch the GUI (via `TS_NOLAUNCH` argument) and launch it manually with a token from the current logged in user. The token code was borrowed from https://github.com/tailscale/tailscale/blob/d9081d6ba201e19a4f9fc341511a6e105bdbb85f/net/dns/wsl_windows.go#L207-L232 Also, make some logging changes so that these issues are easier to debug in the future. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-20clientupdate: change Mac App Store support (#9891)Andrew Lytvynov1-53/+10
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-17clientupdate: fix background install for linux tarballs (#9852)Andrew Lytvynov1-1/+1
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-16clientupdate: return ErrUnsupported for macSys clients (#9793)Andrew Lytvynov1-1/+3
The Sparkle-based update is not quite working yet. Make `NewUpdater` return `ErrUnsupported` for it to avoid the proliferation of exceptions up the stack. Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-10clientupdate: abort if current version is newer than latest (#9733)Andrew Lytvynov1-1/+6
This is only relevant for unstable releases and local builds. When local version is newer than upstream, abort release. Also, re-add missing newlines in output that were missed in https://github.com/tailscale/tailscale/pull/9694. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-10-06clientupdate,cmd/tailscale/cli: use cli.Stdout/Stderr (#9694)Andrew Lytvynov1-21/+31
In case cli.Stdout/Stderr get overriden, all CLI output should use them instead of os.Stdout/Stderr. Update the `update` command to follow this pattern. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-09-12clientupdate: restart tailscale after install on DSM6 (#9363)Andrew Lytvynov1-1/+14
DSM6 does not automatically restart packages on install, we have to do it explicitly. Also, DSM6 has a filter for publishers in Package Center. Make the error message more helpful when update fails because of this filter not allowing our package. Fixes #9361 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-09-08ipn/ipnlocal: add logging and locking to c2n /update (#9290)Andrew Lytvynov1-2/+2
Log some progress info to make updates more debuggable. Also, track whether an active update is already started and return an error if a concurrent update is attempted. Some planned future PRs: * add JSON output to `tailscale update` * use JSON output from `tailscale update` to provide a more detailed status of in-progress update (stage, download progress, etc) Updates #6907 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-09-02client/web, clientupdate, util/linuxfw, wgengine/magicsock: Use %v verb for ↵Craig Rodrigues1-1/+1
errors Replace %w verb with %v verb when logging errors. Use %w only for wrapping errors with fmt.Errorf() Fixes: #9213 Signed-off-by: Craig Rodrigues <rodrigc@crodrigues.org>
2023-08-30clientupdate: add linux tarball updates (#9144)Andrew Lytvynov1-1/+159
As a fallback to package managers, allow updating tailscale that was self-installed in some way. There are some tricky bits around updating the systemd unit (should we stick to local binary paths or to the ones in tailscaled.service?), so leaving that out for now. Updates #6995 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-08-30ipn/ipnlocal: support most Linuxes in handleC2NUpdate (#9114)Chris Palmer1-60/+77
* ipn/ipnlocal: support most Linuxes in handleC2NUpdate Updates #6995 Signed-off-by: Chris Palmer <cpalmer@tailscale.com>
2023-08-29clientupdate: detect when tailscale is installed without package manager (#9137)Andrew Lytvynov1-4/+41
On linux users can install Tailscale via package managers or direct tarball downloads. Detect when Tailscale is not installed via a package manager so we can pick the correct update mechanism. Leave the tarball update function unimplemented for now (coming in next PR!). Updates #6995 Updates #8760 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-08-28clientupdate: use SPKsVersion instead of Version (#9118)Andrew Lytvynov1-10/+12
Top-level Version in pkgs response is not always in sync with SPK versions, especially on unstable track. It's very confusing when the confirmation prompt asks you "update to 1.49.x?" and you end up updating to 1.49.y. Instead, grab the SPK-specific version field. Updates #cleanup. Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-08-28clientupdate: download SPK and MSI packages with distsign (#9115)Andrew Lytvynov1-109/+16
Reimplement `downloadURLToFile` using `distsign.Download` and move all of the progress reporting logic over there. Updates #6995 Updates #755 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>