summaryrefslogtreecommitdiffhomepage
path: root/clientupdate
AgeCommit message (Collapse)AuthorFilesLines
2026-04-17feature/clientupdate: windows update should use tailscale.exe update (#19438)kari-ts1-7/+25
Currently, clientupdate.NewUpdater().Update() is called directly inside tailscaled, which fatals. There is also a failure that doesn't return, causing a panic. This fix allows us to use the same approach as startAutoUpdate, which is to find tailscale.exe and run tailscale.exe --update, though since it's calling the updater library directly, we get progress messages. Fixes tailscale/corp#40430s Signed-off-by: kari-ts <kari@tailscale.com>
2026-04-05cmd/vet: add subtestnames analyzer; fix all existing violationsBrad Fitzpatrick2-54/+55
Add a new vet analyzer that checks t.Run subtest names don't contain characters requiring quoting when re-running via "go test -run". This enforces the style guide rule: don't use spaces or punctuation in subtest names. The analyzer flags: - Direct t.Run calls with string literal names containing spaces, regex metacharacters, quotes, or other problematic characters - Table-driven t.Run(tt.name, ...) calls where tt ranges over a slice/map literal with bad name field values Also fix all 978 existing violations across 81 test files, replacing spaces with hyphens and shortening long sentence-like names to concise hyphenated forms. Updates #19242 Change-Id: Ib0ad96a111bd8e764582d1d4902fe2599454ab65 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-03-06all: use Go 1.26 things, run most gofix modernizersBrad Fitzpatrick2-3/+3
I omitted a lot of the min/max modernizers because they didn't result in more clear code. Some of it's older "for x := range 123". Also: errors.AsType, any, fmt.Appendf, etc. Updates #18682 Change-Id: I83a451577f33877f962766a5b65ce86f7696471c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-03-05clientupdate,net/tstun: add support for OpenWrt 25.12.0 using apk (#18545)Claus Lensbøl2-21/+162
OpenWrt is changing to using alpine like `apk` for package installation over its previous opkg. Additionally, they are not using the same repo files as alpine making installation fail. Add support for the new repository files and ensure that the required package detection system uses apk. Updates #18535 Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2026-02-12clientupdate, cmd/tailscale/cli: support updating to release-candidates (#18632)Will Hannah2-54/+64
Adds a new track for release candidates. Supports querying by track in version and updating to RCs in update for supported platforms. updates #18193 Signed-off-by: Will Hannah <willh@tailscale.com>
2026-02-03clientupdate: best-effort restart of tailscaled on init.d systems (#18568)Andrew Lytvynov1-7/+51
Not all Linux distros use systemd yet, for example GL.iNet KVM devices use busybox's init, which is similar to SysV init. This is a best-effort restart attempt after the update, it probably won't cover 100% of init.d setups out there. Fixes #18567 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2026-01-23all: remove AUTHORS file and references to itWill Norris10-10/+10
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>
2026-01-07cmd/distsign: add CLI for verifying package signatures (#18239)Andrew Lytvynov1-1/+7
Updates #35374 Signed-off-by: Andrew Lytvynov <awly@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-10-10clientupdate, util/osshare, util/winutil, version: improve Windows GUI ↵Aaron Klotz1-9/+23
filename resolution and WinUI build awareness On Windows arm64 we are going to need to ship two different GUI builds; one for Win10 (GOARCH=386) and one for Win11 (GOARCH=amd64, tags += winui). Due to quirks in MSI packaging, they cannot both share the same filename. This requires some fixes in places where we have hardcoded "tailscale-ipn" as the GUI filename. We also do some cleanup in clientupdate to ensure that autoupdates will continue to work correctly with the temporary "-winui" package variant. Fixes #17480 Updates https://github.com/tailscale/corp/issues/29940 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-09-30feature, net/tshttpproxy: pull out support for using proxies as a featureBrad Fitzpatrick1-2/+2
Saves 139 KB. Also Synology support, which I saw had its own large-ish proxy parsing support on Linux, but support for proxies without Synology proxy support is reasonable, so I pulled that out as its own thing. Updates #12614 Change-Id: I22de285a3def7be77fdcf23e2bec7c83c9655593 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
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-04-09clientupdate: fix MSI exit code handling, preserve MSI and updater logs on ↵Nick Khyl1-10/+75
Windows In this PR, we update the Windows client updater to: - Run msiexec with logging enabled and preserve the log file in %ProgramData%\Tailscale\Logs; - Preserve the updater's own log file in the same location; - Properly handle ERROR_SUCCESS_REBOOT_REQUIRED, ERROR_SUCCESS_REBOOT_INITIATED, and ERROR_INSTALL_ALREADY_RUNNING exit codes. The first two values indicate that installation completed successfully and no further retries are needed. The last one means the Windows Installer service is busy. Retrying immediately is likely to fail and may be risky; it could uninstall the current version without successfully installing the new one, potentially leaving the user without Tailscale. Updates tailscale/corp#27496 Updates tailscale#15554 Signed-off-by: Nick Khyl <nickk@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 Fitzpatrick3-9/+30
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 Fitzpatrick3-203/+211
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 Lytvynov2-25/+138
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 Lytvynov3-52/+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 Fitzpatrick3-3/+3
Updates #11058 Change-Id: I35e7ef9b90e83cac04ca93fd964ad00ed5b48430 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-04-03clientupdate, net/dns: fix some "tailsacle" typosBrad Fitzpatrick1-2/+2
Updates #cleanup Change-Id: I982175e74b0c8c5b3e01a573e5785e6596b7ac39 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 Lytvynov2-1/+31
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 Klotz2-70/+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 Lytvynov6-4/+526
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-14clientupdate: fix auto-update on Windows over RDP (#10242)Andrew Lytvynov1-7/+34
`winutil.WTSGetActiveConsoleSessionId` only works for physical desktop logins and does not return the session ID for RDP logins. We need to `windows.WTSEnumerateSessions` and find the active session. Fixes https://github.com/tailscale/corp/issues/15772 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 Lytvynov2-2/+125
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 Lytvynov2-17/+101
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 Lytvynov2-131/+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>