Make the cluster's primary WireGuard option stop the primary server and its gateway in mirror mode

This commit is contained in:
Eduardo Silva
2026-11-23 14:00:35 -03:00
parent 1c3e162b5c
commit 2aa740eaaf
11 changed files with 196 additions and 7 deletions
@@ -0,0 +1,11 @@
from django.core.management.base import BaseCommand, CommandError
from cluster.models import ClusterSettings
class Command(BaseCommand):
help = 'Exit with status 1 when WireGuard is disabled on the primary server in the cluster settings'
def handle(self, *args, **options):
if not ClusterSettings.primary_serves_clients():
raise CommandError('WireGuard is disabled on the primary server in the cluster settings', returncode=1)