Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

fix(updates): gate update-status polling by route authority

rcourtman98ecfb3f1014
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 00f40a2c9d..6d2263ee2d 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -4998,6 +4998,12 @@ likewise server-updater shell chrome, not assistant surface: its in-progress
stage vocabulary mirrors the backend updater pipeline (including the
`restoring` stage emitted by update rollback), and assistant state, drawer
ownership, and AI runtime surfaces must not key off those update stages.
+On authenticated installations that watcher also mounts only when the served
+`settingsCapabilities.systemSettingsRead` value mirrors the update-status
+route's `RequireAdmin` plus `settings:read` gate. Auth-free installations keep
+the watcher because those routes remain reachable there. Neither branch may
+become an Assistant capability, provider-readiness signal, or AI bootstrap
+probe.
That same shared shell boundary must respect blocking modal ownership.
`frontend-modern/src/App.tsx` and `frontend-modern/src/AppLayout.tsx` may use
the shared dialog runtime to hide the closed assistant launcher and close the
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index b6d658a1eb..12decc1901 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -3286,6 +3286,12 @@ global banner block in `frontend-modern/src/App.tsx` (security, demo,
commercial migration, update, what's-new, GitHub star) must be gated on the
same predicate because those banners deep-link into settings destinations a
scope-limited session cannot open.
+The global update progress watcher inside that block has a narrower,
+non-commercial authority boundary: authenticated sessions mount it only when
+`settingsCapabilities.systemSettingsRead` mirrors the update-status route's
+`RequireAdmin` plus `settings:read` gate, while auth-free installations keep
+it because their update routes remain reachable. That nested gate must not
+depend on plan, entitlement, organization, checkout, or upgrade-prompt state.
The authenticated shell may project tenant-local application branding only
through the narrow `GET /api/runtime/branding` response after normal session
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 97c07e3f1f..de16d2d943 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -2017,3 +2017,17 @@ Pinned by `auth_denial_signal_test.go`: below-threshold refusals stay at debug,
the escalation fires exactly once per window, a closed window re-arms it, a
username aggregates across addresses, separate callers keep separate budgets,
and the tracked set stays bounded.
+
+### Global update polling follows the route's served authority
+
+`/api/updates/status` remains protected by `RequireAdmin` plus
+`settings:read`. The authenticated app shell now mounts its five-second
+fallback watcher only when `/api/security/status` serves
+`settingsCapabilities.systemSettingsRead=true`, the capability derived from
+that same admin-and-scope predicate. Authenticated viewers therefore do not
+generate a perpetual stream of expected 403 responses. Auth-free installations
+remain an explicit exception: `requiresAuth=false` keeps the watcher mounted
+because `RequireAdmin` intentionally leaves the update route reachable there.
+The frontend behavior is pinned by `App.architecture.test.ts`, and
+`TestContract_SecurityStatusSystemSettingsReadTracksSettingsReadScope` pins the
+capability against both `/api/system/settings` and `/api/updates/status`.
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 34220f3466..a131fbe145 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -4954,6 +4954,13 @@ only for a session that can reach settings, using the single
handoff, demo organization suppression, and platform-page route carriage in
`frontend-modern/src/App.tsx` are unchanged; nothing about backup, restore, or
recovery routing keys off banner visibility.
+Within that block, the global update progress watcher now has its own route
+authority gate: authenticated sessions mount it only when
+`settingsCapabilities.systemSettingsRead` mirrors `RequireAdmin` plus
+`settings:read` on `/api/updates/status`, while auth-free installations keep
+the watcher because the route remains reachable. This shell-only gate does not
+alter recovery settings admission, backup polling, export/import authority, or
+any persisted recovery state.
The persisted `reportBranding` object remains adjacent tenant/runtime
configuration rather than storage inventory or recovery state. The
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 750b629ba7..8fce7f1452 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,55 +1,34 @@
{
"version": 1,
- "base_sha": "ff03168e5eec670822fcd0a5315cf84f6ac74bd1",
- "verified_at": "2026-08-08T00:17:09Z",
+ "base_sha": "7a0f410508822afed26c23cd3e715fbeaae3c420",
+ "verified_at": "2026-08-08T00:21:37Z",
"result": "passed",
- "changed_paths": [
- "frontend-modern/src/components/Settings/Settings.tsx",
- "frontend-modern/src/components/Settings/settingsNavCatalog.ts",
- "frontend-modern/src/components/Settings/settingsNavVisibility.ts",
- "frontend-modern/src/components/Settings/useSettingsAccess.ts",
- "frontend-modern/src/types/config.ts"
- ],
+ "changed_paths": ["frontend-modern/src/App.tsx"],
"content_sha256": {
- "frontend-modern/src/components/Settings/Settings.tsx": "3053ee87a22ed5eecff3f9edac20260c23b5f6a48c80ce2ff592ff74b8687da2",
- "frontend-modern/src/components/Settings/settingsNavCatalog.ts": "4bed8aa881bc59af56119e079ed97dc23ac9d983e227f3f0d4877e3ae3d20d04",
- "frontend-modern/src/components/Settings/settingsNavVisibility.ts": "eefa115abc68f9b9f636eb105bbd1b71c529ec9f731bb4eb6de785c26eae2c83",
- "frontend-modern/src/components/Settings/useSettingsAccess.ts": "895b74346f56e10f0a21fc2e808cf098a9b956da262b3b73ba067b46c30b8339",
- "frontend-modern/src/types/config.ts": "9dc0faa8e9b41eab526245aae72e447535709108c0b109c76545ab73500a2588"
+ "frontend-modern/src/App.tsx": "689e80b118c2772f1ed8811897579f0677fb74cd19172640028f6f34b3b93112"
},
- "routes": [
- "/settings",
- "/settings/monitoring/availability",
- "/settings/pulse-intelligence/provider",
- "/settings/pulse-intelligence/patrol",
- "/settings/pulse-intelligence/assistant",
- "/settings/support/diagnostics",
- "/settings/support/reporting",
- "/settings/support/logs"
- ],
+ "routes": ["/proxmox/overview", "/api/security/status", "/api/updates/status"],
"viewports": [
{
"width": 1280,
"height": 800
},
{
- "width": 390,
+ "width": 375,
"height": 812
}
],
"states": [
- "Real proxy-auth viewer at 1280x800: /settings settled on /settings/system-general, the General panel rendered, and the Settings navigation contained only Plans & Billing, General, and Security Overview; Availability checks, Provider & Models, Patrol, Assistant, Diagnostics & Health, Data & Reports, and System Logs were absent.",
- "Same viewer from each named admin-only deep link: all seven routes settled on /settings/system-general. An instrumented proxy recorded an empty request list for /api/availability-targets, /api/settings/ai*, /api/diagnostics*, /api/admin/reports*, and /api/logs*, proving the panels did not mount during first paint or fallback.",
- "Real proxy-auth administrator at 1280x800: all seven navigation entries remained visible; opening each rendered its expected heading at its canonical route. security/status returned all five named capabilities true, and the representative read routes returned 200.",
- "Viewer at 390x812: /settings again settled on General; the opened mobile Settings drawer contained only Plans & Billing, General, and Security Overview, and document scroll width equalled the 390px viewport.",
- "Administrator at 390x812: /settings/support/logs rendered the System Logs panel, and document scroll width equalled the 390px viewport."
+ "An authenticated proxy viewer received requiresAuth=true and systemSettingsRead=false; the normal application shell rendered and no /api/updates/status request was emitted during an 11.5 second observation window.",
+ "An authenticated proxy administrator received requiresAuth=true and systemSettingsRead=true; the normal application shell rendered and three /api/updates/status requests were emitted during an 11.5 second observation window.",
+ "An auth-free backend returned requiresAuth=false without settings capabilities and continued to serve /api/updates/status with HTTP 200.",
+ "The administrator shell rendered at 1280x800 and 375x812 with document scroll width equal to the viewport width."
],
"interactions": [
- "Built the current production frontend embed and current backend binary, then ran them on isolated localhost ports behind disposable viewer and administrator proxy-auth identities.",
- "Loaded /settings as the viewer, inspected the desktop navigation and General panel, then loaded every named admin-only deep link and checked its settled URL.",
- "Captured protected API-family requests in the viewer proxy while exercising /settings and all seven direct deep links; the captured list remained empty.",
- "Loaded /settings as the administrator and clicked Availability checks, Provider & Models, Patrol, Assistant, Diagnostics & Health, Data & Reports, and System Logs, checking each canonical URL and rendered page heading.",
- "Loaded the viewer at 390x812, opened the mobile Settings drawer, inspected its entries and horizontal overflow, then loaded System Logs as the administrator at the same viewport and checked its rendered heading and overflow.",
- "Read the administrator security-status capability projection and representative protected read routes as a backend A/B control; all five capabilities were true and all five routes returned 200."
+ "Built and launched an isolated backend with proxy authentication plus separate header-injecting viewer and administrator proxies.",
+ "Loaded the authenticated viewer shell, observed two polling intervals, and confirmed the proxy logged no update-status requests while the direct route correctly returned HTTP 403.",
+ "Loaded the authenticated administrator shell, observed two polling intervals, and confirmed the proxy logged three update-status requests while the direct route returned HTTP 200.",
+ "Restarted the isolated backend without authentication and confirmed both the public security status and the still-open update-status route returned HTTP 200.",
+ "Inspected the administrator shell at desktop and narrow viewports and confirmed there was no horizontal document overflow."
]
}
diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx
index a5e0656c6c..00f1f1c0cd 100644
--- a/frontend-modern/src/App.tsx
+++ b/frontend-modern/src/App.tsx
@@ -73,6 +73,7 @@ import {
type PrimaryPlatformNavId,
} from '@/features/platformNavigation/platformNavigationModel';
import type { Resource } from '@/types/resource';
+import type { SecurityStatusSettingsCapabilities } from '@/types/config';
function isPublicRoutePath(pathname: string): boolean {
// Public routes must be viewable without authentication.
@@ -153,6 +154,27 @@ export function getDefaultWorkspaceRoute(
return hasSettingsAccess ? '/settings/infrastructure' : '/alerts';
}
+/**
+ * Mirrors the RequireAdmin + settings:read gate on /api/updates/status.
+ * Auth-free installations remain allowed because RequireAdmin intentionally
+ * leaves their update routes reachable even though security status is public.
+ */
+export function sessionCanReadUpdateStatus(
+ status:
+ | {
+ requiresAuth: boolean;
+ settingsCapabilities?: Pick<
+ SecurityStatusSettingsCapabilities,
+ 'systemSettingsRead'
+ > | null;
+ }
+ | null
+ | undefined,
+): boolean {
+ if (!status || !status.requiresAuth) return true;
+ return status.settingsCapabilities?.systemSettingsRead === true;
+}
+
async function preloadAppShellRoutes() {
await Promise.all(
APP_SHELL_ROUTE_PRELOAD_PATHS.map(async (route) => {
@@ -307,6 +329,9 @@ function App() {
const hasSettingsAccess = createMemo(() =>
sessionHasSettingsAccess(runtime.securityStatus()?.tokenScopes),
);
+ const canReadUpdateStatus = createMemo(() =>
+ sessionCanReadUpdateStatus(runtime.securityStatus()),
+ );
let appShellRoutePreloadCleanup: (() => void) | undefined;
let appShellRoutesPreloadScheduled = false;
let workspaceRedirectPending = false;
@@ -512,7 +537,9 @@ function App() {
<WhatsNewCard />
<GitHubStarBanner />
<BusinessEstateCard />
- <GlobalUpdateProgressWatcher />
+ <Show when={canReadUpdateStatus()}>
+ <GlobalUpdateProgressWatcher />
+ </Show>
</Show>
{/* Main layout container - flexbox to allow AI panel to push content */}
<div class="flex h-screen overflow-hidden">
diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.ts
index 1b624e4f61..58bbb2e65e 100644
--- a/frontend-modern/src/__tests__/App.architecture.test.ts
+++ b/frontend-modern/src/__tests__/App.architecture.test.ts
@@ -1,7 +1,11 @@
import { readdirSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';
-import { getDefaultWorkspaceRoute, resolvePlatformNavigationAdmission } from '@/App';
+import {
+ getDefaultWorkspaceRoute,
+ resolvePlatformNavigationAdmission,
+ sessionCanReadUpdateStatus,
+} from '@/App';
import appSource from '@/App.tsx?raw';
import appLayoutSource from '@/AppLayout.tsx?raw';
import appRuntimeContextSource from '@/contexts/appRuntime.ts?raw';
@@ -108,6 +112,45 @@ describe('App platform navigation admission', () => {
});
});
+describe('Global update progress authorization', () => {
+ it('keeps the watcher available when update routes are open without authentication', () => {
+ expect(
+ sessionCanReadUpdateStatus({
+ requiresAuth: false,
+ settingsCapabilities: undefined,
+ }),
+ ).toBe(true);
+ });
+
+ it('follows the served system-settings capability on authenticated installations', () => {
+ expect(
+ sessionCanReadUpdateStatus({
+ requiresAuth: true,
+ settingsCapabilities: {
+ systemSettingsRead: true,
+ },
+ }),
+ ).toBe(true);
+ expect(
+ sessionCanReadUpdateStatus({
+ requiresAuth: true,
+ settingsCapabilities: {
+ systemSettingsRead: false,
+ },
+ }),
+ ).toBe(false);
+ });
+
+ it('fails closed when an authenticated status omits the route capability', () => {
+ expect(
+ sessionCanReadUpdateStatus({
+ requiresAuth: true,
+ settingsCapabilities: undefined,
+ }),
+ ).toBe(false);
+ });
+});
+
describe('App architecture', () => {
it('keeps every top-level destination on the same wide shell contract', () => {
expect(appStylesSource).toContain('--pulse-shell-max-width: min(97vw, 1920px)');
@@ -359,6 +402,18 @@ describe('App architecture', () => {
expect(appSource).not.toContain("'installing'");
});
+ it('mounts the update progress watcher only behind its route capability', () => {
+ expect(appSource).toContain('sessionCanReadUpdateStatus(runtime.securityStatus())');
+ expect(appSource).toContain('return status.settingsCapabilities?.systemSettingsRead === true;');
+ expect(appSource).toContain('if (!status || !status.requiresAuth) return true;');
+
+ const watcherGate = appSource.indexOf('<Show when={canReadUpdateStatus()}>');
+ const watcherMount = appSource.indexOf('<GlobalUpdateProgressWatcher />');
+ expect(watcherGate).toBeGreaterThan(-1);
+ expect(watcherMount).toBeGreaterThan(watcherGate);
+ expect(appSource.split('<GlobalUpdateProgressWatcher />')).toHaveLength(2);
+ });
+
it('keeps integration browser proofs off the retired AI route', () => {
const routesSource = readFileSync(join(integrationTestsDir, 'routes.ts'), 'utf8');
const retiredRouteNavigations = readIntegrationTestSources(integrationTestsDir).flatMap(
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index 19b0e2bbff..ea9b279170 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -11037,15 +11037,18 @@ func TestContract_SecurityStatusSystemSettingsReadTracksSettingsReadScope(t *tes
payload.SettingsCapabilities.SystemSettingsRead, tc.want)
}
- // The capability is only honest if the routes behind the tabs agree.
- probe := httptest.NewRequest(http.MethodGet, "/api/system/settings", nil)
- probe.Header.Set("X-API-Token", rawToken)
- probeRec := httptest.NewRecorder()
- router.Handler().ServeHTTP(probeRec, probe)
- refused := probeRec.Code == http.StatusForbidden
- if refused == tc.want {
- t.Fatalf("GET /api/system/settings = %d, which contradicts systemSettingsRead=%v",
- probeRec.Code, tc.want)
+ // The capability is only honest if the routes behind the System tabs
+ // and the global update watcher agree with it.
+ for _, path := range []string{"/api/system/settings", "/api/updates/status"} {
+ probe := httptest.NewRequest(http.MethodGet, path, nil)
+ probe.Header.Set("X-API-Token", rawToken)
+ probeRec := httptest.NewRecorder()
+ router.Handler().ServeHTTP(probeRec, probe)
+ refused := probeRec.Code == http.StatusForbidden
+ if refused == tc.want {
+ t.Fatalf("GET %s = %d, which contradicts systemSettingsRead=%v",
+ path, probeRec.Code, tc.want)
+ }
}
})
}