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: require Pro license for auto-fix and autonomous mode

rcourtmanfe3b4ed5b6a9
diff --git a/internal/ai/patrol.go b/internal/ai/patrol.go
index 175434b81b..a5bb0341ca 100644
--- a/internal/ai/patrol.go
+++ b/internal/ai/patrol.go
@@ -854,12 +854,13 @@ func (p *PatrolService) runPatrol(ctx context.Context) {
}
}
- // Auto-fix with runbooks when enabled (Pro only)
+ // Auto-fix with runbooks when enabled (Pro only - requires license)
var runbookResolved int
autoFixEnabled := false
if p.aiService != nil {
if aiCfg := p.aiService.GetAIConfig(); aiCfg != nil {
- autoFixEnabled = aiCfg.PatrolAutoFix
+ // Auto-fix requires both config flag AND Pro license with ai_autofix feature
+ autoFixEnabled = aiCfg.PatrolAutoFix && p.aiService.HasLicenseFeature(FeatureAIAutoFix)
}
}
_ = autoFixEnabled // Auto-fix via runbooks removed - dynamic AI remediation handles this
diff --git a/internal/ai/service.go b/internal/ai/service.go
index a611a7f812..1354a47e37 100644
--- a/internal/ai/service.go
+++ b/internal/ai/service.go
@@ -1036,11 +1036,19 @@ func (s *Service) GetDebugContext(req ExecuteRequest) map[string]interface{} {
return result
}
-// IsAutonomous returns true if autonomous mode is enabled
+// IsAutonomous returns true if autonomous mode is enabled AND licensed.
+// Autonomous mode requires the ai_autofix license feature (Pro tier).
func (s *Service) IsAutonomous() bool {
s.mu.RLock()
defer s.mu.RUnlock()
- return s.cfg != nil && s.cfg.AutonomousMode
+ if s.cfg == nil || !s.cfg.AutonomousMode {
+ return false
+ }
+ // Autonomous mode requires Pro license with ai_autofix feature
+ if s.licenseChecker != nil && !s.licenseChecker.HasFeature(FeatureAIAutoFix) {
+ return false
+ }
+ return true
}
// ConversationMessage represents a message in conversation history
diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.go
index 2b7a009496..965168cd7f 100644
--- a/internal/api/ai_handlers.go
+++ b/internal/api/ai_handlers.go
@@ -369,6 +369,18 @@ func (h *AISettingsHandler) HandleUpdateAISettings(w http.ResponseWriter, r *htt
}
if req.PatrolAutoFix != nil {
+ // Auto-fix requires Pro license with ai_autofix feature
+ if *req.PatrolAutoFix && !h.aiService.HasLicenseFeature(ai.FeatureAIAutoFix) {
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusPaymentRequired)
+ json.NewEncoder(w).Encode(map[string]interface{}{
+ "error": "license_required",
+ "message": "AI Auto-Fix requires Pulse Pro",
+ "feature": ai.FeatureAIAutoFix,
+ "upgrade_url": "https://pulserelay.pro",
+ })
+ return
+ }
settings.PatrolAutoFix = *req.PatrolAutoFix
}
@@ -377,6 +389,18 @@ func (h *AISettingsHandler) HandleUpdateAISettings(w http.ResponseWriter, r *htt
}
if req.AutonomousMode != nil {
+ // Autonomous mode requires Pro license with ai_autofix feature
+ if *req.AutonomousMode && !h.aiService.HasLicenseFeature(ai.FeatureAIAutoFix) {
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusPaymentRequired)
+ json.NewEncoder(w).Encode(map[string]interface{}{
+ "error": "license_required",
+ "message": "Autonomous Mode requires Pulse Pro",
+ "feature": ai.FeatureAIAutoFix,
+ "upgrade_url": "https://pulserelay.pro",
+ })
+ return
+ }
settings.AutonomousMode = *req.AutonomousMode
}