[client] Apply the published upload destination at login too

Engine.Start receives the login response's NetbirdConfig but only runs it
through PopulateNetbirdConfig, so handleDebugUploadUpdate never saw it: the
destination the management server publishes reached the engine only on the
first sync afterwards. A debug bundle requested in that window resolved no
published destination and fell back to the service NetBird runs, even on a
deployment that had configured its own — the opposite of what configuring it
is for.

Seen with a remote job triggered shortly after the peer reconnected: the job
succeeded against NetBird's upload service while the account setting named a
different host.
This commit is contained in:
riccardom
2026-09-11 15:51:49 +02:00
parent c71fd1d841
commit a8ba9d0149
+7
View File
@@ -615,6 +615,13 @@ func (e *Engine) Start(netbirdConfig *mgmProto.NetbirdConfig, mgmtURL *url.URL)
log.Warnf("failed to populate DNS cache: %v", err)
}
// The login response carries the same NetbirdConfig a sync does, but Start
// does not run it through updateNetbirdConfig. Without this, a bundle
// requested between login and the first sync sees no published destination
// and falls back to the service NetBird runs, even where the deployment
// configured its own.
e.handleDebugUploadUpdate(netbirdConfig.GetDebug())
e.routeManager = routemanager.NewManager(routemanager.ManagerConfig{
Context: e.ctx,
PublicKey: e.config.WgPrivateKey.PublicKey().String(),