Commit Graph
8753 Commits
Author SHA1 Message Date
Fran Bull e13b8c271b log errors don't return to http client 2025-02-26 08:38:08 -08:00
Fran Bull e0415e0221 use dnsname instead of strings split 2025-02-26 08:29:51 -08:00
Fran Bull febe30ea68 error auth refresh if server not running 2025-02-26 08:29:13 -08:00
Fran Bull 5fa145674d make tests pass under -race 2025-02-25 14:57:50 -08:00
Fran Bull 8dfb749ea5 missed a direct events access 2025-02-24 12:01:15 -08:00
Fran Bull 773894638c lint says conn can't be nil 2025-02-24 11:55:45 -08:00
Fran Bull 0b971dffd3 configure logging 2025-02-24 11:41:53 -08:00
Fran Bull f0223a9dba avoid race 2025-02-24 10:38:21 -08:00
Fran Bull 3ed0736ae9 protect nil pointer 2025-02-24 10:29:05 -08:00
Fran Bull 05277e020e move package doc to right place 2025-02-24 08:45:10 -08:00
Fran Bull e623e1d2d9 go mod tidy 2025-02-24 08:30:45 -08:00
Fran Bull aee5b38001 use httpm i guess? 2025-02-21 13:38:53 -08:00
Fran Bull 89af057be5 add copyright headers 2025-02-21 13:10:59 -08:00
Fran Bull d944cd1778 do we need to wait longer? 2025-02-21 13:07:41 -08:00
Fran Bull 0354836398 don't actually need those bits for the interface 2025-02-21 13:06:07 -08:00
Fran Bull 4040e14cb8 use the error value 2025-02-21 13:02:05 -08:00
Fran Bull 82e6b2508a fix test 2025-02-21 12:34:53 -08:00
Fran Bull a828917152 allow concurrent usage of authorization 2025-02-21 11:24:00 -08:00
Fran Bull d593a85bae comments, whitespace 2025-02-21 11:23:22 -08:00
Fran Bull 7c539e3d2f to squash: restrict communication to tagged nodes 2025-02-20 15:14:22 -08:00
Fran Bull 6ebb0c749d tsconsensus: add a tsconsensus package
tsconsensus enables tsnet.Server instances to form a consensus.

tsconsensus wraps hashicorp/raft with
 * the ability to do discovery via tailscale tags
 * inter node communication over tailscale
 * routing of commands to the leader

Updates #14667

