[management,client] Default to NetBird's upload service when nothing is configured

The previous commit made a peer with no destination — no MDM override, no URL
named by the caller, nothing published by its management server — refuse to
upload and keep the bundle local unless it was enrolled with NetBird's cloud.
That closed the reported data-boundary concern, but it broke the default for
everyone who uploads a bundle as part of their day: a self-hosted user opening
a support ticket got a refusal where the command used to work.

Product decision (NetBird's, not the reporter's): the knob to keep bundles
inside your own infrastructure is what this branch provides, and it is enough.
The default stays the service NetBird runs, self-hosted included. An admin who
needs the bundles to stay in-house configures the destination; until then the
everyday flow keeps working.

So ResolveUploadURL drops the cloud check, the sentinel error and the
managementURL argument, and never fails:

    MDM  >  explicitly named URL  >  published by management  >  NetBird's service

Nothing observable changes for a deployment that configures nothing, which also
removes two edge cases the fail-closed default had: a peer still enrolled on the
legacy api.wiretrustee.com host would have been classified self-hosted and
refused, and an upgrade would have silently stopped uploads for self-hosted
deployments relying on them. The privilege gate is unaffected — a host other
than the default one still requires a privileged caller, so pointing the CLI
somewhere other than what management published needs root.
This commit is contained in:
riccardom
2026-09-10 16:38:41 +02:00
parent fcb9b02451
commit c71fd1d841
16 changed files with 88 additions and 163 deletions
+5 -6
View File
@@ -218,12 +218,11 @@ type AgentNetwork struct {
//
// The client paths that upload without a human picking a destination — the
// remote debug-bundle job, the mobile clients and the desktop UI — take the
// destination from here. It exists so a self-hosted deployment keeps its
// bundles, which carry peer logs, routes, DNS and firewall state, inside the
// operator's own control sphere instead of reaching the upload service NetBird
// runs. Leaving it unset publishes no destination: a peer enrolled with
// NetBird's cloud still uses NetBird's service, a self-hosted peer keeps the
// bundle local.
// destination from here. It exists so an operator who needs the bundles, which
// carry peer logs, routes, DNS and firewall state, to stay inside their own
// infrastructure can say so once. Leaving it unset publishes no destination and
// the peers upload to the service NetBird runs, which keeps the everyday
// "collect a bundle and send it to support" flow working out of the box.
//
// Set URL to the upload service's get-URL endpoint, e.g.
// https://upload.example.com/upload-url (see the upload-server component).
@@ -115,9 +115,10 @@ func toNetbirdConfig(config *nbconfig.Config, turnCredentials *Token, relayToken
}
}
// The account setting wins, the server config is the deployment-wide default
// a self-hosted install can set once so a fresh account is not left with the
// vendor fallback. Both are https-validated where they are written.
// The account setting wins, the server config is the deployment-wide value a
// self-hosted install can set once for every account. Both are
// https-validated where they are written. Neither set publishes nothing, and
// the peers fall back to the service NetBird runs.
debugUploadURL := config.DebugUpload.URL
if settings != nil && settings.DebugBundleUploadURL != "" {
debugUploadURL = settings.DebugBundleUploadURL
+3 -4
View File
@@ -79,10 +79,9 @@ type Settings struct {
// DebugBundleUploadURL is the debug-bundle upload service the peers of this
// account send their bundles to. A bundle carries peer logs, routes, DNS and
// firewall state, so the destination decides whose infrastructure that data
// lands on; setting it keeps a self-hosted account's bundles inside its own
// control sphere. Empty falls back to the deployment-wide DebugUpload.URL
// from the management server config, and with neither only a peer enrolled
// with NetBird's cloud uploads at all. Must be an https URL with a host.
// lands on. Empty falls back to the deployment-wide DebugUpload.URL from the
// management server config, and with neither to the service NetBird runs.
// Must be an https URL with a host.
DebugBundleUploadURL string
// AgentNetworkOnly limits the dashboard to the Agent Network surface for this account.