Commit Graph

4437 Commits

Author SHA1 Message Date
Igor Bernstein efe947507b templates: apply the tvOS setup reorder to the served /apple page
The instructions are duplicated between the docs and the HTML page
headscale serves at /apple. Reorder the tvOS steps there to match, so
the VPN configuration is installed before the alternate coordination
server URL is set.
2026-08-29 18:18:35 +02:00
igorbernstein fad937c062 Update AppleTV configuration steps
The instructions didn't work for tvOS 26.6 / Tailscale 1.102.2. When the `ALTERNATE COORDINATION SERVER URL` is set, the `Install VPN Configuration` breaks. 
Clicking does nothing and the tvOS app logs showed `addUser: backendManager does not exist`.

Instead I first started tailscale and installed the vpn profile and then add the headscale url and then signed. Which seemed to have worked
2026-08-29 18:18:35 +02:00
Paulo Luna 63ce8f2295 fix(metrics): collect metrics for non-OPTIONS requests
Fix the inverted HTTP metrics skip condition, which caused the collector to ignore all requests except OPTIONS.

Apply the correction to both the main and Noise routers so regular HTTP traffic is included in http_requests_total and http_request_duration_seconds.
2026-08-28 13:13:48 +02:00
Kristoffer Dalby 63123196cc all: inline deprecated tailcfg capability aliases
go 1.27 vet reports the //go:fix inline directives tailscale added to
the tailcfg cap aliases; applied with `go fix -inline ./...`.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 77cd81fe33 flakehashes: refresh for the tailscale.com bump 2026-08-25 21:59:00 +02:00
Simon Law 3aece65014 build: update tailscale.com to v1.103.0-pre.0.20260819232550-0e84b4a3a0a0
PR tailscale/tailscale#20646 changed the representation of DERP region
IDs from plain ints to a tailcfg.DERPRegionID type. This patch
requires that version of the tailscale.com library and updates our
code to also use the new type.

