mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-18 08:55:24 +00:00
WithSelfNode and buildTailPeers merge each node's policy CapMap
into the tailcfg.Node.CapMap they emit. State.NodeCapMap and
State.NodeCapMaps wrap the policy manager: NodeCapMap returns a
defensive clone per call; NodeCapMaps snapshots the full per-node
map once for batched callers, amortising pm.mu acquisition across
a peer build.
generateDNSConfig grew a per-node CapMap argument so it can apply
nodeAttr-driven DNS overlays. The nextdns DoH rewrite hardens against
policy-controlled inputs:
- nextDNSDoHHost anchors the prefix match instead of substring,
so a hostile resolver URL cannot smuggle a nextdns hostname in
a path or query.
- nextDNSProfileFromCapMap accepts only profile names matching
[A-Za-z0-9._-]{1,64} and picks the lexicographically first when
multiple are granted -- deterministic, no shell metacharacters
or URL fragments through.
- addNextDNSMetadata composes the rewritten URL via url.Parse +
url.Values rather than fmt.Sprintf, so existing query strings
on the resolver URL survive and metadata cannot inject a new
component.
WithTaildropEnabled in servertest controls cfg.Taildrop.Enabled per
test so cap/file-sharing emission can be toggled in tests that need
to verify the off path.
|
||
|---|---|---|
| .. | ||
| auth_cache_test.go | ||
| debug.go | ||
| debug_test.go | ||
| endpoint_test.go | ||
| ephemeral_test.go | ||
| ha_health.go | ||
| maprequest.go | ||
| maprequest_test.go | ||
| node_store.go | ||
| node_store_hostname_test.go | ||
| node_store_test.go | ||
| ping.go | ||
| ping_test.go | ||
| primaries_property_test.go | ||
| primaries_test.go | ||
| ssh_check_test.go | ||
| state.go | ||
| tags.go | ||
| test_helpers.go | ||