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
Keep unified resource results with their admitted reader
pulse-triage[bot]6b0e47dd3a35
diff --git a/internal/api/router_routes_monitoring.go b/internal/api/router_routes_monitoring.goindex a972730acc..f471568f7a 100644--- a/internal/api/router_routes_monitoring.go+++ b/internal/api/router_routes_monitoring.go@@ -42,15 +42,23 @@ func (r *Router) registerMonitoringResourceRoutes(r.registerPBSBackupsRoutes()r.registerPMGRoutes()+ // Unified query results can wait on inventory or retained evidence after+ // admission. Keep the admitted reader through every response (including+ // errors), without changing mutation admission or the work's lifetime.+ resourceRead := func(next http.HandlerFunc) http.HandlerFunc {+ return RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead,+ retainTokenResponseAuthority(r.config, config.ScopeMonitoringRead, false, next)))+ }+// Unified resources API- r.mux.HandleFunc("/api/resources", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleListResources)))- r.mux.HandleFunc("/api/resources/storage-incidents", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleStorageIncidents)))- r.mux.HandleFunc("/api/resources/storage-summary", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleStorageSummary)))- r.mux.HandleFunc("/api/resources/stats", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleStats)))- r.mux.HandleFunc("/api/resources/k8s/namespaces", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleK8sNamespaces)))- r.mux.HandleFunc("/api/resources/timeline", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleListResourceTimeline)))- r.mux.HandleFunc("/api/resources/{id}/facets", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleGetResourceFacets)))- r.mux.HandleFunc("/api/resources/{id}/timeline", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.resourceHandlers.HandleGetResourceTimeline)))+ r.mux.HandleFunc("/api/resources", resourceRead(r.resourceHandlers.HandleListResources))+ r.mux.HandleFunc("/api/resources/storage-incidents", resourceRead(r.resourceHandlers.HandleStorageIncidents))+ r.mux.HandleFunc("/api/resources/storage-summary", resourceRead(r.resourceHandlers.HandleStorageSummary))+ r.mux.HandleFunc("/api/resources/stats", resourceRead(r.resourceHandlers.HandleStats))+ r.mux.HandleFunc("/api/resources/k8s/namespaces", resourceRead(r.resourceHandlers.HandleK8sNamespaces))+ r.mux.HandleFunc("/api/resources/timeline", resourceRead(r.resourceHandlers.HandleListResourceTimeline))+ r.mux.HandleFunc("/api/resources/{id}/facets", resourceRead(r.resourceHandlers.HandleGetResourceFacets))+ r.mux.HandleFunc("/api/resources/{id}/timeline", resourceRead(r.resourceHandlers.HandleGetResourceTimeline))// Per-resource operator-set state. GET is read; PUT/DELETE are// governance-shaping writes (suppress findings, refuse remediation,// schedule maintenance) so they require the write scope. Method-keyed@@ -63,6 +71,8 @@ func (r *Router) registerMonitoringResourceRoutes(return}r.recordExternalAgentCapabilityActivity(req, agentcapabilities.GetOperatorStateCapabilityName)+ retainTokenResponseAuthority(r.config, config.ScopeMonitoringRead, false, r.resourceHandlers.HandleResourceOperatorState)(w, req)+ returncase http.MethodPut, http.MethodDelete:if !ensureScope(w, req, config.ScopeMonitoringWrite) {return@@ -84,9 +94,9 @@ func (r *Router) registerMonitoringResourceRoutes(// for the same reason. Wired before the broad `/api/resources/`// catch-all so the more specific paths route here.if r.maintenanceVerificationHandlers != nil {- r.mux.HandleFunc("/api/resources/{id}/maintenance-verifications", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.maintenanceVerificationHandlers.HandleListForResource)))+ r.mux.HandleFunc("/api/resources/{id}/maintenance-verifications", resourceRead(r.maintenanceVerificationHandlers.HandleListForResource))r.mux.HandleFunc("POST /api/resources/{id}/maintenance-verifications/rerun", RequireAuth(r.config, RequireScope(config.ScopeMonitoringWrite, r.maintenanceVerificationHandlers.HandleRerun)))- r.mux.HandleFunc("/api/maintenance-verifications/{reportId}", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.maintenanceVerificationHandlers.HandleGet)))+ r.mux.HandleFunc("/api/maintenance-verifications/{reportId}", resourceRead(r.maintenanceVerificationHandlers.HandleGet))r.mux.HandleFunc("POST /api/maintenance-verifications/{reportId}/review", RequireAuth(r.config, RequireScope(config.ScopeMonitoringWrite, r.maintenanceVerificationHandlers.HandleReview)))}// HandleResourceRoutes also dispatches POST link, unlink and report-merge,@@ -100,6 +110,10 @@ func (r *Router) registerMonitoringResourceRoutes(if !ensureScope(w, req, scope) {return}+ if scope == config.ScopeMonitoringRead {+ retainTokenResponseAuthority(r.config, scope, false, r.resourceHandlers.HandleResourceRoutes)(w, req)+ return+ }r.resourceHandlers.HandleResourceRoutes(w, req)}))// Agent-consumable bundled context — substrate for any LLM agent