Signed-off-by: Fran Bull <[email protected]>
2025-02-20 11:12:17 -08:00
Erisa A 074372d6c5 scripts/installer.sh: add SparkyLinux as a Debian derivative (#15076)
Fixes #15075

Signed-off-by: Erisa A <[email protected]>
2025-02-20 18:22:08 +00:00
Andrew Lytvynov 2c3338c46b client/tailscale: fix Client.BuildURL and Client.BuildTailnetURL (#15064)
This method uses `path.Join` to build the URL. Turns out with 1.24 this
started stripping consecutive "/" characters, so "http://..." in baseURL
becomes "http:/...".

Also, `c.Tailnet` is a function that returns `c.tailnet`. Using it as a
path element would encode as a pointer instead of the tailnet name.

Finally, provide a way to prevent escaping of path elements e.g. for `?`
in `acl?details=1`.

Updates #15015

Signed-off-by: Andrew Lytvynov <[email protected]>
2025-02-19 17:19:54 -08:00
836c01258d go.toolchain.branch: update to Go 1.24 (#15016)
* go.toolchain.branch: update to Go 1.24

Updates #15015

Change-Id: I29c934ec17e60c3ac3264f30fbbe68fc21422f4d
Signed-off-by: Brad Fitzpatrick <[email protected]>

* cmd/testwrapper: fix for go1.24

Updates #15015

Signed-off-by: Paul Scott <[email protected]>

* go.mod,Dockerfile: bump to Go 1.24

Also bump golangci-lint to a version that was built with 1.24

Updates #15015

Signed-off-by: Andrew Lytvynov <[email protected]>

---------

Signed-off-by: Brad Fitzpatrick <[email protected]>
Signed-off-by: Paul Scott <[email protected]>
Signed-off-by: Andrew Lytvynov <[email protected]>
Co-authored-by: Paul Scott <[email protected]>
Co-authored-by: Andrew Lytvynov <[email protected]>
2025-02-19 10:55:49 -08:00
Andrew Lytvynov cc923713f6 tempfork/acme: pull in latest changes for Go 1.24 (#15062)
https://github.com/tailscale/golang-x-crypto/commit/9a281fd8facad954dae80ef984c5d5d763f8ff91

Updates #15015

Signed-off-by: Andrew Lytvynov <[email protected]>
2025-02-19 10:42:06 -08:00
Andrew Lytvynov 323747c3e0 various: disable MPTCP when setting TCP_USER_TIMEOUT sockopt (#15063)
There's nothing about it on
https://github.com/multipath-tcp/mptcp_net-next/issues/ but empirically
MPTCP doesn't support this option on awly's kernel 6.13.2 and in GitHub
actions.

Updates #15015

Signed-off-by: Andrew Lytvynov <[email protected]>
2025-02-19 10:41:45 -08:00
Nick Khyl 09982e1918 ipn/ipnlocal: reset always-on override and apply policy settings on start
We already reset the always-on override flag when switching profiles and in a few other cases.
In this PR, we update (*LocalBackend).Start() to reset it as well. This is necessary to support
scenarios where Start() is called explicitly, such as when the GUI starts or when tailscale up is used
with additional flags and passes prefs via ipn.Options in a call to Start() rather than via EditPrefs.

Additionally, we update it to apply policy settings to the current prefs, which is necessary
for properly overriding prefs specified in ipn.Options.

Updates #14823

Signed-off-by: Nick Khyl <[email protected]>
2025-02-18 16:49:25 -06:00
Percy Wegmann 1f1a26776b client/tailscale,cmd/k8s-operator,internal/client/tailscale: move VIP service client methods into internal control client
Updates tailscale/corp#22748

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 16:25:17 -06:00
Percy Wegmann 9c731b848b cmd/gitops-pusher: log error details when unable to fetch ACL ETag
This will help debug unexpected issues encountered by consumers of the gitops-pusher.

Updates tailscale/corp#26664

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 14:29:14 -06:00
Andrew LytvynovandIrbe Krumina ec5f04b274 appc: fix a deadlock in route advertisements (#15031)
`routeAdvertiser` is the `iplocal.LocalBackend`. Calls to
`Advertise/UnadvertiseRoute` end up calling `EditPrefs` which in turn
calls `authReconfig` which finally calls `readvertiseAppConnectorRoutes`
which calls `AppConnector.DomainRoutes` and gets stuck on a mutex that
was already held when `routeAdvertiser` was called.

Make all calls to `routeAdvertiser` in `app.AppConnector` go through the
execqueue instead as a short-term fix.

Updates tailscale/corp#25965

Signed-off-by: Andrew Lytvynov <[email protected]>
Co-authored-by: Irbe Krumina <[email protected]>
2025-02-18 11:31:14 -08:00
Percy Wegmann 052eefbcce tsnet: require I_Acknowledge_This_API_Is_Experimental to use AuthenticatedAPITransport()
It's not entirely clear whether this capability will be maintained, or in what form,
so this serves as a warning to that effect.

Updates tailscale/corp#22748

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 10:23:04 -06:00
Percy Wegmann 9ae9de469a internal/client/tailscale: change Client from alias into wrapper
This will allow Client to be extended with additional functions for internal use.

Updates tailscale/corp#22748

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 10:23:04 -06:00
Percy Wegmann 8a792ab540 tsnet: provide AuthenticatedAPITransport for use with tailscale.com/client/tailscale/v2
This allows use of the officially supported control server API,
authenticated with the tsnet node's nodekey.

Updates tailscale/corp#22748

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 10:23:04 -06:00
Percy Wegmann 4f0222388a cmd,tsnet,internal/client: create internal shim to deprecated control plane API
Even after we remove the deprecated API, we will want to maintain a minimal
API for internal use, in order to avoid importing the external
tailscale.com/client/tailscale/v2 package. This shim exposes only the necessary
parts of the deprecated API for internal use, which gains us the following:

1. It removes deprecation warnings for internal use of the API.
2. It gives us an inventory of which parts we will want to keep for internal use.

Updates tailscale/corp#22748

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 10:23:04 -06:00
Percy Wegmann d923979e65 client/tailscale: mark control API client deprecated
The official client for 3rd party use is at tailscale.com/client/tailscale/v2.

Updates #22748

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-18 10:23:04 -06:00
Brad Fitzpatrick cbf3852b5d cmd/testwrapper: temporarily remove test coverage support
testwrapper doesn't work with Go 1.24 and the coverage support is
making it harder to debug.

Updates #15015
Updates tailscale/corp#26659

Change-Id: I0125e881d08c92f1ecef88b57344f6bbb571b569
Signed-off-by: Brad Fitzpatrick <[email protected]>
2025-02-17 09:51:23 -08:00
Irbe Krumina b21eec7621 ipn/ipnlocal,tailcfg: don't send WireIngress if IngressEnabled already true (#14960)
Hostinfo.WireIngress is used as a hint that the node intends to use
funnel. We now send another field, IngressEnabled, in cases where
funnel is explicitly enabled, and the logic control-side has
been changed to look at IngressEnabled as well as WireIngress in all
cases where previously the hint was used - so we can now stop sending
WireIngress when IngressEnabled is true to save some bandwidth.

Updates tailscale/tailscale#11572
Updates tailscale/corp#25931

Signed-off-by: Irbe Krumina <[email protected]>
2025-02-16 09:38:02 +00:00
James Tucker 606f7ef2c6 net/netcheck: remove unnecessary custom map clone function
Updates #8419
Updates #cleanup

Signed-off-by: James Tucker <[email protected]>
2025-02-14 18:56:10 -08:00
Nick Khyl 6df5c8f32e various: keep tailscale connected when Always On mode is enabled on Windows
In this PR, we enable the registration of LocalBackend extensions to exclude code specific to certain
platforms or environments. We then introduce desktopSessionsExt, which is included only in Windows builds
and only if the ts_omit_desktop_sessions tag is disabled for the build. This extension tracks desktop sessions
and switches to (or remains on) the appropriate profile when a user signs in or out, locks their screen,
or disconnects a remote session.

As desktopSessionsExt requires an ipn/desktop.SessionManager, we register it with tsd.System
for the tailscaled subprocess on Windows.

We also fix a bug in the sessionWatcher implementation where it attempts to close a nil channel on stop.

Updates #14823
Updates tailscale/corp#26247

Signed-off-by: Nick Khyl <[email protected]>
2025-02-14 16:40:54 -06:00
Irbe Krumina e11ff28443 cmd/k8s-operator: allow to optionally configure an HTTP endpoint for the HA Ingress (#14986)
Updates tailscale/corp#24795

Signed-off-by: Irbe Krumina <[email protected]>
2025-02-14 18:07:17 +00:00
James Sanderson 45f29a208a control/controlclient,tailcfg:types: remove MaxKeyduration from NetMap
This reverts most of 124dc10261 (#10401).

Removing in favour of adding this in CapMaps instead (#14829).

Updates tailscale/corp#16016

Signed-off-by: James Sanderson <[email protected]>
2025-02-14 18:06:23 +00:00
James Sanderson 717fa68f3a tailcfg: read max key duration from node cap map [capver 114]
This will be used by clients to make better decisions on when to warn users
about impending key expiry.

Updates tailscale/corp#16016

Signed-off-by: James Sanderson <[email protected]>
2025-02-14 18:06:23 +00:00
kari-ts 4c3c04a413 ipn, tailscale/cli: add TaildropTargetStatus and remove race with FileTargets (#15017)
Introduce new TaildropTargetStatus in PeerStatus
Refactor getTargetStableID to solely rely on Status() instead of calling FileTargets(). This removes a possible race condition between the two calls and provides more detailed failure information if a peer can't receive files.

Updates tailscale/tailscale#14393

Signed-off-by: kari-ts <[email protected]>
2025-02-14 09:56:50 -08:00
James 'zofrex' Sanderson e142571397 ipn/ipnlocal: add GetFilterForTest (#15025)
Needed to test full packet filter in e2e tests. See tailscale/corp#26596

Updates tailscale/corp#20514

Signed-off-by: James Sanderson <[email protected]>
2025-02-14 15:25:48 +00:00
Joe Tsai 1d035db4df types/bools: fix doc typo (#15021)
The Select function was renamed as IfElse.

Updates #cleanup

Signed-off-by: Joe Tsai <[email protected]>
2025-02-13 16:12:00 -08:00
Percy Wegmann db231107a2 ssh/tailssh: accept passwords and public keys
Some clients don't request 'none' authentication. Instead, they immediately supply
a password or public key. This change allows them to do so, but ignores the supplied
credentials and authenticates using Tailscale instead.

Updates #14922

Signed-off-by: Percy Wegmann <[email protected]>
2025-02-13 11:29:45 -06:00
James Tucker f2f7fd12eb go.mod: bump bart
Bart has had some substantial improvements in internal representation,
update functions, and other optimizations to reduce memory usage and
improve runtime performance.

Updates tailscale/corp#26353

Signed-off-by: James Tucker <[email protected]>
2025-02-12 17:52:33 -08:00
Nick Khyl 7aef4fd44d ipn/ipn{local,server}: extract logic that determines the "best" Tailscale profile to use
In this PR, we further refactor LocalBackend and Unattended Mode to extract the logic that determines
which profile should be used at the time of the check, such as when a LocalAPI client connects or disconnects.
We then update (*LocalBackend).switchProfileLockedOnEntry to to switch to the profile returned by
(*LocalBackend).resolveBestProfileLocked() rather than to the caller-specified specified profile, and rename it
to switchToBestProfileLockedOnEntry.

This is done in preparation for updating (*LocalBackend).getBackgroundProfileIDLocked to support Always-On
mode by determining which profile to use based on which users, if any, are currently logged in and have an active
foreground desktop session.

Updates #14823
Updates tailscale/corp#26247

Signed-off-by: Nick Khyl <[email protected]>
2025-02-12 19:06:40 -06:00
Brad Fitzpatrick b7f508fccf Revert "control/controlclient: delete unreferenced mapSession UserProfiles"
This reverts commit 413fb5b933.

See long story in #14992

Updates #14992
Updates tailscale/corp#26058

Change-Id: I3de7d080443efe47cbf281ea20887a3caf202488
Signed-off-by: Brad Fitzpatrick <[email protected]>
2025-02-11 14:53:04 -08:00
Nick Khyl 01efddea01 docs/windows/policy: update ADMX/ADML policy definitions to include the new Always On setting
This adds a new policy definition for the AlwaysOn.Enabled policy setting
as well as the AlwaysOn.OverrideWithReason sub-option.

Updates #14823
Updates tailscale/corp#26247

Signed-off-by: Nick Khyl <[email protected]>
2025-02-11 16:17:37 -06:00