Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Fix cluster proxy token collision - store per-node control tokens
rcourtman0223a52f8297
diff --git a/internal/api/temperature_proxy.go b/internal/api/temperature_proxy.goindex f2b639f64e..2aef16d867 100644--- a/internal/api/temperature_proxy.go+++ b/internal/api/temperature_proxy.go@@ -230,6 +230,7 @@ func (h *TemperatureProxyHandlers) HandleRegister(w http.ResponseWriter, r *http// Find matching PVE instance by hostnamevar matchedInstance *config.PVEInstancevar matchedIndex int+ var matchedEndpointIndex = -1 // For cluster nodes, track which endpoint matchedfor i := range nodesConfig.PVEInstances {instance := &nodesConfig.PVEInstances[i]@@ -250,10 +251,11 @@ func (h *TemperatureProxyHandlers) HandleRegister(w http.ResponseWriter, r *http// Check cluster endpointsif instance.IsCluster {- for _, ep := range instance.ClusterEndpoints {+ for j, ep := range instance.ClusterEndpoints {if strings.EqualFold(ep.NodeName, hostname) || strings.Contains(strings.ToLower(ep.Host), strings.ToLower(hostname)) {matchedInstance = instancematchedIndex = i+ matchedEndpointIndex = jbreak}}@@ -282,15 +284,28 @@ func (h *TemperatureProxyHandlers) HandleRegister(w http.ResponseWriter, r *http}// Update the instance with proxy configuration+ // For clusters, store per-node tokens on the ClusterEndpoint; instance-level token is for non-cluster or fallbacknodesConfig.PVEInstances[matchedIndex].TemperatureProxyURL = proxyURLif isHTTPMode {nodesConfig.PVEInstances[matchedIndex].TemperatureProxyToken = authToken}- nodesConfig.PVEInstances[matchedIndex].TemperatureProxyControlToken = ctrlToken++ // For cluster nodes, store token on the specific endpoint so each node has its own token+ if matchedEndpointIndex >= 0 && matchedInstance.IsCluster {+ nodesConfig.PVEInstances[matchedIndex].ClusterEndpoints[matchedEndpointIndex].TemperatureProxyControlToken = ctrlToken+ log.Debug().+ Str("hostname", hostname).+ Int("endpoint_index", matchedEndpointIndex).+ Msg("Storing control token on cluster endpoint")+ } else {+ // Non-cluster instance or matched by instance name directly+ nodesConfig.PVEInstances[matchedIndex].TemperatureProxyControlToken = ctrlToken+ }// Save updated configurationlog.Debug().Int("matchedIndex", matchedIndex).+ Int("matchedEndpointIndex", matchedEndpointIndex).Str("saving_url", nodesConfig.PVEInstances[matchedIndex].TemperatureProxyURL).Bool("saving_has_token", nodesConfig.PVEInstances[matchedIndex].TemperatureProxyToken != "").Str("instance_name", nodesConfig.PVEInstances[matchedIndex].Name).@@ -368,6 +383,8 @@ func (h *TemperatureProxyHandlers) HandleAuthorizedNodes(w http.ResponseWriter,var matched *config.PVEInstancefor i := range nodesConfig.PVEInstances {inst := &nodesConfig.PVEInstances[i]++ // Check instance-level token firstswitch {case strings.TrimSpace(inst.TemperatureProxyControlToken) == token:matched = inst@@ -378,6 +395,20 @@ func (h *TemperatureProxyHandlers) HandleAuthorizedNodes(w http.ResponseWriter,if matched != nil {break}++ // For clusters, also check per-node tokens on ClusterEndpoints+ if inst.IsCluster {+ for j := range inst.ClusterEndpoints {+ ep := &inst.ClusterEndpoints[j]+ if strings.TrimSpace(ep.TemperatureProxyControlToken) == token {+ matched = inst+ break+ }+ }+ if matched != nil {+ break+ }+ }}refreshFromProxy := 0diff --git a/internal/config/config.go b/internal/config/config.goindex e560801e21..1308630079 100644--- a/internal/config/config.go+++ b/internal/config/config.go@@ -438,6 +438,9 @@ type ClusterEndpoint struct {PulseReachable *bool // Pulse's view: can Pulse reach this endpoint? nil = not yet checkedLastPulseCheck *time.Time // Last time Pulse checked connectivityPulseError string // Last error Pulse encountered connecting to this endpoint++ // Per-node temperature proxy tokens (for clusters with sensor-proxy on each node)+ TemperatureProxyControlToken string // Control-plane token for this specific node}// PBSInstance represents a Proxmox Backup Server connection