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
Canonicalize reporting single-file fallback subject
rcourtman6dcfca9831ac
diff --git a/docs/API.md b/docs/API.mdindex b43d9f17ff..3d4cf99713 100644--- a/docs/API.md+++ b/docs/API.md@@ -403,7 +403,7 @@ Triggers a test alert to all configured channels.### Advanced Reporting (Pro)- `GET /api/admin/reports/catalog` (admin, `settings:read`)- - Returns the canonical reporting catalog for the settings surface, including locked-state teaser copy, enabled-surface guidance copy, performance-report options, canonical fallback filename date style, and the nested VM inventory export definition.+ - Returns the canonical reporting catalog for the settings surface, including locked-state teaser copy, enabled-surface guidance copy, performance-report options, canonical single-report filename subject, canonical fallback filename date style, and the nested VM inventory export definition.- Metadata route: readable without the `advanced_reporting` feature so locked admin surfaces can render the same reporting definition before upsell.- `GET /api/admin/reports/generate` (admin, `settings:read`)- Query params: `format` (pdf/csv, default `pdf`), `resourceType`, `resourceId`, `metricType` (optional), `start`/`end` (RFC3339, optional; defaults to last 24h), `title` (optional)diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 71eb0b9a84..5bd85bd6a3 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -272,8 +272,9 @@ transport validation and download semantics. `internal/api/metrics_reporting_hanand `internal/api/reporting_inventory_handlers.go` must derive allowed formats,default format selection, multi-resource limits, optional metric/title fieldemission, canonical default-title fallback, default fallback range window,-attachment filename stems, filename date-stamp style, and invalid-format validation copy from the-canonical reporting definitions instead of hardcoding a second local contract.+attachment filename stems, single-report filename subject, filename date-stamp+style, and invalid-format validation copy from the canonical reporting+definitions instead of hardcoding a second local contract.Frontend consumers may still keep a local fallback filename for defensivedownload behavior, but when the server returns `Content-Disposition` they mustprefer that attachment filename as the canonical transport output.@@ -1354,9 +1355,15 @@ those same handlers must preserve that normalized shape back out through`display.itemType` and facet option payloads instead of forcing frontendsurfaces to re-derive cross-platform recovery categories from raw`subjectType`.+That same recovery API boundary now treats `platform` as the canonical+operator-facing query field across `/api/recovery/rollups`, `/api/recovery/points`,+`/api/recovery/series`, and `/api/recovery/facets`. The handlers may continue+mapping that boundary onto internal provider fields, but accepted legacy+`provider` aliases must be compatibility-only input and must not replace the+canonical transport query shape.`internal/api/contract_test.go` is the canonical proof owner for thatboundary, so route and query compatibility like `itemType` and accepted alias-inputs such as `type` must be pinned there whenever the shared recovery+inputs such as `type` or legacy `provider` must be pinned there whenever the shared recoverytransport shape changes.The same rule now also covers optional nested node cluster endpoint collectionsso `frontend-modern/src/api/nodes.ts` does not own its owndiff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex dc6e312024..147ea1ddce 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -201,6 +201,9 @@ or fallback filename date-stamp styleswhen the catalog ispresent; the first valid selection and all request semantics must come from theparsed backend definition.+That same fallback contract also includes the single-report filename subject,+so frontend download builders may not substitute resource display names when+the catalog says fallback attachment names are keyed off canonical resource IDs.That same reporting transport contract also means the frontend download pathmust prefer the backend `Content-Disposition` filename over any locally builtfallback name when a report or inventory export response arrives.@@ -675,6 +678,9 @@ recovery filters such as the provider-neutral `itemType` selector must bederived, normalized, and fanned out to inventory, history, activity, facets,and series consumers from that shared state owner rather than being recreatedas page-local toolbar state inside individual recovery sections.+That same shared recovery state owner now also keeps `platform` as the+canonical route and transport filter name for operator-facing recovery links,+while any accepted legacy `provider` aliases remain parser compatibility only.`frontend-modern/src/utils/problemResourcePresentation.ts` now also belongs tothat same dashboard overview boundary so the problem-resource severity contractstays shared with `ProblemResourcesTable.tsx` instead of floating as andiff --git a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsxindex f51ddaacb0..ea2373daee 100644--- a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx@@ -38,6 +38,7 @@ const baseCatalog = {singleResourceEndpoint: '/api/admin/reports/generate',multiResourceEndpoint: '/api/admin/reports/generate-multi',singleFilenamePrefix: 'report',+ singleFilenameSubject: 'resource_id',multiFilenamePrefix: 'fleet-report',filenameDateStyle: 'utc_yyyymmdd',formats: [diff --git a/frontend-modern/src/components/Settings/__tests__/reportingCatalogModel.test.ts b/frontend-modern/src/components/Settings/__tests__/reportingCatalogModel.test.tsindex d22cd87498..71cfbf381b 100644--- a/frontend-modern/src/components/Settings/__tests__/reportingCatalogModel.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/reportingCatalogModel.test.ts@@ -23,6 +23,7 @@ const baseCatalogPayload = {singleResourceEndpoint: '/api/admin/reports/generate',multiResourceEndpoint: '/api/admin/reports/generate-multi',singleFilenamePrefix: 'report',+ singleFilenameSubject: 'resource_id',multiFilenamePrefix: 'fleet-report',filenameDateStyle: 'utc_yyyymmdd',formats: [@@ -125,6 +126,18 @@ describe('reporting catalog model', () => {).toThrow('Invalid reporting catalog payload');});+ it('rejects a catalog whose single filename subject is unsupported', () => {+ expect(() =>+ parseReportingCatalog({+ ...baseCatalogPayload,+ performanceReport: {+ ...baseCatalogPayload.performanceReport,+ singleFilenameSubject: 'resource_name',+ },+ }),+ ).toThrow('Invalid reporting catalog payload');+ });+it('rejects a catalog whose locked-state teaser is incomplete', () => {expect(() =>parseReportingCatalog({diff --git a/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts b/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.tsindex 97ca8563f2..8f6f351b88 100644--- a/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/reportingPanelModel.test.ts@@ -13,6 +13,7 @@ const performanceDefinition: ReportingPerformanceReportDefinition = {singleResourceEndpoint: '/api/admin/reports/generate',multiResourceEndpoint: '/api/admin/reports/generate-multi',singleFilenamePrefix: 'report',+ singleFilenameSubject: 'resource_id',multiFilenamePrefix: 'fleet-report',filenameDateStyle: 'utc_yyyymmdd',formats: [@@ -67,7 +68,7 @@ describe('reporting panel model', () => {title: '',}, performanceDefinition);- expect(request.filename).toBe('report-node-a-20260320.pdf');+ expect(request.filename).toBe('report-agent-1-20260320.pdf');expect(request.request.init).toBeUndefined();expect(request.request.url).toContain('/api/admin/reports/generate?');expect(request.request.url).toContain('resourceType=agent');@@ -236,4 +237,27 @@ describe('reporting panel model', () => {expect(request.filename).toBe('estate-20260320.csv');expect(request.request.url).toBe('/api/custom/reports/export');});++ it('sanitizes single-resource fallback filenames from the canonical resource id contract', () => {+ const now = new Date('2026-03-20T12:34:56.000Z');+ const resources: SelectedResource[] = [+ {+ id: 'lab/node:"quoted"\nvm',+ type: 'agent',+ name: 'node-a',+ },+ ];++ const request = buildReportingRequest({+ end: now.toISOString(),+ format: 'pdf',+ metricType: '',+ now,+ resources,+ start: '2026-03-19T12:34:56.000Z',+ title: '',+ }, performanceDefinition);++ expect(request.filename).toBe('report-lab-node-quotedvm-20260320.pdf');+ });});diff --git a/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts b/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.tsindex 1ecb649549..9d36220757 100644--- a/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/useReportingPanelState.test.ts@@ -29,6 +29,7 @@ const catalogPayload = {singleResourceEndpoint: '/api/admin/reports/generate',multiResourceEndpoint: '/api/admin/reports/generate-multi',singleFilenamePrefix: 'report',+ singleFilenameSubject: 'resource_id',multiFilenamePrefix: 'fleet-report',filenameDateStyle: 'utc_yyyymmdd',formats: [diff --git a/frontend-modern/src/components/Settings/reportingCatalogModel.ts b/frontend-modern/src/components/Settings/reportingCatalogModel.tsindex 20df328df1..8998935ed9 100644--- a/frontend-modern/src/components/Settings/reportingCatalogModel.ts+++ b/frontend-modern/src/components/Settings/reportingCatalogModel.ts@@ -5,6 +5,7 @@ import {export type ReportingFormat = 'pdf' | 'csv';export type ReportingFilenameDateStyle = 'utc_yyyymmdd';+export type ReportingFilenameSubject = 'resource_id';export interface ReportingFormatDefinition {value: ReportingFormat;@@ -25,6 +26,7 @@ export interface ReportingPerformanceReportDefinition {singleResourceEndpoint: string;multiResourceEndpoint: string;singleFilenamePrefix: string;+ singleFilenameSubject: ReportingFilenameSubject;multiFilenamePrefix: string;filenameDateStyle: ReportingFilenameDateStyle;formats: ReportingFormatDefinition[];@@ -116,6 +118,7 @@ function parseReportingPerformanceReportDefinition(typeof candidate.singleResourceEndpoint !== 'string' ||typeof candidate.multiResourceEndpoint !== 'string' ||typeof candidate.singleFilenamePrefix !== 'string' ||+ candidate.singleFilenameSubject !== 'resource_id' ||typeof candidate.multiFilenamePrefix !== 'string' ||candidate.filenameDateStyle !== 'utc_yyyymmdd' ||!Array.isArray(candidate.formats) ||@@ -150,6 +153,7 @@ function parseReportingPerformanceReportDefinition(singleResourceEndpoint: candidate.singleResourceEndpoint,multiResourceEndpoint: candidate.multiResourceEndpoint,singleFilenamePrefix: candidate.singleFilenamePrefix,+ singleFilenameSubject: candidate.singleFilenameSubject,multiFilenamePrefix: candidate.multiFilenamePrefix,filenameDateStyle: candidate.filenameDateStyle,formats,diff --git a/frontend-modern/src/components/Settings/reportingPanelModel.ts b/frontend-modern/src/components/Settings/reportingPanelModel.tsindex 85d4172c1b..fda20b01a1 100644--- a/frontend-modern/src/components/Settings/reportingPanelModel.ts+++ b/frontend-modern/src/components/Settings/reportingPanelModel.ts@@ -48,20 +48,44 @@ export function getReportingRangeStart(export function buildReportingFilename(format: ReportingFormat,- resourceName: string | null,+ resourceID: string | null,now: Date,definition: Pick<ReportingPerformanceReportDefinition,- 'filenameDateStyle' | 'multiFilenamePrefix' | 'singleFilenamePrefix'+ | 'filenameDateStyle'+ | 'multiFilenamePrefix'+ | 'singleFilenamePrefix'+ | 'singleFilenameSubject'>,): string {const date = formatReportingFilenameDate(now, definition.filenameDateStyle);- if (resourceName) {- return `${definition.singleFilenamePrefix}-${resourceName}-${date}.${format}`;+ if (resourceID) {+ return `${definition.singleFilenamePrefix}-${sanitizeReportingFilenameSubject(resourceID, definition.singleFilenameSubject)}-${date}.${format}`;}return `${definition.multiFilenamePrefix}-${date}.${format}`;}+function sanitizeReportingFilenameSubject(+ value: string,+ subject: Pick<ReportingPerformanceReportDefinition, 'singleFilenameSubject'>['singleFilenameSubject'],+): string {+ switch (subject) {+ case 'resource_id': {+ let sanitized = value;+ sanitized = sanitized.replaceAll('"', '');+ sanitized = sanitized.replaceAll('\\', '');+ sanitized = sanitized.replaceAll('/', '-');+ sanitized = sanitized.replaceAll(':', '-');+ sanitized = sanitized.replaceAll('\r', '');+ sanitized = sanitized.replaceAll('\n', '');+ if (sanitized.length > 64) {+ sanitized = sanitized.slice(0, 64);+ }+ return sanitized;+ }+ }+}+export function buildReportingRequest(context: ReportingRequestContext,definition: Pick<@@ -70,6 +94,7 @@ export function buildReportingRequest(| 'multiResourceEndpoint'| 'filenameDateStyle'| 'singleFilenamePrefix'+ | 'singleFilenameSubject'| 'singleResourceEndpoint'| 'supportsCustomTitle'| 'supportsMetricFilter'@@ -96,7 +121,7 @@ export function buildReportingRequest(}return {- filename: buildReportingFilename(context.format, resource.name, context.now, definition),+ filename: buildReportingFilename(context.format, resource.id, context.now, definition),request: {url: `${definition.singleResourceEndpoint}?${params.toString()}`,},diff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex f2853c25eb..652d6ea745 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -364,6 +364,7 @@ func TestContract_ReportingCatalogJSONSnapshot(t *testing.T) {"singleResourceEndpoint":"/api/admin/reports/generate","multiResourceEndpoint":"/api/admin/reports/generate-multi","singleFilenamePrefix":"report",+ "singleFilenameSubject":"resource_id","multiFilenamePrefix":"fleet-report","filenameDateStyle":"utc_yyyymmdd","formats":[diff --git a/pkg/reporting/catalog.go b/pkg/reporting/catalog.goindex 8dc0cc1cdb..fd3f554256 100644--- a/pkg/reporting/catalog.go+++ b/pkg/reporting/catalog.go@@ -24,6 +24,8 @@ type ReportingRangeDefinition struct {WindowHours int `json:"windowHours"`}+const FilenameSubjectResourceID = "resource_id"+// PerformanceReportDefinition describes the canonical performance reporting// surface exposed to operators.type PerformanceReportDefinition struct {@@ -33,6 +35,7 @@ type PerformanceReportDefinition struct {SingleResourceEndpoint string `json:"singleResourceEndpoint"`MultiResourceEndpoint string `json:"multiResourceEndpoint"`SingleFilenamePrefix string `json:"singleFilenamePrefix"`+ SingleFilenameSubject string `json:"singleFilenameSubject"`MultiFilenamePrefix string `json:"multiFilenamePrefix"`FilenameDateStyle string `json:"filenameDateStyle"`Formats []ReportingFormatDefinition `json:"formats"`@@ -149,6 +152,7 @@ func DescribePerformanceReport() PerformanceReportDefinition {SingleResourceEndpoint: "/api/admin/reports/generate",MultiResourceEndpoint: "/api/admin/reports/generate-multi",SingleFilenamePrefix: "report",+ SingleFilenameSubject: FilenameSubjectResourceID,MultiFilenamePrefix: "fleet-report",FilenameDateStyle: FilenameDateStyleUTCYYYYMMDD,Formats: []ReportingFormatDefinition{diff --git a/pkg/reporting/catalog_test.go b/pkg/reporting/catalog_test.goindex e5d11bb568..e0e41dbfae 100644--- a/pkg/reporting/catalog_test.go+++ b/pkg/reporting/catalog_test.go@@ -23,6 +23,9 @@ func TestDescribeReportingCatalog_DefinesCanonicalSurfaces(t *testing.T) {if catalog.PerformanceReport.MultiResourceMax != 50 {t.Fatalf("multi-resource max = %d, want 50", catalog.PerformanceReport.MultiResourceMax)}+ if catalog.PerformanceReport.SingleFilenameSubject != FilenameSubjectResourceID {+ t.Fatalf("single filename subject = %q", catalog.PerformanceReport.SingleFilenameSubject)+ }if catalog.PerformanceReport.FilenameDateStyle != FilenameDateStyleUTCYYYYMMDD {t.Fatalf("filename date style = %q", catalog.PerformanceReport.FilenameDateStyle)}