Commit Graph
4943 Commits
Author SHA1 Message Date
Kristoffer Dalby dc86639c00 types: reject non-boolean values for boolean settings 2026-10-27 21:32:34 +00:00
Kristoffer Dalby 48e6fc0c73 oidc: send the change from the user update in the callback 2026-10-27 21:32:34 +00:00
Kristoffer Dalby 12f6b6f10f state: refresh the NodeStore copies of a user in UpdateUser 2026-10-27 21:32:34 +00:00
Kristoffer Dalby 8014416648 types: drop a stored OIDC email the login no longer vouches for 2026-10-27 21:32:34 +00:00
Kristoffer Dalby 17c4778b30 state: write every user column in UpdateUser 2026-10-27 21:32:34 +00:00
Kristoffer Dalby d435721dc1 oidc: refuse logins whose subject the provider identifier would alter 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 837ec60e00 oidc: keep email_verified with the address it came with 2026-10-27 21:32:33 +00:00
Kristoffer Dalby be787616e7 state: announce a node online only after it was offline
A stream back within the reconnect grace sent peers an online patch,
a router's sent every node a policy response, and a relogin on
unchanged keys sent a key patch; nothing had changed.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 814c2109c3 change: do not echo a node's own report back to it
An endpoint or DERP report came back to the node as a self update;
SaaS sends it to the node's peers only.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 4ed4cb539a mapper: add device_id to the NextDNS query
SaaS sends the node's stable ID with the other device metadata.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby bb6da35417 policy/v2: warn once at load about malformed nextdns attrs
SaaS loads them and its resolver skips them, as headscale does, but the
mapper also logged a warning per node on every DNS build.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby edf448bf0d mapper: test that a hidden peer's policy change still sends filters 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 0cee52ebdb state, change: send a deleted node's removal only to its peers
The removal went to every node, also those the policy hid the node from.
The delete now returns the node's peers from the snapshot it replaces.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby b9886dbf18 mapper: stop an older initial map removing peers newer streams hold
AddNode diffed its map against tracking after sending it, when a newer
stream may have recorded its own; it now sends the node a full instead.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 52d1a8a191 mapper: bound how long one node can block a batcher worker
A node that drained slower than it was sent to held the worker for its
whole bundle; once its sends have waited 50ms, the rest waits a tick.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 8a80db4d28 mapper: send nothing while any stream awaits its initial map
Sent to the ready streams alone, a change counted as delivered and
never reached the new stream; the worker retries it once the map is out.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby c3d845cdf0 mapper: cap concurrent map sessions per node
A node chose how many map streams it held, each pinning a session.
The fifth replaces the oldest; same shape as #3468's mapper commit.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 8f21991adc change: coalesce policy recomputes that carry an origin node
The recompute render ignores the origin and always carries the node's
own entry, so a burst of tag writes cost every node one per write.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 9fb4ea34ab state: say a taken name is already taken 2026-10-27 21:32:33 +00:00
Kristoffer Dalby ece4ed281c db: succeed on a repeated revoke of an auth key
A repeated v2 DELETE of an auth key now answers 200, as Tailscale does.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 294c2ff5bd auth: answer a logout that deletes an ephemeral node as authorised 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 1059cc63a7 cli: show a node's own ephemeral flag instead of its key's 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 2820dba360 gen/client/v1: regenerate for the node ephemeral flag 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 458acd000e db, state: keep the ephemeral flag a node was created with
The flag moves from the key to the node, so a login with another key no
longer changes it. A user claiming a tagged node still clears it. v1
nodes carry the flag.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 4df99062de db, types: add a nodes column for the ephemeral flag
The migration fills it from the key each node references.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby f28cc6556e db: remove unused RenameNode 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 316a3c238e state: bump duplicate node names loaded from the database 2026-10-27 21:32:33 +00:00
Kristoffer Dalby f64a1f163d state: cut a label so its -N suffix fits in 63 bytes 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 6dc4745dc7 state: treat extra DNS record names as taken node names 2026-10-27 21:32:33 +00:00
Kristoffer Dalby c565a0b9cf state: save the name NodeStore picks for a new node
The row is committed before the name UPDATE, so a failed UPDATE still
returns the node and registration arms ephemeral cleanup.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 02e3e8ac7a db, api/v1: revoke rather than delete an ephemeral pre-auth key in use
The v1 list now hides revoked keys, so keys revoked through v2 also drop
out of `headscale preauthkeys list`.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby ef3576fa02 hscontrol: arm the ephemeral GC at pre-auth key registration 2026-10-27 21:32:33 +00:00
Kristoffer Dalby b0ac330175 hscontrol: skip garbage collecting a node that is no longer ephemeral 2026-10-27 21:32:33 +00:00
Kristoffer Dalby f06a75e3bb db: wrap the sequential IP allocator so freed addresses are reused 2026-10-27 21:32:33 +00:00
Kristoffer Dalby d21a7eb766 state: test that a persist racing a delete cannot resurrect the node
DeleteNode's early persistMu unlock is safe only while node persists
stay UPDATE-only; say so where the lock is declared.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 29e43eac1f db, state: let only the delete that removed a node free its addresses 2026-10-27 21:32:33 +00:00
Kristoffer Dalby 97351a392f state: drop registration locks once unused
The lock is taken before any credential check, so client-chosen machine
keys grew the map forever. Ref-count entries; delete at zero.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby d2749d9726 types, auth, noise: let one request wait on each auth session
One verdict per session, so one waiter: the newest. A displaced one
returns at once (register error, SSH re-delegate), not at session end.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 71150e7990 auth: check the follow-up's machine key before it waits
A session has one verdict; another machine holding the URL could take
it.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 62897a7f36 noise: stop serving metrics inside the tunnel
Any machine key reached it, bypassing metrics_listen_addr. No client
asks for it.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby f28192a9d4 noise: time out stalled bodies and idle tunnels
The hijack drops the outer server's deadlines; any machine key gets a
tunnel.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 0069b8dd38 hscontrol: bound client-chosen text in request logs
Clip at the sinks: handler errors, the request line, SSH local_user.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby bddc7ce44b auth, state: keep announced routes out of pending registrations
Routes are the one long list; the first MapRequest reports them.
A relogin keeps the node's own routes until then.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 717fa70da4 state: bound client reports of nodes loaded at startup
Rows stored before the bounds would still fan out unbounded endpoints.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby c0f1f48483 types, noise: bound the Hostinfo and endpoints a client reports
Cut lists and hostname at decode, refuse >64 KiB of non-route Hostinfo.
The body limit counted wire bytes, not what the cache, NodeStore and
peers keep.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 11cff1da0b mapper: show an expired peer online, without endpoints or DERP
A connected expired node shows online to its peers. Neither its map
entry nor endpoint, DERP or disco patches carry the paths to reach it.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby b67228a31a mapper: trim the Hostinfo sent to peers and to the node itself
As on Tailscale SaaS, the node's own entry keeps Hostname, RequestTags,
RoutableIPs and Services; peers get Hostname, OS, Services without
peerapi-dns-proxy, SSH host keys and AppConnector, and resend on those.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 0fdbe12e9e mapper: keep an expired node authorised in its own entry
Tailscale SaaS sends an expired node MachineAuthorized and no Expired
flag; its past KeyExpiry already moves the client to NeedsLogin.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 92b0acb322 hscontrol: refuse a key expiry that cannot be encoded
handleRegister, the OIDC auth path and SetNodeExpiry refuse it. Expiries
are stored in UTC, which SQLite can read back, and loaded in UTC, as
PostgreSQL returns the server's zone. The v1 API answers 400.
2026-10-27 21:32:33 +00:00
Kristoffer Dalby 36bb3ccb25 mapper: skip peers whose key expiry cannot be encoded
json.Marshal refuses a year outside [0,9999], so one stored expiry
failed every map with that node. TailNode and key patches send UTC, the
builder drops what fails and the boot scan names the node.
2026-10-27 21:32:33 +00:00