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
feat(commercial): treat the compiled Pro edition as commercial context
rcourtman766253ed04b5
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 7dd485c2d1..87d49f0cb7 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -5456,11 +5456,15 @@ gated by `shouldShowSetupProActivationPointer` requiring an explicitlyinvalid license, never a failed or missing probe), the completion panelrenders a factual activation card whose action targets the direct`/settings/pulse-intelligence/billing/plan` route. That direct-route target-is deliberate: the Plans & Billing navigation entry stays-navigation-suppressed for unlicensed self-hosted sessions, so the pointer-must not instruct users to find a hidden nav item, and it must never appear-on community builds, licensed installs, or probe failures — the self-hosted-opt-in commercial posture is unchanged.+is deliberate: it must not depend on any navigation entry being visible, and+the pointer must never appear on community builds, licensed installs, or+probe failures — the community self-hosted opt-in commercial posture is+unchanged. On compiled Pro-edition binaries the served presentation policy+now also exposes the Plans & Billing navigation entry before activation+(edition-derived commercial context in the security-status contract), so the+first-run pointer and the visible nav entry together close the activation+handoff; the pointer keeps its own explicit license gate rather than+inheriting the nav policy.Agent-facing action completion events and resource-context history now exposethe canonical `ActionResultV2` alongside bounded legacy projections. Consumersdiff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex f4e4667333..29cd6cb9f2 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -5244,8 +5244,15 @@ For ordinary free self-hosted v6 installs, that same security-status contractowns the opt-in commercial posture: `hideUpgrade` defaults true so navigation,upgrade links, plan upsells, and proactive prompts fail closed. Hosted sessionsand installs with existing paid, activation, or recovery context may receive-`hideUpgrade=false`. `hideCommercial` remains the stronger suppression boundary-for demo mode and white-label runtimes. API consumers must treat both fields as+`hideUpgrade=false`. The compiled Pro edition (`pkg/edition`, set only by the+separately compiled Pro binary and never by license-active state) is such paid+context: a Pro-edition session serves `hideUpgrade=false` even before its+license activates, because the Pro binary reaches an install only through the+paid broker flow and hiding the Plans & Billing activation entry from it+strands a paying customer. Community binaries — with or without a license key+applied later — keep the opt-in default. `hideCommercial` remains the stronger+suppression boundary for demo mode and white-label runtimes and wins over+edition-derived context. API consumers must treat both fields aspresentation policy rather than as billing entitlement truth, and directactivation or recovery routes remain separately routeable.That same contract split also makes the licensing boundary explicit:diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 3cbced77d2..2f2171f31e 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -968,7 +968,12 @@ recovery scope, or a storage/recovery-owned secret source.copy may describe unavailable local capability, but ordinary self-hosted v6installs must not reinterpret `presentationPolicy.hideUpgrade` as a licenseupsell opportunity or surface paid history/recovery upgrade prompts by- default.+ default. `hideUpgrade` is now served false on compiled Pro-edition binaries+ even before license activation (edition-derived commercial context), so+ storage/recovery surfaces must keep following the served policy verbatim in+ both directions: they may show their existing gated-capability affordances+ when the policy exposes them, and they must not add edition- or+ license-sniffing of their own to re-suppress or re-expose paid prompts.5. Route canonical storage/recovery resource selection through `frontend-modern/src/hooks/useUnifiedResources.ts` and the owning `unified-resources` contractThat shared hook now also projects resource `clusterId` through the shared cluster-name helper, so storage and recovery links keep the same cluster-context label as other unified-resource consumers instead of rebuilding a local fallback chain.That shared hook plus the adjacent websocket/store adapter path must keepdiff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex db97a5a4d1..b3a3dbafc0 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -56,6 +56,7 @@ import ("github.com/rcourtman/pulse-go-rewrite/pkg/audit"authpkg "github.com/rcourtman/pulse-go-rewrite/pkg/auth""github.com/rcourtman/pulse-go-rewrite/pkg/cloudauth"+ "github.com/rcourtman/pulse-go-rewrite/pkg/edition"pkglicensing "github.com/rcourtman/pulse-go-rewrite/pkg/licensing"licensetestsupport "github.com/rcourtman/pulse-go-rewrite/pkg/licensing/testsupport""github.com/rcourtman/pulse-go-rewrite/pkg/metrics"@@ -10856,9 +10857,11 @@ func TestContract_PublicSecurityStatusIncludesDemoPresentationPolicy(t *testing.}func TestContract_SecurityStatusPresentationPolicyHidesUpgradeByDefault(t *testing.T) {- // Ordinary free self-hosted sessions stay opt-in. The billing route remains- // directly reachable, but the served policy suppresses upgrade prompts and- // navigation until there is hosted, paid, activation, or recovery context.+ // Ordinary free self-hosted sessions run the community binary and stay+ // opt-in. The billing route remains directly reachable, but the served+ // policy suppresses upgrade prompts and navigation until there is hosted,+ // paid, activation, or recovery context — which includes the compiled Pro+ // edition, covered by the ProEditionCommercialContext contract test below.cfg := newTestConfigWithTokens(t)cfg.DemoMode = false@@ -10919,6 +10922,85 @@ func TestContract_SecurityStatusPresentationPolicySuppressionInputs(t *testing.T}}+// The compiled Pro binary is only distributed through the paid broker flow, so+// a Pro-edition session is commercial context even before a license activates.+// Without this the Plans & Billing navigation entry — the only one holding the+// activation form — is hidden exactly while the install is unlicensed+// (support case 2026-08-09: a fresh Pro install could not find where to enter+// its activation key). Community binaries keep the opt-in default, and demo+// mode keeps every commercial surface suppressed regardless of edition.+func TestContract_SecurityStatusPresentationPolicyProEditionCommercialContext(t *testing.T) {+ servePresentationPolicy := func(t *testing.T, demoMode bool) map[string]any {+ t.Helper()++ cfg := newTestConfigWithTokens(t)+ cfg.DemoMode = demoMode++ router := NewRouter(cfg, nil, nil, nil, nil, "1.0.0")++ req := httptest.NewRequest(http.MethodGet, "/api/security/status", nil)+ rec := httptest.NewRecorder()+ router.Handler().ServeHTTP(rec, req)+ if rec.Code != http.StatusOK {+ t.Fatalf("security status = %d, want 200 (%s)", rec.Code, rec.Body.String())+ }++ var payload map[string]any+ if err := json.Unmarshal(rec.Body.Bytes(), &payload); err != nil {+ t.Fatalf("decode security status payload: %v", err)+ }+ presentationPolicy, ok := payload["presentationPolicy"].(map[string]any)+ if !ok {+ t.Fatalf("presentationPolicy = %#v, want object", payload["presentationPolicy"])+ }+ return presentationPolicy+ }++ assertPolicy := func(t *testing.T, presentationPolicy map[string]any, want map[string]bool) {+ t.Helper()+ for key, wantValue := range want {+ if got, _ := presentationPolicy[key].(bool); got != wantValue {+ t.Fatalf("presentationPolicy.%s = %v, want %v", key, presentationPolicy[key], wantValue)+ }+ }+ }++ t.Run("pro edition exposes commercial navigation before activation", func(t *testing.T) {+ edition.SetEdition(edition.Pro)+ t.Cleanup(func() { edition.SetEdition(edition.Community) })++ assertPolicy(t, servePresentationPolicy(t, false), map[string]bool{+ "demoMode": false,+ "readOnly": false,+ "hideCommercial": false,+ "hideUpgrade": false,+ })+ })++ t.Run("demo mode suppresses commercial surfaces even on the pro edition", func(t *testing.T) {+ edition.SetEdition(edition.Pro)+ t.Cleanup(func() { edition.SetEdition(edition.Community) })++ assertPolicy(t, servePresentationPolicy(t, true), map[string]bool{+ "demoMode": true,+ "readOnly": true,+ "hideCommercial": true,+ "hideUpgrade": true,+ })+ })++ t.Run("community edition keeps the opt-in default", func(t *testing.T) {+ edition.SetEdition(edition.Community)++ assertPolicy(t, servePresentationPolicy(t, false), map[string]bool{+ "demoMode": false,+ "readOnly": false,+ "hideCommercial": false,+ "hideUpgrade": true,+ })+ })+}+// Settings → Infrastructure reads only RequireAdmin + settings:read endpoints// and then polls two of them, so the served capability has to track the scope// exactly. A capability that over-reports puts a non-admin back on a page whosediff --git a/internal/api/security_status_capabilities.go b/internal/api/security_status_capabilities.goindex 17433b14c8..c633ef6d1a 100644--- a/internal/api/security_status_capabilities.go+++ b/internal/api/security_status_capabilities.go@@ -7,6 +7,7 @@ import ("github.com/rcourtman/pulse-go-rewrite/internal/config"internalauth "github.com/rcourtman/pulse-go-rewrite/pkg/auth"+ "github.com/rcourtman/pulse-go-rewrite/pkg/edition")type securityStatusSettingsCapabilities struct {@@ -315,8 +316,11 @@ func (r *Router) securityStatusSessionCapabilities(ctx context.Context) security// resolveSecurityStatusPresentationPolicy maps commercial suppression inputs// to the served policy. Ordinary free self-hosted sessions stay opt-in and do// not receive upgrade prompts. Hosted sessions and installs with existing paid-// or recovery context may expose the commercial navigation. Demo mode and-// white-label runtimes remain fully suppressed.+// or recovery context may expose the commercial navigation; a compiled+// Pro-edition binary counts as paid context because it is only distributed+// through the paid broker flow, and hiding Plans & Billing from it strands a+// customer with no way to find the activation form. Demo mode and white-label+// runtimes remain fully suppressed.func resolveSecurityStatusPresentationPolicy(demoMode, whiteLabel, commercialContext bool) securityStatusPresentationPolicy {hideCommercial := demoMode || whiteLabelreturn securityStatusPresentationPolicy{@@ -331,6 +335,15 @@ func (r *Router) securityStatusPresentationPolicy(ctx context.Context) securitySdemoMode := r != nil && r.config != nil && r.config.DemoModewhiteLabel := falsecommercialContext := r != nil && r.hostedMode+ if edition.IsPro() {+ // The compiled Pro binary reaches an install only through the paid+ // broker flow, so the session was never an ordinary free self-hosted+ // one — even before its license activates. Without this, the only+ // navigation entry holding the activation form is hidden exactly+ // while the install is unlicensed. Community binaries with or+ // without a license key are unaffected.+ commercialContext = true+ }if r != nil && !demoMode {if svc := getLicenseServiceForContext(ctx); svc != nil {whiteLabel = svc.HasFeature(featureWhiteLabelValue)