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
Hide deleted workspaces from portal APIs
rcourtman2d4da7e08e10
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 7e860dc323..f60b869ce1 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -887,6 +887,11 @@ path, signup path, and stable workspace summary fields such as `created_at`.That workspace summary contract must expose explicit health semantics: `healthy`for passing health checks, `checking` only when no completed health checkexists yet, and `unhealthy` for a failed latest health check.+That same portal API contract treats `deleting` and `deleted` tenants as+control-plane history, not visible workspace payloads: the browser bootstrap,+`/api/portal/dashboard`, and `/api/portal/workspaces/{tenant_id}` must filter+soft-deleted rows consistently, with detail reads returning `404` for hidden+workspaces rather than leaking retired runtime records into the account shell.That same shared `internal/api/` plus `internal/websocket/hub.go` boundary alsoowns browser websocket origin continuity for reverse-proxied runtimes. Same-hostbrowser origins must continue to connect when a reverse proxy preserves thediff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.mdindex 5838c76cdc..ab4f7c4760 100644--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md@@ -228,6 +228,11 @@ runtime gating as separate unlinked claims.`Summary` destination. The top of `Workspaces` may surface one quiet inlinefacts line plus one next-action row before the list, but it must not turnthat summary into a second overview deck, metric grid, or competing shell.+ Portal workspace payloads are live-workspace surfaces, not registry history+ dumps: tenants in `deleting` or `deleted` state must stay hidden from the+ browser bootstrap, `/api/portal/dashboard`, and workspace-detail API so+ soft-deleted runtime cleanup preserves billing/account continuity without+ presenting retired hosted workspaces as actionable customer state.Pulse Account self-hosted upgrade and pricing-preview copy must describeCommunity as included core monitoring plus paid Relay/Pro extras. It mustnot frame self-hosted checkout as buying unlimited monitoring or monitored-diff --git a/internal/cloudcp/portal/handlers.go b/internal/cloudcp/portal/handlers.goindex 75c09e16e1..950becc9c0 100644--- a/internal/cloudcp/portal/handlers.go+++ b/internal/cloudcp/portal/handlers.go@@ -115,7 +115,7 @@ func HandlePortalDashboard(reg *registry.TenantRegistry) http.HandlerFunc {}for _, t := range tenants {- if t == nil {+ if !isPortalVisibleTenant(t) {continue}@@ -190,6 +190,10 @@ func HandlePortalWorkspaceDetail(reg *registry.TenantRegistry) http.HandlerFunchttp.Error(w, "tenant not found", http.StatusNotFound)return}+ if !isPortalVisibleTenant(t) {+ http.Error(w, "tenant not found", http.StatusNotFound)+ return+ }resp := workspaceDetailResponse{Account: accountInfo{@@ -206,6 +210,13 @@ func HandlePortalWorkspaceDetail(reg *registry.TenantRegistry) http.HandlerFunc}}+func isPortalVisibleTenant(t *registry.Tenant) bool {+ if t == nil {+ return false+ }+ return t.State != registry.TenantStateDeleted && t.State != registry.TenantStateDeleting+}+// HandlePortalBootstrap returns the renderer-owned Pulse Account bootstrap payload.// Route: GET /api/portal/bootstrap//diff --git a/internal/cloudcp/portal/handlers_test.go b/internal/cloudcp/portal/handlers_test.goindex 8e12f1746f..0c8055a72f 100644--- a/internal/cloudcp/portal/handlers_test.go+++ b/internal/cloudcp/portal/handlers_test.go@@ -151,6 +151,14 @@ func TestPortalDashboard(t *testing.T) {if err != nil {t.Fatal(err)}+ tenantDeletedID, err := registry.GenerateTenantID()+ if err != nil {+ t.Fatal(err)+ }+ tenantDeletingID, err := registry.GenerateTenantID()+ if err != nil {+ t.Fatal(err)+ }created1 := time.Date(2026, 2, 10, 10, 0, 0, 0, time.UTC)created2 := time.Date(2026, 2, 10, 11, 0, 0, 0, time.UTC)@@ -177,6 +185,24 @@ func TestPortalDashboard(t *testing.T) {}); err != nil {t.Fatal(err)}+ if err := reg.Create(®istry.Tenant{+ ID: tenantDeletedID,+ AccountID: accountID,+ DisplayName: "Deleted Workspace",+ State: registry.TenantStateDeleted,+ CreatedAt: created2,+ }); err != nil {+ t.Fatal(err)+ }+ if err := reg.Create(®istry.Tenant{+ ID: tenantDeletingID,+ AccountID: accountID,+ DisplayName: "Deleting Workspace",+ State: registry.TenantStateDeleting,+ CreatedAt: created2,+ }); err != nil {+ t.Fatal(err)+ }req := httptest.NewRequest(http.MethodGet, "/api/portal/dashboard?account_id="+accountID, nil)rec := doRequest(t, mux, req)@@ -379,6 +405,39 @@ func TestPortalWorkspaceDetail(t *testing.T) {}}+func TestPortalWorkspaceDetailHidesDeletedWorkspaces(t *testing.T) {+ reg := newTestRegistry(t)+ mux := newTestMux(reg)++ accountID, err := registry.GenerateAccountID()+ if err != nil {+ t.Fatal(err)+ }+ if err := reg.CreateAccount(®istry.Account{ID: accountID, Kind: registry.AccountKindMSP, DisplayName: "Example MSP"}); err != nil {+ t.Fatal(err)+ }++ tenantID, err := registry.GenerateTenantID()+ if err != nil {+ t.Fatal(err)+ }+ if err := reg.Create(®istry.Tenant{+ ID: tenantID,+ AccountID: accountID,+ DisplayName: "Deleted Workspace",+ State: registry.TenantStateDeleted,+ CreatedAt: time.Date(2026, 2, 10, 10, 0, 0, 0, time.UTC),+ }); err != nil {+ t.Fatal(err)+ }++ req := httptest.NewRequest(http.MethodGet, "/api/portal/workspaces/"+tenantID+"?account_id="+accountID, nil)+ rec := doRequest(t, mux, req)+ if rec.Code != http.StatusNotFound {+ t.Fatalf("status = %d, want %d (body=%q)", rec.Code, http.StatusNotFound, rec.Body.String())+ }+}+// --- Billing portal redirect tests ---func newBillingHandler(t *testing.T, reg *registry.TenantRegistry, apiKey string, returnURL string,diff --git a/internal/cloudcp/portal/page.go b/internal/cloudcp/portal/page.goindex e546bb6a49..6dcd337901 100644--- a/internal/cloudcp/portal/page.go+++ b/internal/cloudcp/portal/page.go@@ -166,10 +166,7 @@ func loadPortalAccountsForUser(reg *registry.TenantRegistry, userID string) ([]pworkspaces := make([]portalPageWorkspace, 0, len(tenants))for _, t := range tenants {- if t == nil {- continue- }- if t.State == registry.TenantStateDeleted || t.State == registry.TenantStateDeleting {+ if !isPortalVisibleTenant(t) {continue}workspaces = append(workspaces, portalPageWorkspace{