Updates: tailscale/tailscale#20165
(cherry picked from commit 79695ab51b)
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 9ceb4511de go.mod: set the lockstep notes off from the sorted requires
go 1.27 tidy folds every require into one direct and one indirect
block; a leading blank line is the only separation it keeps.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 820dc3001b flake: build Go-parsing tools with the project's Go
goimports, gotools' goimports wrapper and golangci-lint-langserver were
on the nixpkgs default Go, whose parser rejects generic methods.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 941fd9ff4e CHANGELOG: minimum client version is v1.82.0 2026-08-25 21:59:00 +02:00
Kristoffer Dalby 7e12e46f63 capver: regenerate for Tailscale v1.102 2026-08-25 21:59:00 +02:00
Kristoffer Dalby fd51ec70f0 capver: sort minor versions numerically
Lexicographic order put v1.102 before v1.24, so the newest release fell
outside the supported window and the minimum never moved.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby d7c1ecce92 mapper: correct the send timer rationale
time.After has been GC-recoverable since Go 1.23, so the leak the comment
described cannot happen and the test asserting it proved nothing.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 635bda9139 hi: compare the stream error with errors.Is 2026-08-25 21:59:00 +02:00
Kristoffer Dalby 0a4d56494f hscontrol: drop the net/http/pprof import
Nothing serves DefaultServeMux; the debug mux already exposes every
profile through tsweb.Debugger.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 1994f50fe8 policy/v2: drop elided struct types in test users
Promoted field keys let the literals skip the embedded gorm.Model.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 93e29ec38d all: use strings.CutLast
Replaces LastIndex plus slice arithmetic when splitting on the last
separator.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 373c60efe3 all: use sync.WaitGroup.Go
Drops the Add/Done bookkeeping, which in batcher.go was spread across
three functions.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 245b81401c integration: make debugJSON and execJSON methods
Go 1.27 allows type parameters on methods, so the container no longer has
to be passed as the first argument.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 60bab7633c golangci-lint: disable canonicalheader
canonicalheader v1.1.2 nil-derefs on a package that has both a generic
method and an http.Header.Set call, which aborts the whole lint run.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 1c6809089f hscontrol: use the stdlib uuid package
Go 1.27 ships RFC 9562 UUIDs and NewV4 cannot fail, dropping gofrs/uuid
and two error paths.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 9f7d829aa5 go.mod: adopt the require layout Go 1.27 tidy produces
Go 1.27 collapses requires into one direct and one indirect block, so the
modernc lockstep note has to live inside a block to survive tidy.
-compat=1.27 is a no-op now that the go directive is 1.27.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby cbbfe613b8 flake: skip comments in go-mod-update-all
Comment lines inside a require block are tab-indented, so the scrape fed
`//` tokens to go get -u.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 0c0b0c68a6 derp: drop deprecated DERPRegion.Avoid
Zero value, superseded by NoMeasureNoHome.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 77caa94400 policy/v2: use value receiver for SSHCheckPeriod.Validate
recvcheck ignores UnmarshalJSON, so the pointer receiver here was the
odd one out against value-receiver MarshalJSON. Validate only reads.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 2c76d5c5b7 all: apply golangci-lint autofixes
Go 1.27 allows setting promoted fields of embedded structs directly in
composite literals, so gorm.Model wrappers go away. Plus strings.Cut,
errors.AsType, reflect.TypeAssert and one gofumpt nit.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 2b64b9fe3a .golangci.yaml: disable exhaustruct_v5
Renamed linter, same 50 findings as the disabled exhaustruct.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby f06ff1cf81 all: build with Go 1.27
Bump every remaining toolchain reference: images, goreleaser, the hi
runner fallback and docs.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby d4d09bc024 all: update dependencies
tailscale.com v1.103.0-pre drops the "format" struct tags that Go 1.27's
finalized encoding/json/v2 rejects; without it MapResponse marshaling
fails for any tailnet with an SSH policy.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 07b5344145 flake: track latest Go in nixpkgs
Use buildGoLatestModule and go_latest so a Go release bump is a
flake.lock update, not a flake.nix edit. Drop the vendored
golangci-lint derivation, now current in nixpkgs.
2026-08-25 21:59:00 +02:00
Kristoffer Dalby 5e804240ed nix: move off deprecated stdenv.is* aliases 2026-08-25 07:49:31 +02:00
Michał Wadas f02a027d91 ci: add source metadata to container images 2026-08-24 13:46:10 +02:00
Juan Font 7b24135b1a Add AI policy
Add AI_POLICY.md (adapted from uv's AI policy) and link to it from
README and CONTRIBUTING.
2026-08-24 13:42:32 +02:00
Kristoffer Dalby 565fd254d0 mkdocs: bump version
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2026-07-29 11:03:23 +02:00
Kristoffer Dalby 8bb26c5967 CHANGELOG: add 0.29.3
Updates #3385
2026-07-29 11:03:23 +02:00
Kristoffer Dalby d28a6b111a hscontrol: prefer completed auth over expired ctx in followup wait
waitForFollowup selected on ctx.Done() and the verdict channel with equal
priority; when both were ready, select picked at random and discarded a
successful registration as a spurious 401 timeout. Check for a completed
verdict first, race the deadline only if none is ready.

Fixes #3385
2026-07-29 11:03:23 +02:00
Simon Law 54a2746f55 Makefile: enable CGO for make test in dev shell
Fixes #3401

Signed-off-by: Simon Law <sfllaw@tailscale.com>
2026-07-28 21:01:56 +02:00
Igor Serganov cfd845cb53 poll: do not cancel ephemeral GC until Connect succeeds
With node.ephemeral.inactivity_timeout set, ephemeral nodes are
usually deleted after they go offline, but under reconnect churn some
departed nodes stayed in the node list as disconnected indefinitely
until removed manually or until Headscale restarted.

Ephemeral cleanup is timer-based via EphemeralGarbageCollector, not a
periodic LastSeen scan. serveLongPoll cancelled any pending GC timer
at the very start of a long-poll attempt and only rescheduled on a
clean disconnect after Connect. If a reconnect cancelled the timer and
then failed before Connect (for example an UpdateNodeFromMapRequest
error), the deferred cleanup saw connectGen == 0 and returned without
Schedule. The node remained offline with no deletion timer and no
reconciler to recover it.

Cancel the ephemeral GC timer only after a successful Connect, so a
failed reconnect leaves an already-armed inactivity timer intact.
Successful reconnects still cancel GC once the node is online, and a
later disconnect reschedules as before.

Add TestFailedReconnectDoesNotCancelEphemeralGC to lock in the
ordering, plus IsScheduled and DeleteNodeFromStoreForTest helpers for
the test.

Fixes #3382

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 12:28:00 +02:00
Fredrik Ekre dc3c0bc587 cli: remove leftover trace log from #3324 that always renders a JSON marshaling error
Noticed this while testing out #3394.
2026-07-28 12:27:10 +02:00
Kristoffer Dalby 6275e3a356 policy,state: authorize reauth tags against the authenticating user
Re-authenticating a tagged node with --advertise-tags checked the tag-owned
node, not the authenticating user, so every tag was rejected.

Fixes #3374
2026-07-28 11:55:17 +02:00
Kristoffer Dalby fc16cc6905 state: apply a new pre-auth key's tags on re-registration
Re-registering a tagged node with a different key discarded the new key's
tags and left a stale auth-key reference; retag on key change and persist it.

Fixes #3370
2026-07-28 11:55:17 +02:00
Kristoffer Dalby 1ed5693fa4 state: do not expire tagged nodes on logout
Tagged nodes never expire, but handleLogout stamped a past expiry on them,
leaving them stuck expired and unable to re-authenticate.

Fixes #3371
2026-07-28 11:55:17 +02:00
Kristoffer Dalby 5b6e1e17be hscontrol: gate /key on supported capability version
/key handed out the Noise public key for any v>=39, a floor unrelated
to the handshake's capver.MinSupportedCapabilityVersion. Reject below
the supported floor, matching /ts2021, and drop the stale constant.

Fixes #3380
2026-07-28 11:54:46 +02:00
Arpit Jain 0ce3356b89 auth: check machine key on the followup registration path
waitForFollowup returns nodeToRegisterResponse for a completed
registration without checking that the Noise session polling for the
result was started with the machine key that opened the registration.
That response carries the registering user's User and Login, so the auth
ID in the followup URL is the only thing protecting it.

handleRegister and handleLogout both call machineKeyMismatch before
handing back a node, so this is the one path of the three that does not.
The key is already available: HandleNodeFromAuthPath resolves the node
from the MachineKey cached in RegistrationData, so on the normal path the
node and the session agree and the check is a no-op.

The auth ID is 96 bits of randomness and is not guessable, so this is not
reachable by brute force. It is logged at info level when a registration
is created, which makes log access the realistic way to obtain one.

The existing followup_registration_success case built its node with
CreateNodeForTest, which picks a random machine key that no real
registration would produce. Set the registering machine key so the
fixture matches the production path.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
2026-07-28 11:51:50 +02:00
Florian Preinstorfer 7a1ee34f71 Explicitly select lunr as search provider
Keep the existing search provider instead (and the separator) option.
2026-07-24 21:28:27 +02:00
Kristoffer Dalby f20f1f1278 ci: bump Mic92/hestia to v2.0.0
Point the action at the repo root, which is the canonical entry point
in v2; the /action subpath is now a deprecated shim.

Closes #3356
2026-07-21 13:28:35 +02:00
Kristoffer Dalby 8eec2dbdc2 build: bump Go toolchain to 1.26.5
Tailscale HEAD go.mod now requires go >= 1.26.5; build images pinned
1.26.4. Bump go.mod, the four Go Dockerfiles, and the nixpkgs pin
(staging-next-26.05 ships go_1_26 1.26.5; unstable still lags).
2026-07-20 12:27:47 +02:00
alaningtrump 048308511c chore: fix function comment to match actual function name
Signed-off-by: alaningtrump <alaningtrump@outlook.com>
2026-07-03 07:27:08 +02:00
Kristoffer Dalby a84945f134 CHANGELOG: shorten 0.29.2 invalid-name entry, set date
Updates #3346
2026-07-01 16:23:24 +02:00
Kristoffer Dalby fef80f3eb0 CHANGELOG: note /ts2021 WebSocket GET fix
Updates #3357
backup/release-v0.29.2-orig
2026-07-01 15:20:01 +02:00
Kristoffer Dalby 01ef350d5f integration: add TS2021 WebSocket tests to CI matrix
Generated by gh-action-integration-generator.

Updates #3357
2026-07-01 15:20:01 +02:00