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: Make container update alerts a free feature
rcourtman2cc921433642
diff --git a/internal/alerts/alerts.go b/internal/alerts/alerts.goindex 42a98b2db7..37ddb50b23 100644--- a/internal/alerts/alerts.go+++ b/internal/alerts/alerts.go@@ -4447,20 +4447,8 @@ func (m *Manager) checkDockerContainerImageUpdate(host models.DockerHost, contai// Check if update detection is enabledm.mu.RLock()delayHours := m.config.DockerDefaults.UpdateAlertDelayHours- hasProFeature := m.hasProFeaturem.mu.RUnlock()- // Update alerts are a Pro-only feature- // Free users still see update badges in the UI, but alerts require Pro- if hasProFeature != nil && !hasProFeature("update_alerts") {- // Not licensed for update alerts - clear any existing alert and tracking- m.clearAlert(alertID)- m.mu.Lock()- delete(m.dockerUpdateFirstSeen, resourceID)- m.mu.Unlock()- return- }-// Negative value means disabledif delayHours < 0 {m.clearAlert(alertID)diff --git a/internal/alerts/update_alerts_test.go b/internal/alerts/update_alerts_test.goindex 64c7f5677b..2ff3784feb 100644--- a/internal/alerts/update_alerts_test.go+++ b/internal/alerts/update_alerts_test.go@@ -238,143 +238,8 @@ func TestCheckDockerContainerImageUpdate(t *testing.T) {})}-func TestUpdateAlertProLicenseGating(t *testing.T) {- hostID := "docker-host-1"- containerName := "test-container"- instanceName := "docker-instance"- nodeName := "docker-node"- host := models.DockerHost{ID: hostID, DisplayName: "Test Host"}-- t.Run("no license checker - alerts work", func(t *testing.T) {- m := NewManager()- m.mu.Lock()- m.config.DockerDefaults.UpdateAlertDelayHours = 24- m.mu.Unlock()-- testResourceID := "docker:" + hostID + "/container-license-test-1"-- // Set up tracking as if we detected the update 25 hours ago- m.mu.Lock()- m.dockerUpdateFirstSeen[testResourceID] = time.Now().Add(-25 * time.Hour)- m.mu.Unlock()-- container := models.DockerContainer{- ID: "container-license-test-1",- Name: containerName,- Image: "nginx:latest",- UpdateStatus: &models.DockerContainerUpdateStatus{- UpdateAvailable: true,- CurrentDigest: "sha256:olddigest",- LatestDigest: "sha256:newdigest",- LastChecked: time.Now(),- },- }-- m.checkDockerContainerImageUpdate(host, container, testResourceID, containerName, instanceName, nodeName)-- alerts := m.GetActiveAlerts()- found := false- for _, a := range alerts {- if a.Type == "docker-container-update" {- found = true- break- }- }- if !found {- t.Error("Expected alert when no license checker is set")- }- })-- t.Run("pro license grants feature - alerts work", func(t *testing.T) {- m := NewManager()- m.mu.Lock()- m.config.DockerDefaults.UpdateAlertDelayHours = 24- m.mu.Unlock()- m.SetLicenseChecker(func(feature string) bool {- return feature == "update_alerts" // Grant the feature- })-- testResourceID := "docker:" + hostID + "/container-license-test-2"-- // Set up tracking as if we detected the update 25 hours ago- m.mu.Lock()- m.dockerUpdateFirstSeen[testResourceID] = time.Now().Add(-25 * time.Hour)- m.mu.Unlock()-- container := models.DockerContainer{- ID: "container-license-test-2",- Name: containerName,- Image: "nginx:latest",- UpdateStatus: &models.DockerContainerUpdateStatus{- UpdateAvailable: true,- CurrentDigest: "sha256:olddigest",- LatestDigest: "sha256:newdigest",- LastChecked: time.Now(),- },- }-- m.checkDockerContainerImageUpdate(host, container, testResourceID, containerName, instanceName, nodeName)-- alerts := m.GetActiveAlerts()- found := false- for _, a := range alerts {- if a.Type == "docker-container-update" {- found = true- break- }- }- if !found {- t.Error("Expected alert when Pro license grants update_alerts feature")- }- })-- t.Run("free license - no alerts", func(t *testing.T) {- m := NewManager()- m.mu.Lock()- m.config.DockerDefaults.UpdateAlertDelayHours = 24- m.mu.Unlock()- m.SetLicenseChecker(func(feature string) bool {- return false // Free tier - no features- })-- testResourceID := "docker:" + hostID + "/container-license-test-3"-- // Set up tracking as if we detected the update 25 hours ago- m.mu.Lock()- m.dockerUpdateFirstSeen[testResourceID] = time.Now().Add(-25 * time.Hour)- m.mu.Unlock()-- container := models.DockerContainer{- ID: "container-license-test-3",- Name: containerName,- Image: "nginx:latest",- UpdateStatus: &models.DockerContainerUpdateStatus{- UpdateAvailable: true,- CurrentDigest: "sha256:olddigest",- LatestDigest: "sha256:newdigest",- LastChecked: time.Now(),- },- }-- m.checkDockerContainerImageUpdate(host, container, testResourceID, containerName, instanceName, nodeName)-- alerts := m.GetActiveAlerts()- for _, a := range alerts {- if a.Type == "docker-container-update" {- t.Error("Expected no alert when license doesn't grant update_alerts feature")- break- }- }-- // Verify tracking is also cleared- m.mu.RLock()- _, tracked := m.dockerUpdateFirstSeen[testResourceID]- m.mu.RUnlock()- if tracked {- t.Error("Expected tracking to be cleared when license doesn't grant feature")- }- })-}+// Note: Update alerts are now a free feature (no license gating).+// The Pro license gating tests were removed when update alerts became free.func TestDockerUpdateTrackingCleanup(t *testing.T) {m := NewManager()diff --git a/internal/license/features.go b/internal/license/features.goindex edfc35b9ff..f2fd7d9e96 100644--- a/internal/license/features.go+++ b/internal/license/features.go@@ -10,8 +10,8 @@ const (FeatureAIAutoFix = "ai_autofix" // Automatic remediationFeatureKubernetesAI = "kubernetes_ai" // AI analysis of K8s (NOT basic monitoring)- // Pro tier features - Monitoring- FeatureUpdateAlerts = "update_alerts" // Alerts for pending container/package updates+ // Free tier features - Monitoring+ FeatureUpdateAlerts = "update_alerts" // Alerts for pending container/package updates (free feature)// MSP tier features (FUTURE - not in v1 launch)FeatureMultiUser = "multi_user" // RBAC - NOT IMPLEMENTED YET@@ -35,7 +35,8 @@ const (// TierFeatures maps each tier to its included features.var TierFeatures = map[Tier][]string{TierFree: {- // Free tier has no Pro features, but full monitoring+ // Free tier includes update alerts (container image updates) - basic monitoring feature+ FeatureUpdateAlerts,},TierPro: {FeatureAIPatrol,