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(api): store TLS fingerprint during auto-registration (#1303)
rcourtman510ec999abb8
diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.goindex 5444b2ad9b..16876f9910 100644--- a/internal/api/config_handlers.go+++ b/internal/api/config_handlers.go@@ -5409,6 +5409,11 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.Requeinstance.Password = ""instance.TokenName = nodeConfig.TokenNameinstance.TokenValue = nodeConfig.TokenValue+ // Update TLS fingerprint only when one was captured; a failed+ // FetchFingerprint must not erase a previously valid pin. Refs: #1303+ if nodeConfig.Fingerprint != "" {+ instance.Fingerprint = nodeConfig.Fingerprint+ }// Update source if provided (allows upgrade from script to agent)if req.Source != "" {instance.Source = req.Source@@ -5417,10 +5422,11 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.Reque// Check for cluster if not already detectedif !instance.IsCluster {clientConfig := proxmox.ClientConfig{- Host: instance.Host,- TokenName: nodeConfig.TokenName,- TokenValue: nodeConfig.TokenValue,- VerifySSL: instance.VerifySSL,+ Host: instance.Host,+ TokenName: nodeConfig.TokenName,+ TokenValue: nodeConfig.TokenValue,+ VerifySSL: instance.VerifySSL,+ Fingerprint: instance.Fingerprint,}isCluster, clusterName, clusterEndpoints := detectPVECluster(clientConfig, instance.Name, instance.ClusterEndpoints)@@ -5447,6 +5453,11 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.Requeinstance.Password = ""instance.TokenName = nodeConfig.TokenNameinstance.TokenValue = nodeConfig.TokenValue+ // Update TLS fingerprint only when one was captured; a failed+ // FetchFingerprint must not erase a previously valid pin. Refs: #1303+ if nodeConfig.Fingerprint != "" {+ instance.Fingerprint = nodeConfig.Fingerprint+ }// Update source if provided (allows upgrade from script to agent)if req.Source != "" {instance.Source = req.Source@@ -5468,10 +5479,11 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.RequeverifySSL = *nodeConfig.VerifySSL}clientConfig := proxmox.ClientConfig{- Host: nodeConfig.Host,- TokenName: nodeConfig.TokenName,- TokenValue: nodeConfig.TokenValue,- VerifySSL: verifySSL,+ Host: nodeConfig.Host,+ TokenName: nodeConfig.TokenName,+ TokenValue: nodeConfig.TokenValue,+ VerifySSL: verifySSL,+ Fingerprint: nodeConfig.Fingerprint,}isCluster, clusterName, clusterEndpoints := detectPVECluster(clientConfig, nodeConfig.Name, nil)@@ -5556,6 +5568,7 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.RequeHost: nodeConfig.Host,TokenName: nodeConfig.TokenName,TokenValue: nodeConfig.TokenValue,+ Fingerprint: nodeConfig.Fingerprint,VerifySSL: verifySSL,MonitorVMs: monitorVMs,MonitorContainers: monitorContainers,@@ -5608,6 +5621,7 @@ func (h *ConfigHandlers) HandleAutoRegister(w http.ResponseWriter, r *http.RequeHost: nodeConfig.Host,TokenName: nodeConfig.TokenName,TokenValue: nodeConfig.TokenValue,+ Fingerprint: nodeConfig.Fingerprint,VerifySSL: verifySSL,MonitorBackups: true, // Enable by default for PBSMonitorDatastores: monitorDatastores,@@ -5859,7 +5873,11 @@ func (h *ConfigHandlers) handleSecureAutoRegister(w http.ResponseWriter, r *httpinstance.Password = ""instance.TokenName = pveNode.TokenNameinstance.TokenValue = pveNode.TokenValue- instance.Fingerprint = pveNode.Fingerprint+ // Update TLS fingerprint only when one was captured; a failed+ // FetchFingerprint must not erase a previously valid pin. Refs: #1303+ if pveNode.Fingerprint != "" {+ instance.Fingerprint = pveNode.Fingerprint+ }instance.VerifySSL = pveNode.VerifySSLlog.Info().Str("host", host).Str("type", "pve").Msg("Secure auto-register matched existing node by host; updated token in-place")} else {@@ -5894,7 +5912,11 @@ func (h *ConfigHandlers) handleSecureAutoRegister(w http.ResponseWriter, r *httpinstance.Password = ""instance.TokenName = pbsNode.TokenNameinstance.TokenValue = pbsNode.TokenValue- instance.Fingerprint = pbsNode.Fingerprint+ // Update TLS fingerprint only when one was captured; a failed+ // FetchFingerprint must not erase a previously valid pin. Refs: #1303+ if pbsNode.Fingerprint != "" {+ instance.Fingerprint = pbsNode.Fingerprint+ }instance.VerifySSL = pbsNode.VerifySSLlog.Info().Str("host", host).Str("type", "pbs").Msg("Secure auto-register matched existing node by host; updated token in-place")} else {