update cluster settings to enforce WireGuard requirements during test phase

This commit is contained in:
Eduardo Silva
2026-01-01 10:55:23 -03:00
parent b7065177a7
commit 18acdf0f09
3 changed files with 28 additions and 1 deletions

View File

@@ -141,6 +141,7 @@ class ClusterSettingsForm(forms.ModelForm):
cleaned_data = super().clean()
stats_sync_interval = cleaned_data.get('stats_sync_interval')
stats_cache_interval = cleaned_data.get('stats_cache_interval')
primary_enable_wireguard = cleaned_data.get('primary_enable_wireguard')
if stats_sync_interval and stats_sync_interval < 60:
raise ValidationError(_("Stats sync interval must be at least 60 seconds."))
@@ -148,4 +149,7 @@ class ClusterSettingsForm(forms.ModelForm):
if stats_cache_interval and stats_cache_interval < 60:
raise ValidationError(_("Stats cache interval must be at least 60 seconds."))
if not primary_enable_wireguard:
raise ValidationError(_("Disabling WireGuard on the master server is currently not supported."))
return cleaned_data