mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-15 19:29:08 +02:00
The agent network gateway service is synthesised as private: agents reach it over the WireGuard tunnel, authorised by their peer identity, with the cluster itself as its only target. Only a reverse proxy cluster with private capabilities can serve that, which management reports per cluster as the `private` capability — the same supports_private flag the dashboard gates NetBird-only services on. CreateSettings took any hostname as proxy_address and only normalised it, so a bootstrap could pin an account to a cluster without private capabilities. The endpoint is immutable, leaving a dead gateway until the settings row is deleted and re-bootstrapped. Both bootstrap paths now validate the picked cluster before an endpoint is allocated: a cluster the account can see must have a connected proxy reporting the capability, shared and account-owned alike. Whether management knows a cluster comes from its proxy rows, never from how fresh their heartbeats are, so a cluster without the capability stays refused while its proxies are merely offline. A hostname no proxy has declared stays pinnable, the address-first order the self-addressed path documents. Cluster identity is compared case-insensitively over the account's cluster list, since proxies declare their address as the operator spelled it. Rebased onto main after #7519 landed; the ownership check this builds on is main's now. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sa3DsBDP3VciAi4PPG17L6