Add speed profiles to limit the bandwidth of each peer

This commit is contained in:
Eduardo Silva
2026-11-24 17:05:13 -03:00
parent 026c82445b
commit 3f2da7e545
35 changed files with 1538 additions and 25 deletions
+7
View File
@@ -73,6 +73,10 @@ class WireGuardInstance(models.Model):
worker = models.ForeignKey(
'cluster.Worker', on_delete=models.PROTECT, blank=True, null=True, related_name='wireguard_instances'
)
# Speed profile given to the peers created in this instance
default_speed_profile = models.ForeignKey(
'speed_profiles.SpeedProfile', on_delete=models.PROTECT, blank=True, null=True, related_name='default_for_instances'
)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
@@ -210,6 +214,9 @@ class Peer(models.Model):
routing_template = models.ForeignKey(
'routing_templates.RoutingTemplate', on_delete=models.SET_NULL, blank=True, null=True, related_name='peers'
)
speed_profile = models.ForeignKey(
'speed_profiles.SpeedProfile', on_delete=models.PROTECT, blank=True, null=True, related_name='peers'
)
# Remote address (host:port) for peers that this server connects to, instead of waiting for them to connect
endpoint = models.CharField(max_length=255, blank=True, default='')