Commit Graph
8764 Commits
Author SHA1 Message Date
Fran Bull 69f76641ac auth getstatus max 1/s 2025-02-27 07:31:30 -08:00
Fran Bull ae30f58b46 centralize cmd http auth 2025-02-27 05:15:49 -08:00
Fran Bull 5afa742b06 unnecessary export 2025-02-26 15:03:37 -08:00
Fran Bull c35c3d1194 use a views.Slice 2025-02-26 14:45:44 -08:00
Fran Bull 66ecab9540 use a set for authorization, test it 2025-02-26 14:09:24 -08:00
Fran Bull f63ce0066d comment use of mutex 2025-02-26 09:36:20 -08:00
Fran Bull 9d65e1fc22 use status code constants, and the right ones 2025-02-26 09:34:13 -08:00
Fran Bull 2d2b954006 no need to defer 2025-02-26 09:26:39 -08:00
Fran Bull 5e15c25937 no need for a blank return at the end 2025-02-26 09:25:36 -08:00
Fran Bull f7ec770f03 use new encoder, not marshalindent 2025-02-26 09:10:10 -08:00
Fran Bull 3a35ac716d only serve debug monitor if asked for 2025-02-26 09:04:51 -08:00
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