[management,client] Keep the published upload destination across partial config updates

pushNewTURNTokens and pushNewRelayTokens send a SyncResponse whose NetbirdConfig
carries only Turns and Relay. handleDebugUploadUpdate read the absent Debug as
an empty destination and stored it, so every TURN credential refresh — every few
minutes — silently dropped the operator's choice and the next bundle went to the
service NetBird runs. That is the exact failure this branch exists to prevent.

A nil DebugConfig now carries no information and is left alone. To keep an
operator's clear reaching the peer, toNetbirdConfig always emits Debug on the
full config it builds, empty URL included, so the peer can tell "cleared" from
"not mentioned".

Reported by cubic on #7514.
This commit is contained in:
riccardom
2026-09-14 09:16:10 +02:00
parent a8ba9d0149
commit 803b0d6db0
3 changed files with 25 additions and 8 deletions
@@ -123,9 +123,10 @@ func toNetbirdConfig(config *nbconfig.Config, turnCredentials *Token, relayToken
if settings != nil && settings.DebugBundleUploadURL != "" {
debugUploadURL = settings.DebugBundleUploadURL
}
if debugUploadURL != "" {
nbConfig.Debug = &proto.DebugConfig{UploadUrl: debugUploadURL}
}
// Always sent, empty included: this is a full config, so the peer can tell an
// operator clearing the destination from the partial updates that carry only
// TURN or relay credentials and say nothing about it.
nbConfig.Debug = &proto.DebugConfig{UploadUrl: debugUploadURL}
return nbConfig
}