9555 Commits

Author SHA1 Message Date
Jonathan Nobels
6006bc92b5
net/{netns, netmon}: use LastKnownDefaultInterface if set and check for utun (#16873)
fixes tailscale/corp#31299

Fixes two issues:
getInterfaceIndex would occasionally race with netmon's state, returning
the cached default interface index after it had be changed by NWNetworkMonitor.
This had the potential to cause connections to bind to the prior default.  The fix
here is to preferentially use the interface index provided by NWNetworkMonitor
preferentially.

When no interfaces are available, macOS will set the tunnel as the default
interface when an exit node is enabled, potentially causing getInterfaceIndex
to return utun's index.  We now guard against this when taking the
defaultIdx path.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2025-08-15 13:04:23 -07:00
Percy Wegmann
9c39296ab5 release/dist/qnap: verify code signing
This pulls in a change from github.com/tailscale/QDK to verify code signing
when using QNAP_SIGNING_SCRIPT.

It also upgrades to the latest Google Cloud PKCS#11 library, and reorders
the Dockerfile to allow for more efficient future upgrades to the included QDK.

Updates tailscale/corp#23528

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-08-15 14:26:29 -05:00
Patrick O'Doherty
55beba4094
types/key: init HardwareAttestionKey implementation (#16867)
Define the HardwareAttestionKey interface describing a platform-specific
hardware backed node identity attestation key. Clients will register the
key type implementations for their platform.

Updates tailscale/corp#31269

Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
2025-08-15 11:36:30 -07:00
Will Hannah
5b6c64b187
net/tshttpproxy: use errors.New for error creation (#16860)
Updates tailscale/corp#30668

Signed-off-by: Will Hannah <willh@tailscale.com>
2025-08-15 09:11:27 -04:00
Michael Ben-Ami
3f1851a6d9 types/dnstype, ipn/ipnlocal: allow other DNS resolvers with exit nodes
dnstype.Resolver adds a boolean UseWithExitNode that controls
whether the resolver should be used in tailscale exit node contexts
(not wireguard exit nodes). If UseWithExitNode resolvers are found,
they are installed as the global resolvers. If no UseWithExitNode resolvers
are found, the exit node resolver continues to be installed as the global
resolver. Split DNS Routes referencing UseWithExitNode resolvers are also
installed.

Updates #8237

Fixes tailscale/corp#30906
Fixes tailscale/corp#30907

Signed-off-by: Michael Ben-Ami <mzb@tailscale.com>
2025-08-15 08:17:01 -04:00
Will Norris
b8c45a6a8f client/systray: add CLI error output if operator is missing
We already show a message in the menu itself, this just adds it to the
CLI output as well.

Updates #1708

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
2025-08-14 16:34:50 -07:00
Joe Tsai
fbb91758ac
cmd/viewer, types/views: implement support for json/v2 (#16852)
This adds support for having every viewer type implement
jsonv2.MarshalerTo and jsonv2.UnmarshalerFrom.

This provides a significant boost in performance
as the json package no longer needs to validate
the entirety of the JSON value outputted by MarshalJSON,
nor does it need to identify the boundaries of a JSON value
in order to call UnmarshalJSON.

For deeply nested and recursive MarshalJSON or UnmarshalJSON calls,
this can improve runtime from O(N²) to O(N).

This still references "github.com/go-json-experiment/json"
instead of the experimental "encoding/json/v2" package
now available in Go 1.25 under goexperiment.jsonv2
so that code still builds without the experiment tag.
Of note, the "github.com/go-json-experiment/json" package
aliases the standard library under the right build conditions.

Updates tailscale/corp#791

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2025-08-14 13:46:48 -07:00
Jordan Whited
c083a9b053
net/batching: fix compile-time assert (#16864)
Updates #cleanup

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-14 10:48:06 -07:00
Anton Tolchanov
819db6759c tka: block key addition when the max number of keys is reached
Updates #16607

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-08-14 15:30:13 +01:00
Will Hannah
5402620db8
net/tshttpproxy: add macOS support for system proxy (#16826)
Adds a setter for proxyFunc to allow macOS to pull defined
system proxies. Disallows overriding if proxyFunc is set via config.

Updates tailscale/corp#30668

Signed-off-by: Will Hannah <willh@tailscale.com>
2025-08-14 10:19:20 -04:00
Brad Fitzpatrick
e4d2822afc go.toolchain.rev: bump Go for data race in Go http client
Updates golang/go#73522
Updates tailscale/go#131
Updates tailscale/corp#31133

Change-Id: Ibb7a98944ef287d455ce4f5d202b2e2bd6d8742b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-08-13 18:15:23 -07:00
Andrew Lytvynov
0f7facfeee
control/controlclient: fix data race on tkaHead (#16855)
Grab a copy under mutex in sendMapRequest.

Updates #cleanup

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-08-13 13:49:27 -07:00
Jordan Whited
16bc0a5558
net/{batching,packet},wgengine/magicsock: export batchingConn (#16848)
For eventual use by net/udprelay.Server.

Updates tailscale/corp#31164

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-13 13:13:11 -07:00
Andrew Lytvynov
f22c7657e5
cmd/tailscale: add --json-docs flag (#16851)
This prints all command and flag docs as JSON. To be used for generating
the contents of https://tailscale.com/kb/1080/cli.

Updates https://github.com/tailscale/tailscale-www/issues/4722

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-08-13 11:19:29 -07:00
dependabot[bot]
d07166b87d
.github: Bump actions/cache from 4.2.3 to 4.2.4 (#16829)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](5a3ec84eff...0400d5f644)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 4.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 20:36:47 -06:00
M. J. Fromberger
ee0c7b05a5
cmd/tailscale: fix a panic in netcheck portmapper construction (#16843)
This affects the 1.87.33 unstable release.

Updates #16842
Updates #15160

Change-Id: Ie6d1b2c094d1a6059fbd1023760567900f06e0ad
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-08-12 10:19:33 -07:00
Jordan Whited
cde65dba16
wgengine/magicsock: add clientmetric for Peer Relay challenge reception (#16834)
Updates tailscale/corp#30527

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-11 14:53:25 -07:00
Jordan Whited
4fa27db8dd
wgengine/magicsock: add clientmetrics for locally delivered Peer Relay alloc disco (#16833)
Expected when Peer Relay'ing via self. These disco messages never get
sealed, and never leave the process.

Updates tailscale/corp#30527

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-11 14:48:19 -07:00
Jordan Whited
36397f1794
wgengine/magicsock: add clientmetrics for TX direction Peer Relay disco messages (#16831)
Updates tailscale/corp#30527

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-11 13:29:57 -07:00
Mike O'Driscoll
03c4b2a0d0
derp/derphttp: test improvements (#16723)
Update some logging to help future failures.
Improve test shutdown concurrency issues.

Fixes #16722

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
2025-08-11 12:57:15 -04:00
Jordan Whited
d122f0350e
control/controlknobs,tailcfg,wgengine/magicsock: deprecate NodeAttrDisableMagicSockCryptoRouting (#16818)
Peer Relay is dependent on crypto routing, therefore crypto routing is
now mandatory.

Updates tailscale/corp#20732
Updates tailscale/corp#31083

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-11 09:04:03 -07:00
dependabot[bot]
71d51eb8db
.github: bump github/codeql-action from 3.29.3 to 3.29.5 (#16765)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.3 to 3.29.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d6bbdef45e...51f77329af)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-10 21:56:17 -06:00
Brad Fitzpatrick
796eb21204 go.toolchain.rev: bump tsgo toolchain
Updates tailscale/go#129

Change-Id: I94debd1d0b7080c5b012f200ad98d22c3048f350
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-08-08 16:21:39 -06:00
Claus Lensbøl
5297dc3baf
cmd/tailscale/cli: move systray configuration to tailscale configure (#16817)
Updates #1708

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-08-08 16:12:11 -04:00
Andrew Lytvynov
b5283ab13a
go.toolchain.rev: bump to 1.24.6 (#16811)
Updates https://github.com/tailscale/corp/issues/31103

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-08-07 14:41:55 -07:00
Claus Lensbøl
3fe022877a
client/systray: temporarily replace systray module (#16807)
We are waiting for a PR to be reviewed upstream.

https://github.com/fyne-io/systray/pull/100

Updates #1708

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-08-07 16:02:47 -04:00
Erisa A
d4060f1a39
CODE_OF_CONDUCT.md: update Code of Conduct (#16806)
Updates #cleanup

Signed-off-by: Erisa A <erisa@tailscale.com>
2025-08-07 19:27:56 +01:00
Claus Lensbøl
89954fbceb
client/systray: add startup script generator for systemd (#16801)
Updates #1708

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-08-07 11:51:15 -04:00
Jordan Whited
4666d4ca2a
wgengine/magicsock: fix missing Conn.hasPeerRelayServers.Store() call (#16792)
This commit also extends the updateRelayServersSet unit tests to cover
onNodeViewsUpdate.

Fixes tailscale/corp#31080

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-06 14:57:55 -07:00
Jordan Whited
0374e6d906
wgengine/magicsock: add lazyEndpoint.FromPeer tests (#16791)
Updates tailscale/corp#30903

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-06 14:55:34 -07:00
Jordan Whited
02967ffcf2
wgengine/magicsock: add lazyEndpoint.InitiationMessagePublicKey tests (#16790)
Updates tailscale/corp#30903

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-06 14:41:05 -07:00
Jordan Whited
908f20e0a5
wgengine/magicsock: add receiveIP() unit tests (#16781)
One of these tests highlighted a Geneve encap bug, which is also fixed
in this commit.

looksLikeInitMsg was passed a packet post Geneve header stripping with
slice offsets that had not been updated to account for the stripping.

Updates tailscale/corp#30903

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-06 09:35:25 -07:00
TheBigBear
57d653014b
scripts/installer.sh: add FreeBSD 15 (#16741)
* Update installer.sh add FreeBSD ver 15

this should fix the issue on https://github.com/tailscale/tailscale/issues/16740

Signed-off-by: TheBigBear <471105+TheBigBear@users.noreply.github.com>

* scripts/installer.sh: small indentation change

Signed-off-by: Erisa A <erisa@tailscale.com>
Fixes #16740

---------

Signed-off-by: TheBigBear <471105+TheBigBear@users.noreply.github.com>
Signed-off-by: Erisa A <erisa@tailscale.com>
Co-authored-by: Erisa A <erisa@tailscale.com>
2025-08-06 02:38:50 +01:00
Andrew Lytvynov
f80ea92030
.github/workflows: enforce github action version pinning (#16768)
Use https://github.com/stacklok/frizbee via the new `go tool` support
from Go 1.24.

Updates https://github.com/tailscale/corp/issues/31017

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-08-05 11:49:33 -07:00
Erisa A
ad273d75b7
scripts/installer.sh: add bazzite handling (#16779)
Fixes #14540

Signed-off-by: Erisa A <erisa@tailscale.com>
2025-08-05 18:24:32 +01:00
Will Norris
9f29c428f4 client/systray: allow specifying tailscaled socket
Pass a local.Client to systray.Run, so we can use the existing global
localClient in the cmd/tailscale CLI.  Add socket flag to cmd/systray.

Updates #1708

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
2025-08-05 09:19:49 -07:00
Claus Lensbøl
5bb42e3018
wgengine/router: rely on events for deleted IP rules (#16744)
Adds the eventbus to the router subsystem.

The event is currently only used on linux.

Also includes facilities to inject events into the bus.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-08-05 08:31:51 -04:00
Jordan Whited
b0018f1e7d
wgengine/magicsock: fix looksLikeInitiationMsg endianness (#16771)
WireGuard message type is little-endian encoded.

Updates tailscale/corp#30903

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-08-04 14:21:32 -07:00
Will Norris
834630fedf cmd/tailscale: add systray subcommand on Linux builds
This will start including the sytray app in unstable builds for Linux,
unless the `ts_omit_systray` build flag is specified.

If we decide not to include it in the v1.88 release, we can pull it
back out or restrict it to unstable builds.

Updates #1708

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
2025-08-01 17:57:06 -07:00
Will Norris
0f15e44196 Makefile: sort make commands and fix printing newlines
Updates #cleanup

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
2025-08-01 15:41:56 -07:00
kari-ts
d897d809d6
feature/taildrop: do not use m.opts.Dir for Android (#16316)
In Android, we are prompting the user to select a Taildrop directory when they first receive a Taildrop: we block writes on Taildrop dir selection. This means that we cannot use Dir inside managerOptions, since the http request would not get the new Taildrop extension. This PR removes, in the Android case, the reliance on m.opts.Dir, and instead has FileOps hold the correct directory.

This expands FileOps to be the Taildrop interface for all file system operations.

Updates tailscale/corp#29211

Signed-off-by: kari-ts <kari@tailscale.com>

restore tstest
2025-08-01 15:10:00 -07:00
mzbenami
5865d0a61a
Makefile: 'generate' target (#16746)
Signed-off-by: Michael Ben-Ami <mzb@tailscale.com>
2025-08-01 13:30:42 -04:00
Lee Briggs
f2fd7a0514
cmd/k8s-operator,k8s-operator: allow setting a priorityClassName (#16685)
* cmd/k8s-operator,k8s-operator: allow setting a `priorityClassName`

Fixes #16682

Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>

* Update k8s-operator/apis/v1alpha1/types_proxyclass.go

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
Signed-off-by: Lee Briggs <jaxxstorm@users.noreply.github.com>

* run make kube-generate-all

Change-Id: I5f8f16694fdc181b048217b9f05ec2ee2aa04def
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>

---------

Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
Signed-off-by: Lee Briggs <jaxxstorm@users.noreply.github.com>
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-07-31 23:35:48 -07:00
jishudashu
23a0398136
ipn/ipnlocal, net/dns: use slices.Equal to simplify code (#16641)
Signed-off-by: jishudashu <979260390@qq.com>
2025-07-31 11:36:51 -07:00
Mike O'Driscoll
47b5f10165
cmd/tsidp,tsnet: update tsidp oidc-key store path (#16735)
The tsidp oidc-key.json ended up in the root directory
or home dir of the user process running it.

Update this to store it in a known location respecting
the TS_STATE_DIR and flagDir options.

Fixes #16734

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
2025-07-31 12:13:36 -04:00
Joe Tsai
1cc842b389
util/set: add more functionality to IntSet (#16640) 2025-07-30 13:08:53 -07:00
Tom Proctor
eed3e5dc61
ipn/store/kubestore,kube: fix cert error in admin UI (#16717)
Also adds a test to kube/kubeclient to defend against the error type
returned by the client changing in future.

Fixes tailscale/corp#30855

Change-Id: Id11d4295003e66ad5c29a687f1239333c21226a4

Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-07-30 13:39:59 +01:00
Percy Wegmann
aa6a2d1e56 drive/driveimpl: use sudo or su to run file server
Some systems have `sudo`, some have `su`. This tries both, increasing
the chance that we can run the file server as an unprivileged user.

Updates #14629

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-07-29 17:06:20 -05:00
Jordan Whited
3d1e4f147a
tstest/natlab: fix conn.Close race with conn.ReadFromUDPAddrPort (#16710)
If a conn.Close call raced conn.ReadFromUDPAddrPort before it could
"register" itself as an active read, the conn.ReadFromUDPAddrPort would
never return.

This commit replaces all the activeRead and breakActiveReads machinery
with a channel. These constructs were only depended upon by
SetReadDeadline, and SetReadDeadline was unused.

Updates #16707

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-07-29 14:58:47 -07:00
KevinLiang10
e37432afb7
cmd/tailscale/cli: update message for disable service (#16705)
This commit update the message for recommanding clear command after running serve for service.
Instead of a flag, we pass the service name as a parameter.

Fixes tailscale/corp#30846

Signed-off-by: KevinLiang10 <37811973+KevinLiang10@users.noreply.github.com>
2025-07-29 13:59:09 -04:00