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
Identify backup connections in restore-point evidence
pulse-triage[bot]44172aeae381
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex ee09df0d8b..382b2385cd 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -20,6 +20,25 @@## Purpose+### Restore evidence names its source connection++The existing By date source cell and Coverage restore-evidence source cell+show the backup reader's connection alongside its provider kind. Repository,+namespace, guest name and node are not substitutes for that connection: two+independent sources may share all of those labels. The list keeps the source+inside its column; the existing restore-point detail names the full Connection+separately from Location, and Coverage wraps the full connection even when its+Location column is hidden on phones. Missing source identity stays explicit as+Unknown connection / Not reported, never inferred from the workload.++`backupSourceConnection.test.tsx` exercises the actual API/model/table path+for PBS, PVE archives and guest snapshots, same-named sources, missing origins,+literal text, unchanged posture and same-point polling with retained detail and+focus. Desktop/narrow consuming browser proof checks keyboard/touch access and+readable long source names. Exact filter keys, IDs, namespace, chronology,+completion, verification and server-owned protection policy are unchanged.+This is source-selection clarity, not an installed restore or guest recovery.+### Backup retention never substitutes for verificationThe existing restore-point State cell and drawer status prioritise running ordiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 6c0524c4b9..2be4eb3cc1 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -21,6 +21,25 @@## Purpose+### Restore-point origin is distinct from workload placement++The existing frontend location scope retains the backup reader's connection+as a display fact separately from its positional source/connection/repository+key. Existing inventory and Coverage consumers show that connection, including+the full value in restore-point details and wrapped Coverage evidence. No guest+node, namespace or workload connection supplies a missing backup origin.+Same-named repositories remain independently identified; existing exact and+legacy filter resolution, archive/PBS matching, native IDs, chronology, provider+observations and protection policy are unchanged. No API shape, stored record,+backup/restore or guest-agent operation changes.++The normal-suite `backupSourceConnection.test.tsx` covers the real inventory+producer and consumers for PBS, PVE archives and snapshots, unknown origins,+same-point polling and literal rendering. `proxmoxBackupLocation.test.ts` keeps+the exact key and compatibility controls. Desktop/narrow consuming browser+proof establishes readable source selection, not original #3248/#2681 recovery+or actual restore availability.+### Backup retention never substitutes for verificationThe existing restore-point State cell and drawer status prioritise running ordiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex b794865afe..2a2654d648 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -23,6 +23,19 @@ and sort the complete canonical change table while startup and ingestion wait.## Purpose+### Backup evidence keeps the reader connection separate from its owner++Existing By date and Coverage consumers show each restore point's backup+connection, independently of the workload name, node and owner link. The full+connection remains readable in the existing point detail and wrapped Coverage+evidence; a missing origin stays unknown rather than borrowing owner placement.+The frontend location scope carries this display fact without changing exact+source keys, resource/point IDs, namespace, routing, association or canonical+protection assessment. `ProxmoxBackupsTable.test.tsx` and the normal-suite+`backupSourceConnection.test.tsx` exercise inventory-to-consumer attribution,+unknowns and polling; desktop/narrow browser proof checks source readability.+This is not original multi-surface identity recovery or restore acceptance.+### REST snapshots retain canonical source provenance`useUnifiedResources` preserves the validated source list on the canonicaldiff --git a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsxindex 06da8d653f..2f8e521fb6 100644--- a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx@@ -37,7 +37,7 @@ import {import { proxmoxBackupWorkloadSubject } from './proxmoxBackupWorkloadSubject';import type { CoverageSortKey } from './proxmoxBackupsTableModel';import {- ArtifactSourceBadge,+ ArtifactSourceIdentity,ArtifactStateBadge,PROXMOX_BACKUP_COLUMN_LABELS,ProxmoxBackupAgeText,@@ -646,7 +646,7 @@ export function ProxmoxCoverageTable(props: {<TableCellclass={getPlatformTableCellClassForKind('name')}>- <ArtifactSourceBadge artifact={artifact} wrap />+ <ArtifactSourceIdentity artifact={artifact} wrap /></TableCell><Showwhen={isCoverageEvidenceColumnVisible(diff --git a/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsxindex 4ea4532f5e..634119d117 100644--- a/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx@@ -33,7 +33,7 @@ import { useObservedElementWidth } from '@/hooks/useObservedElementWidth';import type { RecoverableArtifact } from './proxmoxBackupRecoveryModel';import type { RecoverableSortKey } from './proxmoxBackupsTableModel';import {- ArtifactSourceBadge,+ ArtifactSourceIdentity,ArtifactStateBadge,PROXMOX_BACKUP_COLUMN_LABELS,ProxmoxBackupAgeText,@@ -116,6 +116,7 @@ const buildRecoverableDetailSections = (artifact: RecoverableArtifact): DetailSemakeDetailRow('Source', source.detailFallbackLabel, {title: artifact.sourceTitle ?? source.sourceTitle,}),+ makeDetailRow('Connection', artifact.locationConnection || 'Not reported', { wrap: true }),makeDetailRow('Location', artifact.location, { wrap: true }),makeDetailRow(PROXMOX_BACKUP_COLUMN_LABELS.created,@@ -277,7 +278,7 @@ export function ProxmoxRecoverableTable(props: {</TableCell></Show><TableCell class={`${getPlatformTableCellClassForKind('text')} text-base-content`}>- <ArtifactSourceBadge artifact={artifact} />+ <ArtifactSourceIdentity artifact={artifact} /></TableCell><Show when={columnVisible('location')}><TableCell class={`${getPlatformTableCellClassForKind('text')} text-base-content`}>diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsxindex 5857e7f27d..88f862398f 100644--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx@@ -2071,6 +2071,12 @@ describe('backup location identity in the consuming views', () => {await waitFor(() => expect(points()).toHaveLength(1));expect(screen.getByText('Main / minipc')).toBeInTheDocument();expect(screen.queryByText('main / minipc')).not.toBeInTheDocument();+ expect(points()[0].querySelector('[data-backup-source-connection]')).toHaveTextContent(+ 'Connection: pbs-main',+ );+ fireEvent.click(within(points()[0]).getByRole('button', { name: /expand details/i }));+ const pointDetail = screen.getByTestId('proxmox-recoverable-detail');+ expect(within(pointDetail).getByText('Connection').closest('tr')).toHaveTextContent('pbs-main');const key = '["pbs","pbs-main","Main"]';await waitFor(() =>expect(new URLSearchParams(window.location.search).get('location')).toBe(key),@@ -2082,6 +2088,9 @@ describe('backup location identity in the consuming views', () => {const detail = screen.getByTestId('proxmox-coverage-detail');expect(within(detail).getByText('Main / minipc')).toBeInTheDocument();expect(within(detail).queryByText('main / minipc')).not.toBeInTheDocument();+ expect(detail.querySelector('[data-backup-source-connection]')).toHaveTextContent(+ 'Connection: pbs-main',+ );expect(new URLSearchParams(window.location.search).get('location')).toBe(key);expect(apiFetchMock).toHaveBeenCalledTimes(calls);mounted.unmount();diff --git a/frontend-modern/src/features/proxmox/__tests__/backupSourceConnection.test.tsx b/frontend-modern/src/features/proxmox/__tests__/backupSourceConnection.test.tsxnew file mode 100644index 0000000000..b6ee1fe791--- /dev/null+++ b/frontend-modern/src/features/proxmox/__tests__/backupSourceConnection.test.tsx@@ -0,0 +1,194 @@+import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';+import { Route, Router } from '@solidjs/router';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';++import { resetCreateNonSuspendingQueryCacheForTest } from '@/hooks/createNonSuspendingQuery';+import type { PBSBackup, PVEBackupsPayload } from '@/types/api';+import { protectionPolicy } from '@/utils/__fixtures__/protectionPosture';+import { ProxmoxBackupsTable } from '../ProxmoxBackupsTable';+import {+ BACKUP_IDENTITY_NOW,+ identityArchive,+ identityGuest,+ identityPBS,+ identitySnapshot,+} from '../__fixtures__/backupIdentity';++const api = vi.hoisted(() => ({ fetch: vi.fn(), json: vi.fn() }));+vi.mock('@/utils/apiClient', () => ({ apiFetch: api.fetch, apiFetchJSON: api.json }));++const guests = ['east', 'west'].map((instance) => ({+ ...identityGuest(`guest-${instance}`, instance, 'pve-1'),+ name: 'same-name',+ displayName: 'same-name',+}));+const emptyPVE: PVEBackupsPayload = {+ backupTasks: [],+ storageBackups: [],+ guestSnapshots: [],+};+const points = (connection = 'pbs-east'): PBSBackup[] => [+ identityPBS({ id: 'point-east', instance: connection }),+ identityPBS({ id: 'point-west', instance: 'pbs-west' }),+];+const response = (data: unknown) =>+ new Response(JSON.stringify({ data }), { headers: { 'Content-Type': 'application/json' } });++function mount(+ getPBS: () => PBSBackup[],+ pve: PVEBackupsPayload = emptyPVE,+ workloads = guests.slice(0, 1),+) {+ api.fetch.mockImplementation((url: string) =>+ Promise.resolve(response(url === '/api/backups/pbs' ? { backups: getPBS() } : pve)),+ );+ // A visible source must not invent canonical workload protection.+ api.json.mockResolvedValue({ data: [], policy: protectionPolicy });+ return render(() => (+ <Router>+ <Route+ path="/*"+ component={() => <ProxmoxBackupsTable emptyIcon={<span />} workloads={workloads} />}+ />+ </Router>+ ));+}++async function inventoryRows() {+ await screen.findAllByText('same-name');+ return Array.from(+ document.querySelectorAll<HTMLElement>('[data-proxmox-backup-row="recoverable"]'),+ );+}++const connectionOf = (row: HTMLElement) =>+ row.querySelector('[data-backup-source-connection]')?.textContent;++beforeEach(() => {+ vi.useFakeTimers({ now: BACKUP_IDENTITY_NOW, toFake: ['Date'] });+ vi.resetAllMocks();+ resetCreateNonSuspendingQueryCacheForTest();+ window.history.replaceState({}, '', '/proxmox/backups/date');+});+afterEach(() => {+ cleanup();+ resetCreateNonSuspendingQueryCacheForTest();+ vi.useRealTimers();+});++describe('restore-point source connections in real inventory consumers', () => {+ it.each(['pbs', 'archive', 'snapshot'] as const)(+ 'distinguishes same-named %s repositories and workloads in rows and full details',+ async (kind) => {+ const pve = {+ ...emptyPVE,+ storageBackups:+ kind === 'archive'+ ? ['east', 'west'].map((instance) =>+ identityArchive({ id: `file-${instance}`, instance, storage: 'main' }),+ )+ : [],+ guestSnapshots:+ kind === 'snapshot'+ ? ['east', 'west'].map((instance) =>+ identitySnapshot({ id: `snapshot-${instance}`, instance }),+ )+ : [],+ };+ mount(+ () => (kind === 'pbs' ? points() : []),+ pve,+ kind === 'pbs' ? guests.slice(0, 1) : guests,+ );+ const rows = await inventoryRows();+ expect(rows).toHaveLength(2);+ for (const connection of kind === 'pbs' ? ['pbs-east', 'pbs-west'] : ['east', 'west']) {+ const row = rows.find((item) => connectionOf(item) === `Connection: ${connection}`)!;+ expect(row).toBeDefined();+ fireEvent.click(within(row).getByRole('button', { name: /expand details/i }));+ const detail = screen.getByTestId('proxmox-recoverable-detail');+ const connectionRow = within(detail).getByText('Connection').closest('tr')!;+ expect(within(connectionRow).getByText(connection)).toBeInTheDocument();+ expect(+ within(detail).getByText(+ kind === 'pbs' ? 'main / pve-1' : kind === 'archive' ? 'main' : 'pve-1',+ ),+ ).toBeInTheDocument();+ fireEvent.click(within(row).getByRole('button', { name: /collapse details/i }));+ }+ expect(api.fetch).toHaveBeenCalledTimes(2);+ },+ );++ it('qualifies each Coverage restore-evidence entry with its own connection, not guest placement', async () => {+ window.history.replaceState({}, '', '/proxmox/backups/coverage');+ mount(() => points());+ const toggle = await screen.findByRole('button', { name: /expand details for same-name/i });+ fireEvent.click(toggle);+ const detail = screen.getByTestId('proxmox-coverage-detail');+ const origins = Array.from(detail.querySelectorAll('[data-backup-source-connection]'));+ expect(origins.map((item) => item.textContent)).toEqual([+ 'Connection: pbs-east',+ 'Connection: pbs-west',+ ]);+ expect(origins.every((item) => item.classList.contains('wrap-anywhere'))).toBe(true);+ for (const origin of origins) {+ const evidence = origin.closest('tr')!;+ expect(evidence).toHaveTextContent('main / pve-1');+ expect(evidence).toHaveTextContent('Verified');+ }+ expect(screen.getByRole('button', { name: '1 unknown' })).toBeInTheDocument();+ expect(api.fetch).toHaveBeenCalledTimes(2);+ });++ it('keeps a missing source explicit instead of borrowing the guest connection or namespace', async () => {+ mount(() => [identityPBS({ instance: undefined })]);+ const [row] = await inventoryRows();+ expect(connectionOf(row)).toBe('Connection: Unknown connection');+ fireEvent.click(within(row).getByRole('button', { name: /expand details/i }));+ const detail = screen.getByTestId('proxmox-recoverable-detail');+ const connectionRow = within(detail).getByText('Connection').closest('tr')!;+ expect(connectionRow).toHaveTextContent('Not reported');+ expect(connectionRow).not.toHaveTextContent('east');+ expect(connectionRow).not.toHaveTextContent('pve-1');+ expect(detail).toHaveTextContent('main / pve-1');+ });++ it('updates the same point and open detail through ordinary polling without replacing focus', async () => {+ vi.useFakeTimers({+ now: BACKUP_IDENTITY_NOW,+ toFake: ['Date', 'setInterval', 'clearInterval'],+ });+ let current = points();+ mount(() => current);+ const rows = await inventoryRows();+ const row = rows.find((item) => connectionOf(item) === 'Connection: pbs-east')!;+ expect(row).toBeDefined();+ const toggle = within(row).getByRole('button', { name: /expand details/i });+ fireEvent.click(toggle);+ toggle.focus();+ const detail = screen.getByTestId('proxmox-recoverable-detail');+ const origin = row.querySelector('[data-backup-source-connection]');+ current = points('pbs-renamed');+ await vi.advanceTimersByTimeAsync(30_000);+ await waitFor(() => expect(connectionOf(row)).toBe('Connection: pbs-renamed'));+ expect(row.querySelector('[data-backup-source-connection]')).toBe(origin);+ expect(screen.getByTestId('proxmox-recoverable-detail')).toBe(detail);+ expect(within(detail).getByText('pbs-renamed')).toBeInTheDocument();+ expect(within(detail).queryByText('pbs-east')).not.toBeInTheDocument();+ expect(document.activeElement).toBe(toggle);+ expect(api.fetch).toHaveBeenCalledTimes(4);+ });++ it('renders connection text literally, never as markup', async () => {+ const name = '<img data-source-injected src=x>';+ mount(() => [identityPBS({ instance: name })]);+ const [row] = await inventoryRows();+ expect(connectionOf(row)).toBe(`Connection: ${name}`);+ fireEvent.click(within(row).getByRole('button', { name: /expand details/i }));+ expect(+ within(screen.getByTestId('proxmox-recoverable-detail')).getByText(name),+ ).toBeInTheDocument();+ expect(document.querySelector('[data-source-injected]')).toBeNull();+ });+});diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupLocation.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupLocation.test.tsindex f3692ba98b..cdba7ca7c5 100644--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupLocation.test.ts+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupLocation.test.ts@@ -55,6 +55,8 @@ describe('backup location identity', () => {expect(location('same', 'same').locationLabel).toBe('PBS · same / same');expect(location('', 'same').locationLabel).toBe('PBS · Unknown connection / same');expect(location('same', '').locationLabel).toBe('PBS · same / Unknown location');+ expect(location(' PBS-East ', 'main').locationConnection).toBe('PBS-East');+ expect(location(undefined, 'main').locationConnection).toBeUndefined();expect(location(undefined, undefined)).toEqual({});expect(location(' ', '')).toEqual({});});diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupLocation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupLocation.tsindex f39c556385..cb2c0963a6 100644--- a/frontend-modern/src/features/proxmox/proxmoxBackupLocation.ts+++ b/frontend-modern/src/features/proxmox/proxmoxBackupLocation.ts@@ -6,6 +6,8 @@ import {export interface BackupLocationScope {locationKey?: string;locationLabel?: string;+ /** The backup reader's connection, never inferred from the guest's placement. */+ locationConnection?: string;/** Read compatibility only; never write this lossy identity to a new URL. */legacyLocationKey?: string;}@@ -25,6 +27,7 @@ export function backupLocationScope(// not a colon-delimited display label. Preserve missing positions as well.locationKey: JSON.stringify([sourceKind, instance ?? '', repository ?? '']),locationLabel: `${getProxmoxBackupSourcePresentation(sourceKind).badgeLabel} · ${instance?.trim() || 'Unknown connection'} / ${repository?.trim() || 'Unknown location'}`,+ locationConnection: instance?.trim() || undefined,legacyLocationKey: [sourceKind, ...legacyParts].join(':'),};}diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx b/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsxindex 0dbed21c4f..97987ad43b 100644--- a/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx+++ b/frontend-modern/src/features/proxmox/proxmoxBackupsTableShared.tsx@@ -323,6 +323,30 @@ export function ArtifactSourceBadge(props: { artifact: RecoverableArtifact; wrap);}+// A provider kind and a repository name do not identify a backup's origin:+// separate connections can both contain "main". Coverage wraps the full+// connection; the compact list keeps it in its cell and its drawer shows it whole.+export function ArtifactSourceIdentity(props: { artifact: RecoverableArtifact; wrap?: boolean }) {+ const connection = () => props.artifact.locationConnection || 'Unknown connection';+ return (+ <div class="min-w-0 space-y-0.5">+ <ArtifactSourceBadge artifact={props.artifact} wrap={props.wrap} />+ <span+ class={+ props.wrap+ ? 'block whitespace-normal text-muted leading-snug wrap-anywhere'+ : 'block truncate text-muted'+ }+ title={`Connection: ${connection()}`}+ data-backup-source-connection+ >+ <span class="sr-only">Connection: </span>+ {connection()}+ </span>+ </div>+ );+}+const proxmoxBackupWorkloadBadgeType = (type: WorkloadReference['type'],): string | null | undefined => {