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
Honor the typed connection name in assisted Proxmox setup
rcourtman550b68fb13ee
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 6c8389cea8..00127eac3a 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -549,6 +549,14 @@ update, profile rollout, command reachability, or fleet-control authority.that runtime, not a control-plane token, agent profile, or cross-clientingest path.21. `internal/api/config_setup_handlers.go` shared with `api-contracts`: auto-register and setup handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.+ Assisted-setup naming is lifecycle-owned bootstrap state: the connection+ name typed in the add dialog travels on the one-time setup token+ (`SetupTokenRecord.DesiredName`) rather than through the node-side script,+ and the setup-token-authenticated auto-register completion names a newly+ created connection from that carried value, falling back to the node's+ self-reported hostname only when no name was typed. Dedup and+ cluster-member adoption identity remain hostname/candidate based so the+ carried name cannot fork or rotate an existing registration.22. `internal/api/setup_script_render.go` shared with `api-contracts`, `storage-recovery`: the generated Proxmox setup-script is a shared boundary across agent lifecycle (forced-command keys, install/uninstall edits), API contracts (rendered token shape and encoded rerun URL), and storage/recovery (backup visibility grants, Pulse-managed temperature SSH keys, and SMART disk-temperature collection).PBS setup-script auto-registration remains lifecycle-owned bootstraptransport: rendered scripts must post registration payloads to the canonicaldiff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex dbe9a613cf..ecc31bcaa5 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -1766,6 +1766,15 @@ payload shape change when the portal presents compact client rows.match the primary configured endpoint may still drive disconnected-sourcerepair.That same contract now owns stale-marker verification as well: setup-token-authenticated `checkRegistration` requests may omit token completion fields and must answer `{registered:boolean}` from canonical candidate-host matching so runtime repair can distinguish real registrations from stale local marker files without rotating tokens first.+ That same contract owns user-chosen connection naming for assisted setup:+ `/api/setup-script-url` accepts an optional `name` field (the connection+ name typed in the add dialog), stores it on the one-time setup token, and+ the setup-token-authenticated `/api/auto-register` completion must name a+ newly created connection with that carried name instead of the node's+ self-reported hostname. Identity matching for dedup and cluster-member+ adoption stays on the reported server name and candidate hosts, so a+ user-chosen name can never fork an existing connection, and an empty or+ absent `name` preserves the hostname-derived default.That same shared boundary owns the install-token bootstrap type rule: theone-shot Proxmox source-creation grant carried by agent-install tokensaccepts either a matching declared `install_type` of `pve`/`pbs` or adiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex e417dc430f..dc6c0a6d57 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -188,6 +188,11 @@ a recovery-provider read helper or compatibility alias.2. `frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx` shared with `unified-resources`: Proxmox workload coverage rows are both a storage/recovery protection-posture surface and a unified-resource identity consumer boundary.3. `frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx` shared with `unified-resources`: Proxmox recoverable workload table rows are both a storage/recovery coverage surface and a unified-resource platform-table consumer boundary.4. `internal/api/setup_script_render.go` shared with `agent-lifecycle`, `api-contracts`: the generated Proxmox setup-script is a shared boundary across agent lifecycle (forced-command keys, install/uninstall edits), API contracts (rendered token shape and encoded rerun URL), and storage/recovery (backup visibility grants, Pulse-managed temperature SSH keys, and SMART disk-temperature collection).+ The user-chosen connection name carried by assisted setup travels on the+ server-side setup token, not through the rendered script or its+ registration payload, so honoring it changes neither the backup+ visibility grants the script applies nor the storage-side identity that+ backup and recovery attribution key on (hostname and candidate hosts).5. `internal/proxmoxidentity/backup_identity.go` shared with `alerts`, `monitoring`: Proxmox PBS backup subject identity is a shared runtime boundary for monitoring backup freshness, backup-age alert attribution, and recovery-point guest mapping.Storage resource projections may show alert indicators from the canonicaldiff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.jsonindex 2ff58d31bc..29637ed60b 100644--- a/frontend-modern/browser-verification.json+++ b/frontend-modern/browser-verification.json@@ -1,15 +1,15 @@{"version": 1,- "base_sha": "6ffc6b4f3a90af4c6486d90c916b37b73f1b736b",- "verified_at": "2026-08-18T17:05:00Z",+ "base_sha": "006d5da1c7881a43bdfbb7357b6a7a84395ebb8b",+ "verified_at": "2026-08-18T18:22:00Z","result": "passed","changed_paths": [- "frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx",+ "frontend-modern/src/api/nodes.ts","frontend-modern/src/components/Settings/useNodeModalState.ts"],"content_sha256": {- "frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx": "5532561552c342d17d4688cfcc7b0cd5af835b1e9276778d00303e9372f2eba5",- "frontend-modern/src/components/Settings/useNodeModalState.ts": "9b9957cf5760896b748ced54b0bb30612ab10e84bda45a527be3758bb228247c"+ "frontend-modern/src/api/nodes.ts": "fb258752aafdb6ec0be631732512b131196c51a890c6f2d4c050992c4c800a36",+ "frontend-modern/src/components/Settings/useNodeModalState.ts": "bd3124418c5f6006205d2a0056fc7d93666f7aaf20dda7aa861fb199d76cf5ba"},"routes": ["/settings/infrastructure"@@ -25,21 +25,18 @@}],"states": [- "Add Proxmox VE dialog with name, endpoint, and password auth filled; connection saved (201) and listed",- "Manage dialog populated from saved config (name, user, SSL, collection scope)",- "Manage dialog mid-edit while a refresh_nodes-triggered loadNodes delivered changed server data (user field changed server-side): typed rename preserved, dialog not remounted, background sync skipped",- "Manage dialog reopened after cancel: fresh server state (changed user) synced into the form",- "Manage dialog after Save changes: rename persisted server-side and shown in dialog title",- "Mobile 375x812 Manage dialog: form renders, typed edit survives refresh_nodes"+ "Add Proxmox VE dialog on the Connect via API path with Node Name enacon and an endpoint URL typed",+ "Setup command generated: POST /api/setup-script-url returned 200 with the setup token after the copy-command action",+ "Auto-registration completed against the isolated backend using that setup token with serverName pve01: connection created and listed as enacon, not pve01",+ "Connected systems list showing the enacon connection under Proxmox VE",+ "Mobile 375x812 Add Proxmox VE dialog with the Node Name field typed into"],"interactions": [- "typed node name and endpoint URL in the add dialog",- "switched auth mode to Username & Password and submitted Add node",- "opened Manage from the connected systems list",- "typed a rename into Node Name mid-edit (input events)",- "changed the node's user via PUT /api/config/nodes/pve-0 and emitted refresh_nodes to force loadNodes while editing",- "cancelled and reopened the Manage dialog",- "clicked Save changes and confirmed the rename via GET /api/config/nodes",- "repeated the mid-edit refresh check at the mobile viewport"+ "opened Add infrastructure and picked Proxmox VE",+ "typed the connection name and endpoint URL (input events)",+ "triggered the copy-command action that requests /api/setup-script-url with the typed name",+ "read the response setup token and completed POST /api/auto-register with it (simulated node-side script) with a different self-reported hostname",+ "confirmed via GET /api/config/nodes and the connected systems list that the connection took the typed name",+ "repeated the dialog and name typing at the mobile viewport"]}diff --git a/frontend-modern/src/api/__tests__/nodes.test.ts b/frontend-modern/src/api/__tests__/nodes.test.tsindex 69ba65a2ee..e118544496 100644--- a/frontend-modern/src/api/__tests__/nodes.test.ts+++ b/frontend-modern/src/api/__tests__/nodes.test.ts@@ -383,6 +383,40 @@ describe('NodesAPI', () => {expect(result).not.toHaveProperty('setupToken');});+ it('sends the typed connection name so the setup token can carry it into auto-registration', async () => {+ vi.mocked(apiFetchJSON).mockResolvedValueOnce({+ type: 'pve',+ host: 'https://pve.example:8006',+ url: 'https://pulse.example/api/setup-script?type=pve',+ downloadURL: 'https://pulse.example/api/setup-script?type=pve&setup_token=setup-token-123',+ scriptFileName: 'pulse-setup-pve.sh',+ command: 'curl pve ...',+ setupToken: 'setup-token-123',+ tokenHint: 'set…123',+ expires: 1_900_000_000,+ });++ await NodesAPI.getProxmoxSetupCommand({+ type: 'pve',+ host: 'pve.example',+ backupPerms: false,+ name: 'enacon',+ });++ expect(apiFetchJSON).toHaveBeenCalledWith(+ '/api/setup-script-url',+ expect.objectContaining({+ method: 'POST',+ body: JSON.stringify({+ type: 'pve',+ host: 'pve.example',+ backupPerms: false,+ name: 'enacon',+ }),+ }),+ );+ });+it('normalizes the canonical setup-script-url response fields', async () => {vi.mocked(apiFetchJSON).mockResolvedValueOnce({type: ' pve ',diff --git a/frontend-modern/src/api/nodes.ts b/frontend-modern/src/api/nodes.tsindex bbc5654618..ff19cd74bf 100644--- a/frontend-modern/src/api/nodes.ts+++ b/frontend-modern/src/api/nodes.ts@@ -301,6 +301,9 @@ export class NodesAPI {type: 'pve' | 'pbs';host: string;backupPerms: boolean;+ // Optional connection name typed in the add dialog; rides the setup token+ // so the auto-registration triggered by the script keeps this name.+ name?: string;}): Promise<ProxmoxSetupCommandResponse> {const response = await apiFetchJSON<RawProxmoxSetupCommandResponse>('/api/setup-script-url', {method: 'POST',diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.tsindex baf20d9e55..b84758f45b 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts@@ -1682,6 +1682,9 @@ describe('settings architecture guardrails', () => {expect(nodeModalStatusFooterSource).toContain('props.saveDisabled');expect(nodeModalStateSource).toContain("enableCommands: type === 'pve'");expect(nodeModalStateSource).toContain('data.setupMode !==');+ // The typed connection name rides the setup bootstrap request so the+ // one-time setup token can carry it into auto-registration naming.+ expect(nodeModalStateSource).toContain('name: formData().name?.trim() || undefined');expect(vmwareCredentialSlotSource).toContain('TlsVerificationWarningBanner');expect(vmwareCredentialSlotSource).toContain('subject="this vCenter connection"');diff --git a/frontend-modern/src/components/Settings/useNodeModalState.ts b/frontend-modern/src/components/Settings/useNodeModalState.tsindex 5c1d17dd33..f8970f047e 100644--- a/frontend-modern/src/components/Settings/useNodeModalState.ts+++ b/frontend-modern/src/components/Settings/useNodeModalState.ts@@ -108,7 +108,7 @@ export const useNodeModalState = (props: NodeModalProps) => {};const quickSetupCacheKey = (type: 'pve' | 'pbs', backupPerms: boolean) =>- `${type}:${backupPerms ? 'backup' : 'standard'}:${formData().host?.trim() ?? ''}`;+ `${type}:${backupPerms ? 'backup' : 'standard'}:${formData().host?.trim() ?? ''}:${formData().name?.trim() ?? ''}`;const loadQuickSetupBootstrap = async (type: 'pve' | 'pbs',@@ -133,6 +133,7 @@ export const useNodeModalState = (props: NodeModalProps) => {type,host,backupPerms,+ name: formData().name?.trim() || undefined,});setQuickSetupBootstrap({ cacheKey, response });setQuickSetupTokenHint(response.tokenHint);diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.goindex 1fa47f9016..a418d78b7e 100644--- a/internal/api/config_handlers.go+++ b/internal/api/config_handlers.go@@ -180,6 +180,10 @@ type SetupTokenRecord struct {NodeType string // "pve" or "pbs"Host string // The host URL for validationOrgID string // Organization ID creating this code+ // DesiredName carries the connection name the user typed in the add+ // dialog, so auto-registration can honor it instead of falling back to+ // the node's own hostname.+ DesiredName string}// RecentSetupTokenRecord preserves minimal identity metadata for the shortdiff --git a/internal/api/config_handlers_auto_register_test.go b/internal/api/config_handlers_auto_register_test.goindex ea5f7729c0..ead59c0a88 100644--- a/internal/api/config_handlers_auto_register_test.go+++ b/internal/api/config_handlers_auto_register_test.go@@ -247,6 +247,117 @@ func TestHandleAutoRegisterAcceptsWithSetupToken(t *testing.T) {}}+func TestHandleAutoRegisterUsesSetupTokenDesiredName(t *testing.T) {+ stubAutoRegisterNetworkDeps(t)++ tempDir := t.TempDir()+ t.Setenv("PULSE_DATA_DIR", tempDir)++ cfg := &config.Config{+ DataPath: tempDir,+ ConfigPath: tempDir,+ }++ handler := newTestConfigHandlers(t, cfg)++ const tokenValue = "TEMP-TOKEN-NAMED"+ tokenHash := internalauth.HashAPIToken(tokenValue)+ handler.codeMutex.Lock()+ handler.setupTokens[tokenHash] = &SetupTokenRecord{+ ExpiresAt: time.Now().Add(5 * time.Minute),+ NodeType: "pve",+ DesiredName: "enacon",+ }+ handler.codeMutex.Unlock()++ reqBody := AutoRegisterRequest{+ Type: "pve",+ Host: "https://pve01.local:8006",+ TokenID: "pulse-monitor@pve!pulse-pve01-local",+ TokenValue: "secret-token",+ ServerName: "pve01.local",+ AuthToken: tokenValue,+ Source: "script",+ }++ body, err := json.Marshal(reqBody)+ if err != nil {+ t.Fatalf("failed to marshal request: %v", err)+ }++ req := httptest.NewRequest(http.MethodPost, "/api/auto-register", bytes.NewReader(body))+ rec := httptest.NewRecorder()++ handler.HandleAutoRegister(rec, req)++ if rec.Code != http.StatusOK {+ t.Fatalf("expected status 200, got %d, body=%s", rec.Code, rec.Body.String())+ }++ if len(cfg.PVEInstances) != 1 {+ t.Fatalf("expected 1 PVE instance stored, got %d", len(cfg.PVEInstances))+ }+ // The name the user typed in the add dialog rides the setup token and+ // wins over the node's self-reported hostname.+ if cfg.PVEInstances[0].Name != "enacon" {+ t.Fatalf("name = %q, want the setup token's desired name %q", cfg.PVEInstances[0].Name, "enacon")+ }+}++func TestHandleAutoRegisterKeepsHostnameNameWithoutDesiredName(t *testing.T) {+ stubAutoRegisterNetworkDeps(t)++ tempDir := t.TempDir()+ t.Setenv("PULSE_DATA_DIR", tempDir)++ cfg := &config.Config{+ DataPath: tempDir,+ ConfigPath: tempDir,+ }++ handler := newTestConfigHandlers(t, cfg)++ const tokenValue = "TEMP-TOKEN-UNNAMED"+ tokenHash := internalauth.HashAPIToken(tokenValue)+ handler.codeMutex.Lock()+ handler.setupTokens[tokenHash] = &SetupTokenRecord{+ ExpiresAt: time.Now().Add(5 * time.Minute),+ NodeType: "pve",+ }+ handler.codeMutex.Unlock()++ reqBody := AutoRegisterRequest{+ Type: "pve",+ Host: "https://pve01.local:8006",+ TokenID: "pulse-monitor@pve!pulse-pve01-local",+ TokenValue: "secret-token",+ ServerName: "pve01.local",+ AuthToken: tokenValue,+ Source: "script",+ }++ body, err := json.Marshal(reqBody)+ if err != nil {+ t.Fatalf("failed to marshal request: %v", err)+ }++ req := httptest.NewRequest(http.MethodPost, "/api/auto-register", bytes.NewReader(body))+ rec := httptest.NewRecorder()++ handler.HandleAutoRegister(rec, req)++ if rec.Code != http.StatusOK {+ t.Fatalf("expected status 200, got %d, body=%s", rec.Code, rec.Body.String())+ }++ if len(cfg.PVEInstances) != 1 {+ t.Fatalf("expected 1 PVE instance stored, got %d", len(cfg.PVEInstances))+ }+ if cfg.PVEInstances[0].Name != "pve01.local" {+ t.Fatalf("name = %q, want hostname-derived default %q", cfg.PVEInstances[0].Name, "pve01.local")+ }+}+func TestHandleAutoUnregisterAcceptsRecentSetupTokenAndRemovesMatchingPVEInstance(t *testing.T) {tempDir := t.TempDir()t.Setenv("PULSE_DATA_DIR", tempDir)diff --git a/internal/api/config_handlers_setup_url_test.go b/internal/api/config_handlers_setup_url_test.goindex 25dde4ef85..50f831a809 100644--- a/internal/api/config_handlers_setup_url_test.go+++ b/internal/api/config_handlers_setup_url_test.go@@ -182,6 +182,48 @@ func TestHandleSetupScriptURL(t *testing.T) {}}+func TestHandleSetupScriptURL_StoresDesiredNameOnSetupToken(t *testing.T) {+ tempDir := t.TempDir()+ cfg := &config.Config{+ FrontendPort: 8080,+ PublicURL: "https://pulse.example.com",+ }+ cfg.DataPath = tempDir+ handler := newTestConfigHandlers(t, cfg)++ body, err := json.Marshal(map[string]interface{}{+ "type": "pve",+ "host": "pve1.local",+ "name": " enacon ",+ })+ if err != nil {+ t.Fatal(err)+ }++ req := httptest.NewRequest(http.MethodPost, "/api/setup/url", bytes.NewBuffer(body))+ req.Host = "127.0.0.1:8080"+ w := httptest.NewRecorder()++ handler.HandleSetupScriptURL(w, req)++ if w.Code != http.StatusOK {+ t.Fatalf("status = %d, want %d, body=%s", w.Code, http.StatusOK, w.Body.String())+ }++ handler.codeMutex.Lock()+ defer handler.codeMutex.Unlock()+ if len(handler.setupTokens) != 1 {+ t.Fatalf("expected 1 setup token stored, got %d", len(handler.setupTokens))+ }+ for _, record := range handler.setupTokens {+ // The typed connection name is trimmed and rides the setup token so+ // auto-registration can honor it.+ if record.DesiredName != "enacon" {+ t.Fatalf("DesiredName = %q, want %q", record.DesiredName, "enacon")+ }+ }+}+func TestHandleSetupScriptURL_RejectsTrailingJSON(t *testing.T) {tempDir := t.TempDir()cfg := &config.Config{DataPath: tempDir}diff --git a/internal/api/config_setup_handlers.go b/internal/api/config_setup_handlers.goindex 086965be3b..b6338087f9 100644--- a/internal/api/config_setup_handlers.go+++ b/internal/api/config_setup_handlers.go@@ -647,6 +647,25 @@ type setupScriptURLRequest struct {Type string `json:"type"`Host string `json:"host"`BackupPerms bool `json:"backupPerms"`+ // Name is the optional connection name the user typed in the add dialog.+ // It rides the setup token so the auto-registration that the setup script+ // triggers can name the connection what the user asked for, rather than+ // deriving it from the node's hostname.+ Name string `json:"name,omitempty"`+}++// setupDesiredNameContextKey carries the user's typed connection name from+// setup-token validation to the auto-registration path within one request.+type setupDesiredNameContextKey struct{}++func setupDesiredNameFromContext(ctx context.Context) string {+ if ctx == nil {+ return ""+ }+ if name, ok := ctx.Value(setupDesiredNameContextKey{}).(string); ok {+ return strings.TrimSpace(name)+ }+ return ""}// generateSetupTokenRecord generates a secure hex token that satisfies sanitizeSetupAuthToken.@@ -691,6 +710,7 @@ func (h *ConfigHandlers) handleSetupScriptURL(w http.ResponseWriter, r *http.Req}req.Type = strings.TrimSpace(req.Type)req.Host = strings.TrimSpace(req.Host)+ req.Name = strings.TrimSpace(req.Name)if !isCanonicalAutoRegisterType(req.Type) {http.Error(w, "type must be 'pve' or 'pbs'", http.StatusBadRequest)return@@ -719,11 +739,12 @@ func (h *ConfigHandlers) handleSetupScriptURL(w http.ResponseWriter, r *http.Reqexpiry := time.Now().Add(5 * time.Minute)h.codeMutex.Lock()h.setupTokens[tokenHash] = &SetupTokenRecord{- ExpiresAt: expiry,- Used: false,- NodeType: req.Type,- Host: req.Host,- OrgID: GetOrgID(r.Context()),+ ExpiresAt: expiry,+ Used: false,+ NodeType: req.Type,+ Host: req.Host,+ OrgID: GetOrgID(r.Context()),+ DesiredName: req.Name,}h.codeMutex.Unlock()@@ -1871,6 +1892,11 @@ func (h *ConfigHandlers) handleAutoRegister(w http.ResponseWriter, r *http.RequegraceExpiry := recentSetupTokenGraceExpiry(setupTokenRecord, time.Now())h.recentSetupTokens[tokenHash] = buildRecentSetupTokenRecord(setupTokenRecord, graceExpiry)authenticated = true+ // Carry the name the user typed in the add dialog to the+ // registration path, same transport as the token's OrgID.+ if trimmed := strings.TrimSpace(setupTokenRecord.DesiredName); trimmed != "" {+ r = r.WithContext(context.WithValue(r.Context(), setupDesiredNameContextKey{}, trimmed))+ }log.Info().Str("type", req.Type).Str("host", req.Host).@@ -2161,10 +2187,17 @@ func (h *ConfigHandlers) handleCanonicalAutoRegister(w http.ResponseWriter, r *hcandidateHosts: candidateHosts,}- // Add the node to configuration+ // Add the node to configuration. A name typed in the add dialog rides the+ // setup token as the desired name and wins over the node's own hostname;+ // the dedup/adoption identity below still matches on serverName so+ // renaming cannot fork an existing connection.+ connectionName := serverName+ if desired := setupDesiredNameFromContext(r.Context()); desired != "" {+ connectionName = desired+ }created := falseif req.Type == "pve" {- pveDisplayName := h.disambiguateNodeName(r.Context(), serverName, host, "pve")+ pveDisplayName := h.disambiguateNodeName(r.Context(), connectionName, host, "pve")pveNode := config.PVEInstance{Name: pveDisplayName,Host: host,@@ -2217,7 +2250,7 @@ func (h *ConfigHandlers) handleCanonicalAutoRegister(w http.ResponseWriter, r *hcreated = true}} else if req.Type == "pbs" {- pbsDisplayName := h.disambiguateNodeName(r.Context(), serverName, host, "pbs")+ pbsDisplayName := h.disambiguateNodeName(r.Context(), connectionName, host, "pbs")pbsNode := config.PBSInstance{Name: pbsDisplayName,Host: host,