Kristoffer Dalby
dea3af085e
policy/v2: build filter merge keys once per compile
...
Per-node merging joined every rule's SrcIPs again for every node.
via-members, 5000 nodes: 26.9 -> 2.3 ms, 51 -> 1.2 MB per pass.
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
d929eb6a40
policy/v2: benchmark member-to-member and via-from-members shapes
...
Both grow with the tailnet once node addresses are listed one by one.
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
5bcbb73f68
policy/v2: write filter rules as Tailscale does
...
Each alias written on its own: node addresses one by one, internet as
ranges. Via rules merge only with via rules; exit nodes get every
user's self rules in user order. Drops 63 FILTER_ADDRESS_FORM,
SELF_DST_REPEAT and VIA_RULE_MERGED skips.
Updates #3562
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
137a66d59c
policy/v2: build matchers once per compiled rule
...
Per-node matchers reuse the global ones and parse only self and via
rules, instead of every rule for every node.
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
31b78b77ad
policy/v2, servertest: record how SaaS groups filter rules
...
v105/v108: grant and ACL with one source; v106: rule order;
v107: two via grants through one router.
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
1b53713e05
CHANGELOG: name the via exit fix #3566 still makes
...
Updates #3562
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
06d2c0aa91
policy/v2, servertest: record via exit grants beside other rules
...
v93-v97: one member in two via exit grants. v98: a capability grant
to "*" beside one; main drops its exit routes, SaaS keeps them.
Updates #3562
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
56b5d2286c
servertest: require both exit routes and hide an unnamed exit node
...
Use the shared route helpers, so a failed announcement fails the test.
Updates #3562
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
fc10729278
policy/v2: pin exit routes out of UsePrimary
...
Exit routes have no HA election; UsePrimary could only drop them.
Updates #3562
2026-11-05 12:32:04 +01:00
mineiwik
6a1f8d1579
policy/v2: keep via exit routes when two via grants match a viewer
2026-11-05 12:32:04 +01:00
Kristoffer Dalby
5651bf4c5c
hscontrol: leave reverse DNS for the Tailscale ranges to the client
...
SaaS sends no reverse routes for any ipPool; clients from v1.84 add
them for 100.64.0.0/10 and fd7a:115c:a1e0::/48 themselves.
Updates #3482
2026-11-04 16:25:09 +01:00
Kristoffer Dalby
8df88e8dc1
policy/v2: add SaaS captures of MagicDNS reverse routes per ipPool
...
Captured with tscap f055502.
Updates #3482
2026-11-04 16:25:09 +01:00
Kristoffer Dalby
aa3356910a
util: mask the prefix and cover /0 in GenerateIPv4DNSRootDomain
...
Host bits shifted the range: 100.65.0.0/10 gave 65..128.
Updates #3482
2026-11-04 16:25:09 +01:00
Michael Gooden
8f49f4713d
CHANGELOG: Note the octet-aligned MagicDNS search domain generation fix
...
Updates #3482
2026-11-04 16:25:09 +01:00
Michael Gooden
16e6dd370e
Generate a single PTR for octet-aligned subnets
2026-11-04 16:25:09 +01:00
Michael Gooden
70c68bee01
Add tests for octet-aligned and -unaligned PTR generation
2026-11-04 16:25:09 +01:00
Kristoffer Dalby
9bed1e0353
CHANGELOG: note the SaaS compatibility fixes
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
50a6823ffb
api/v2: serve policies and errors with SaaS's content types
...
A JSON read of a commented policy held comments, so JSON clients failed on
it. Errors say application/json, and a policy write answers as HuJSON.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
be1010c9de
gen/client/v2: regenerate for the expire route
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
73a2ca9377
api/v2: add POST /device/{id}/expire
...
SaaS has it, and the replays went round its absence. Same effect as the v1 route.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
4f6a727e93
gen/client/v2: regenerate for routeSelection
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
88f90d040d
api/v2: report routeSelection in tailnet settings
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
b9f12abf02
gen/client/v2: regenerate for the device host detail
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
7063c04581
api/v2: add device shields-up, SSH, distro and connectivity fields
...
Same read shapes as SaaS. Latency stays empty: headscale drops it on arrival.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
9ba1c5e5e2
gen/client/v2: regenerate for connectedToControl and lastSeen
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
f1788c1ce4
api/v2: send connectedToControl and lastSeen on connected devices
...
SaaS sends both on every device. The SDK reported live devices as
disconnected, and tscli delete devices panicked on the missing lastSeen.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
9841280d11
api/v2: use SaaS's text for an unknown device
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
e99d8f3f88
api/v2: list devices sorted by name
...
SaaS sorts by name. NodeStore order moved on every write, so
order-sensitive Terraform configs showed changes.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
88339d8ff1
servertest: pin the refusal of a policy naming autogroup:admin
...
The replay rewrites the autogroup away, so nothing showed this difference.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
1bce65a236
policy/v2: name ssh-behavior-v1 a deliberate difference
...
SaaS stamps it on every node. Sending it would change existing users' login
environment, so it stays a nodeAttr. Document that and pin it.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
39a42e9d01
policy/v2: refuse autogroup:member as a test source
...
As SaaS: unknown user or host. A policy that passed here failed on SaaS.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
98b3900470
policy/v2: resolve user:*@domain to that domain's users
...
SaaS accepts it and lists those users' nodes. It was accepted here too,
then compiled to nothing with no log line.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
6647cb2e05
policy/v2: map no numeric email local part to a login
...
The client looks a numeric login up as a UID, so 0@domain reached root
under a localpart rule, and another number someone else's account.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
f786ae33cd
state: send the whole node when a relogin removes a key expiry
...
A patch omits a zero expiry, so peers kept the old one and would cut the
node off when it passed.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
868998a81b
state: let a node's name follow a new hostname at login
...
As SaaS. It stayed old, and the mismatch then read as an admin-set name,
which stopped later hostname changes from renaming the node too.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
197895be2c
auth: refuse requested tags with SaaS's bare text
...
Clients show it as it is, and it carried an internal prefix.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
4ec3f3c161
auth: do not register a deleted device on its logout
...
A client sends its auth key with a logout. The past expiry only logged,
then the key made a new offline node that peers could see.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
65ccbdeea2
poll: tell peers a node left after 15 seconds, not 10
...
As SaaS. A router outage of 10 to 15 seconds moved the HA primary for good,
and status flapped. A real crash now fails over 5 seconds later, as on SaaS.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
672aa40158
state: move an offline router's routes in one frame
...
As SaaS. A peer held an offline primary between two frames: the patch, then
the recompute, which carries the offline state anyway.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
c2b4c97ce1
mapper: send no frame when stripping leaves nothing new
...
Stripping an unchanged Node and SSHPolicy per stream could leave a frame
with only ControlTime, which SaaS never sends.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
2d094f2243
state: send nothing for a policy write that changes nothing
...
As SaaS. Every accepted write sent all nodes a map and cleared SSH check
approvals, so a tool that re-posts the same file prompted users again.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
93aef86908
mapper: give a tagged node its own user in its own entry
...
As SaaS. Clients take a peer with their own user ID for a device of the same
owner, so every tagged peer was a file target and could read debug endpoints.
Updates #2462 , #2970
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
490305417c
policy/v2: make a user's own devices peers under any policy
...
As SaaS. Without the peer, sending a file to your own device failed
with 404 under a restrictive policy. The packet filter is unchanged.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
420293cecf
policy/v2: keep withdrawn approved routes in wildcard sources
...
As SaaS, which holds them until an admin removes the approval.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
d2a85b1d16
policy/v2: compile a policy without rules as explicit allow-all
...
As SaaS, sources are the tailnet ranges and approved routes. They were
"*", so a host on an exit node's network could reach its clients.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
5741dba87d
policy/v2: sort approved routes in wildcard sources
...
They followed NodeStore map order, so the same policy read as changed.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
8ba627c3f4
types: leave the base domain out of search domains without MagicDNS
...
As SaaS. Alone, it left a client that writes resolv.conf with no nameserver.
Updates #2029
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
b04bbd4317
mapper: send a disable-ipv4 holder its peers over IPv6 only
...
As SaaS. Peers' 100.x addresses routed into tailscale0 and hid a local
host with the same address, which is what the attr is meant to avoid.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
68b0274694
types: lead AllowedIPs with the node's own addresses
...
As SaaS. tailscale whois prints AllowedIPs[2:] as routes, so sorted
entries showed an own address in place of a subnet route.
2026-11-03 17:05:00 +01:00
Kristoffer Dalby
edad4ff324
types: do not stamp is-admin on tagged nodes
...
A tagged node has no user to hold the role. SaaS leaves it out unless policy
grants it. Stop stripping the cap, so captures now compare it.
2026-11-03 17:05:00 +01:00