9514 Commits

Author SHA1 Message Date
Claus Lensbøl
b816fd7117
control/controlclient: introduce eventbus messages instead of callbacks (#16956)
This is a small introduction of the eventbus into controlclient that
communicates with mainly ipnlocal. While ipnlocal is a complicated part
of the codebase, the subscribers here are from the perspective of
ipnlocal already called async.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-09-15 10:36:17 -04:00
David Bond
782c16c513
k8s-operator: reset service status before append (#17120)
This commit fixes an issue within the service reconciler where we end
up in a constant reconciliation loop. When reconciling, the loadbalancer
status is appended to but not reset between each reconciliation, leading
to an ever growing slice of duplicate statuses.

Fixes https://github.com/tailscale/tailscale/issues/17105
Fixes https://github.com/tailscale/tailscale/issues/17107

Signed-off-by: David Bond <davidsbond93@gmail.com>
2025-09-15 12:37:28 +01:00
Brad Fitzpatrick
7d2101f352 cmd/omitsize: add flag to disable the removal table
And remove a bogus omit feature from feature/featuretags.

Updates #12614

Change-Id: I0a08183fb75c73ae75b6fd4216d134e352dcf5a0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-13 21:09:38 -07:00
Brad Fitzpatrick
0cc1b2ff76 cmd/derper: add start of ACE support
Updates tailscale/corp#32168
Updates tailscale/corp#32226

Change-Id: Ia46abcaa09dcfd53bf8d4699909537bacf84d57a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-12 12:51:45 -07:00
Brad Fitzpatrick
3a49b7464c all: add ts_omit_tailnetlock as a start of making it build-time modular
Updates #17115

Change-Id: I6b083c0db4c4d359e49eb129d626b7f128f0a9d2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-12 12:23:34 -07:00
Brad Fitzpatrick
0e3d942e39 feature/featuretags: move list of omit-able features to a Go package
Updates #12614

Change-Id: I4012c33095c6a7ccf80ad36dbab5cedbae5b3d47
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-12 12:03:17 -07:00
David Bond
cfb2ca724b
tsnet: expose logtail's Logf method (#17057)
This commit adds a new method to the tsnet.Server type named `Logger`
that returns the underlying logtail instance's Logf method.

This is intended to be used within the Kubernetes operator to wrap its
existing logger in a way such that operator specific logs can also be
sent to control for support & debugging purposes.

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

Signed-off-by: David Bond <davidsbond93@gmail.com>
2025-09-12 12:04:39 +01:00
Brad Fitzpatrick
a1dcf12b67 feature/drive: start factoring out Taildrive, add ts_omit_drive build tag
As of this commit (per the issue), the Taildrive code remains where it
was, but in new files that are protected by the new ts_omit_drive
build tag. Future commits will move it.

Updates #17058

Change-Id: Idf0a51db59e41ae8da6ea2b11d238aefc48b219e
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-11 14:26:08 -07:00
Brad Fitzpatrick
82c5024f03 net/netns: fix controlLogf doc
Its doc said its signature matched a std signature, but it used
Tailscale-specific types.

Nowadays it's the caller (func control) that curries the logf/netmon
and returns the std-matching signature.

Updates #cleanup (while answering a question on Slack)

Change-Id: Ic99de41fc6a1c720575a7f33c564d0bcfd9a2c30
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-11 14:24:57 -07:00
Brad Fitzpatrick
921d77062e cmd/omitsize: add tool to dump build sizes
Updates #12614

Change-Id: I8f85d7275bc8eecedbabe6631b50e1cf70791d2d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-11 13:40:57 -07:00
Will Hannah
1be9c6b23e
VERSION.txt: this is v1.89.0 (#17099)
Signed-off-by: Will Hannah <willh@tailscale.com>
v1.89.0-pre
2025-09-11 14:19:17 -04:00
Will Hannah
49aa798d18
VERSION.txt: this is v1.88.0 (#17098)
Signed-off-by: Will Hannah <willh@tailscale.com>
2025-09-11 13:56:02 -04:00
Jordan Whited
fb9d9ba86e
wgengine/magicsock: add TS_DEBUG_NEVER_DIRECT_UDP debug knob (#17094)
Updates tailscale/corp#30903

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-09-10 16:48:40 -07:00
Jordan Whited
32bfd72752
tstest/integration/testcontrol: propagate CapVer (#17093)
To support integration testing of client features that rely on it, e.g.
peer relay.

Updates tailscale/corp#30903

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-09-10 16:30:25 -07:00
Jordan Whited
6feb6f3c75
wgengine/magicsock: add relayManager event logs (#17091)
These are gated behind magicsock component debug logging.

Updates tailscale/corp#30818

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-09-10 12:36:53 -07:00
Tom Proctor
1ec3d20d10
cmd/k8s-operator: simplify scope of e2e tests (#17076)
Removes ACL edits from e2e tests in favour of trying to simplify the
tests and separate the actual test logic from the environment setup
logic as much as possible. Also aims to fit in with the requirements
that will generally be filled anyway for most devs working on the
operator; in particular using tags that fit in with our documentation.

Updates tailscale/corp#32085

Change-Id: I7659246e39ec0b7bcc4ec0a00c6310f25fe6fac2

Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-09-10 13:02:59 +01:00
Jordan Whited
2d9d869d3d
wgengine/magicsock: fix debug disco printing of alloc resp disco keys (#17087)
Updates tailscale/corp#30818

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-09-09 15:38:08 -07:00
Jordan Whited
09bfee2e06
disco: add missing message types to MessageSummary (#17081)
Updates tailscale/corp#30818

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-09-09 14:54:22 -07:00
nikiUppal-TS
88d7db33da
cmd/tailscale: use tailnet display name on cli (#17079)
Updates cli to use tailnet display name

Updates tailscale/corp#32108

Signed-off-by: nikiUppal-TS <nikita@tailscale.com>
2025-09-09 16:02:56 -05:00
Nick O'Neill
77250a301a
ipn/ipnlocal, types: plumb tailnet display name cap through to network profile (#17045)
Updates tailscale/corp#30456

Signed-off-by: Nick O'Neill <nick@tailscale.com>
2025-09-09 09:03:01 -07:00
Brad Fitzpatrick
f1ded84454 cmd/tailscaled: add disabled debug file to force reflect for binary size experiments
This adds a file that's not compiled by default that exists just to
make it easier to do binary size checks, probing what a binary would
be like if it included reflect methods (as used by html/template, etc).

As an example, once tailscaled uses reflect.Type.MethodByName(non-const-string) anywhere,
the build jumps up by 14.5 MB:

    $ GOOS=linux GOARCH=amd64 ./tool/go build -tags=ts_include_cli,ts_omit_webclient,ts_omit_systray,ts_omit_debugeventbus -o before ./cmd/tailscaled

    $ GOOS=linux GOARCH=amd64 ./tool/go build -tags=ts_include_cli,ts_omit_webclient,ts_omit_systray,ts_omit_debugeventbus,ts_debug_forcereflect -o after ./cmd/tailscaled

    $ ls -l before after
    -rwxr-xr-x@ 1 bradfitz  staff  41011861 Sep  9 07:28 before
    -rwxr-xr-x@ 1 bradfitz  staff  55610948 Sep  9 07:29 after

This is particularly pronounced with large deps like the AWS SDK. If you compare using ts_omit_aws:

    -rwxr-xr-x@ 1 bradfitz  staff  38284771 Sep  9 07:40 no-aws-no-reflect
    -rwxr-xr-x@ 1 bradfitz  staff  45546491 Sep  9 07:41 no-aws-with-reflect

That means adding AWS to a non-reflect binary adds 2.7 MB but adding
AWS to a reflect binary adds 10 MB.

Updates #17063
Updates #12614

Change-Id: I18e9b77c9cf33565ce5bba65ac5584fa9433f7fb
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-09 07:56:30 -07:00
Alex Chan
f4ae81e015
tsnet: remove APIClient() which is deprecated and now unused (#17073)
Updates tailscale/corp#22748

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-09 14:12:08 +01:00
Brad Fitzpatrick
3e4b0c1516 cmd/tailscale, ipn/ipnlocal: add ts_omit_webclient
Fixes #17063
Updates #12614

Change-Id: I0a189f6a4d1c4558351e3195839867725774fa96
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-08 12:59:42 -07:00
Brad Fitzpatrick
ffc82ad820 util/eventbus: add ts_omit_debugeventbus
Updates #17063

Change-Id: Ibc98dd2088f82c829effa71f72f3e2a5abda5038
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-08 12:40:25 -07:00
Brad Fitzpatrick
6f9f190f4d go.toolchain.rev: bump to Go 1.25.1
Updates #17064

Change-Id: Ibbca837e0921fe9f82fc931dde8bb51b017e4e48
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-08 11:47:30 -07:00
License Updater
2da52dce7a licenses: update license notices
Signed-off-by: License Updater <noreply+license-updater@tailscale.com>
2025-09-08 11:13:39 -07:00
Alex Chan
71cb6d4cbd
cmd/tailscale/cli, derp: use client/local instead of deprecated client/tailscale (#17061)
* cmd/tailscale/cli: use client/local instead of deprecated client/tailscale

Updates tailscale/corp#22748

Signed-off-by: Alex Chan <alexc@tailscale.com>

* derp: use client/local instead of deprecated client/tailscale

Updates tailscale/corp#22748

Signed-off-by: Alex Chan <alexc@tailscale.com>

---------

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-08 17:51:59 +01:00
Brad Fitzpatrick
1cb855fb36 util/expvarx: deflake TestSafeFuncHappyPath with synctest
I probably could've deflaked this without synctest, but might as well use
it now that Go 1.25 has it.

Fixes #15348

Change-Id: I81c9253fcb7eada079f3e943ab5f1e29ba8e8e31
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-08 09:03:17 -07:00
Alex Chan
14adf5b717
utils/expvarx, tstest/integration: mark two tests as known flaky (#17052)
* utils/expvarx: mark TestSafeFuncHappyPath as known flaky

Updates #15348

Signed-off-by: Alex Chan <alexc@tailscale.com>

* tstest/integration: mark TestCollectPanic as known flaky

Updates #15865

Signed-off-by: Alex Chan <alexc@tailscale.com>

---------

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-08 15:27:24 +01:00
Alex Chan
ff8900583c
cmd/tailscale/cli: fix the spelling of "routes" (#17039)
Updates #cleanup

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-08 15:25:50 +01:00
Anton Tolchanov
ed6aa50bd5 prober: include current probe results in run-probe text response
It was a bit confusing that provided history did not include the
current probe results.

Updates tailscale/corp#20583

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-09-07 08:40:53 +01:00
James Tucker
a29545e9cc wgengine/magicsock: log the peer failing disco writes are intended for
Updates tailscale/corp#31762

Signed-off-by: James Tucker <james@tailscale.com>
2025-09-05 19:02:17 -07:00
Mike O'Driscoll
23297da10d
cmd/tailscale/cli: add new line for set --webclient (#17043)
Fixes #17042

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
2025-09-05 15:56:23 -04:00
James Sanderson
046b8830c7 ipn/ipnlocal: add state change test for key expiry
Updates tailscale/corp#31478

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2025-09-05 15:14:45 +01:00
Brad Fitzpatrick
46369f06af util/syspolicy/policyclient: always use no-op policyclient in tests by default
We should never use the real syspolicy implementation in tests by
default. (the machine's configuration shouldn't affect tests)

You either specify a test policy, or you get a no-op one.

Updates #16998

Change-Id: I3350d392aad11573a5ad7caab919bb3bbaecb225
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-04 15:14:15 -07:00
Brad Fitzpatrick
b034f7cca9 ipn/ipnlocal, util/syspolicy: convert last RegisterWellKnownSettingsForTest caller, remove
Updates #16998

Change-Id: I735d75129a97a929092e9075107e41cdade18944
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-04 12:45:44 -07:00
David Bond
624cdd2961
cmd/containerboot: do not reset state on non-existant secret (#17021)
This commit modifies containerboot's state reset process to handle the
state secret not existing. During other parts of the boot process we
gracefully handle the state secret not being created yet, but missed
that check within `resetContainerbootState`

Fixes https://github.com/tailscale/tailscale/issues/16804

Signed-off-by: David Bond <davidsbond93@gmail.com>
2025-09-04 12:40:55 +01:00
Brad Fitzpatrick
d8ac539bf9 util/syspolicy: remove handler, other dead code
Fixes #17022

Change-Id: I6a0f6488ae3ea75c5844dfcba68e1e8024e930be
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-03 15:37:21 -07:00
David Bond
04f00339b6
cmd/k8s-operator: update connector example (#17020)
This commit modifies the connector example to use the new hostname prefix
and replicas fields

Signed-off-by: David Bond <davidsbond93@gmail.com>
2025-09-03 22:08:45 +01:00
Jonathan Nobels
a2f2ac6ba1
ipn/local: fix deadlock in initial suggested exit node query (#17025)
updates tailscale/corp#26369

b.mu is locked here.  We need to use suggestExitNodeLocked.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2025-09-03 15:35:05 -04:00
Craig Hesling
2b9d055101 drive: fix StatCache mishandling of paths with spaces
Fix "file not found" errors when WebDAV clients access files/dirs inside
directories with spaces.

The issue occurred because StatCache was mixing URL-escaped and
unescaped paths, causing cache key mismatches.
Specifically, StatCache.set() parsed WebDAV responses containing
URL-escaped paths (ex. "Dir%20Space/file1.txt") and stored them
alongside unescaped cache keys (ex. "Dir Space/file1.txt").
This mismatch prevented StatCache.get() from correctly determining whether
a child file existed.

See https://github.com/tailscale/tailscale/issues/13632#issuecomment-3243522449
for the full explanation of the issue.

The decision to keep all paths references unescaped inside the StatCache
is consistent with net/http.Request.URL.Path and rewrite.go (sole consumer)

Update unit test to detect this directory space mishandling.

Fixes tailscale#13632

Signed-off-by: Craig Hesling <craig@hesling.com>
2025-09-03 14:28:22 -05:00
Brad Fitzpatrick
0f3598b467 util/syspolicy: delete some unused code in handler.go
There's a TODO to delete all of handler.go, but part of it's
still used in another repo.

But this deletes some.

Updates #17022

Change-Id: Ic5a8a5a694ca258440307436731cd92b45ee2d21
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-03 10:44:10 -07:00
Alex Chan
c9f214e503
ipn: warn about self as the exit node if backend is running (#17018)
Before:

    $ tailscale ip -4
    1.2.3.4

    $ tailscale set --exit-node=1.2.3.4
    no node found in netmap with IP 1.2.3.4

After:

    $ tailscale set --exit-node=1.2.3.4
    cannot use 1.2.3.4 as an exit node as it is a local IP address to this machine; did you mean --advertise-exit-node?

The new error message already existed in the code, but would only be
triggered if the backend wasn't running -- which means, in practice,
it would almost never be triggered.

The old error message is technically true, but could be confusing if you
don't know the distinction between "netmap" and "tailnet" -- it could
sound like the exit node isn't part of your tailnet. A node is never in
its own netmap, but it is part of your tailnet.

This error confused me when I was doing some local dev work, and it's
confused customers before (e.g. #7513). Using the more specific error
message should reduce confusion.

Updates #7513
Updates https://github.com/tailscale/corp/issues/23596

Signed-off-by: Alex Chan <alexc@tailscale.com>
2025-09-03 13:47:32 +01:00
Brad Fitzpatrick
d06d9007a6 ipn/ipnlocal: convert more tests to use policytest, de-global-ify
Now that we have policytest and the policyclient.Client interface, we
can de-global-ify many of the tests, letting them run concurrently
with each other, and just removing global variable complexity.

This does ~half of the LocalBackend ones.

Updates #16998

Change-Id: Iece754e1ef4e49744ccd967fa83629d0dca6f66a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-02 21:46:25 -07:00
Brad Fitzpatrick
21f21bd2a2 util/syspolicy: finish adding ts_omit_syspolicy build tags, tests
Fixes #16998
Updates #12614

Change-Id: Idf2b1657898111df4be31f356091b2376d0d7f0b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-02 18:09:16 -07:00
Brad Fitzpatrick
24b8a57b1e util/syspolicy/policytest: move policy test helper to its own package
Updates #16998
Updates #12614

Change-Id: I9fd27d653ebee547951705dc5597481e85b60747
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-02 17:03:26 -07:00
Brad Fitzpatrick
2b3e533048 util/syspolicy: finish plumbing policyclient, add feature/syspolicy, move global impl
This is step 4 of making syspolicy a build-time feature.

This adds a policyclient.Get() accessor to return the correct
implementation to use: either the real one, or the no-op one. (A third
type, a static one for testing, also exists, so in general a
policyclient.Client should be plumbed around and not always fetched
via policyclient.Get whenever possible, especially if tests need to use
alternate syspolicy)

Updates #16998
Updates #12614

Change-Id: Iaf19670744a596d5918acfa744f5db4564272978
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-02 16:42:25 -07:00
M. J. Fromberger
9e9bf13063
ipn/ipnlocal: revert some locking changes ahead of release branch cut (#17011) 2025-09-02 15:57:31 -07:00
Brad Fitzpatrick
0d23490e1a ipn/ipnlocal: simplify a test with a new simpler syspolicy client test type
Less indirection.

Updates #16998
Updates #12614

Change-Id: I5a3a3c3f3b195486b2731ec002d2532337b3d211
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-02 10:28:35 -07:00
Brad Fitzpatrick
1ca4ae598a ipn/ipnlocal: use policyclient.Client always, stop using global syspolicy funcs
Step 4 of N. See earlier commits in the series (via the issue) for the
plan.

This adds the missing methods to policyclient.Client and then uses it
everywhere in ipn/ipnlocal and locks it in with a new dep test.

Still plenty of users of the global syspolicy elsewhere in the tree,
but this is a lot of them.

Updates #16998
Updates #12614

Change-Id: I25b136539ae1eedbcba80124de842970db0ca314
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-09-02 10:28:35 -07:00