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
+2 -1
View File
@@ -94,7 +94,8 @@ class Application(models.Model):
if not ClusterSettings.cluster_enabled():
return worker is None
if worker is None:
return self.serve_on_primary
# Only WireGuard WebAdmin is published while the primary server does not serve clients
return self.serve_on_primary and (self.name == RESERVED_APP_NAME or ClusterSettings.primary_serves_clients())
return self.all_workers or self.workers.filter(pk=worker.pk).exists()
class Meta: