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.

Add encryption status to notification health endpoint (P2)

rcourtman9257071ca1aa
diff --git a/frontend-modern/src/api/notifications.ts b/frontend-modern/src/api/notifications.ts
index 456c905b2f..3f5c324479 100644
--- a/frontend-modern/src/api/notifications.ts
+++ b/frontend-modern/src/api/notifications.ts
@@ -238,6 +238,9 @@ export class NotificationsAPI {
total: number;
enabled: number;
};
+ encryption: {
+ enabled: boolean;
+ };
healthy: boolean;
}> {
return apiFetchJSON(`${this.baseUrl}/health`);
diff --git a/internal/api/notifications.go b/internal/api/notifications.go
index 48cd0e3d14..9fb2ea3834 100644
--- a/internal/api/notifications.go
+++ b/internal/api/notifications.go
@@ -640,6 +640,9 @@ func (h *NotificationHandlers) GetNotificationHealth(w http.ResponseWriter, r *h
"total": len(webhooks),
"enabled": countEnabledWebhooks(webhooks),
},
+ "encryption": map[string]interface{}{
+ "enabled": h.monitor.GetConfigPersistence().IsEncryptionEnabled(),
+ },
"overall_healthy": queueStats["healthy"] == true,
}
diff --git a/internal/config/persistence.go b/internal/config/persistence.go
index e228e975c8..beef2ab7b4 100644
--- a/internal/config/persistence.go
+++ b/internal/config/persistence.go
@@ -1371,6 +1371,13 @@ func (c *ConfigPersistence) updateEnvFile(envFile string, settings SystemSetting
return os.Rename(tempFile, envFile)
}
+// IsEncryptionEnabled returns whether the config persistence has encryption enabled
+func (c *ConfigPersistence) IsEncryptionEnabled() bool {
+ c.mu.RLock()
+ defer c.mu.RUnlock()
+ return c.crypto != nil
+}
+
// cleanupOldBackups removes old backup files, keeping only the most recent N backups
func (c *ConfigPersistence) cleanupOldBackups(pattern string) {
// Use filepath.Glob to find all backup files matching the pattern