phasing in celery

for configuring the vpn server
This commit is contained in:
Nico Schottelius 2020-12-13 18:34:43 +01:00
commit 2d62388eb1
8 changed files with 160 additions and 80 deletions

View file

@ -13,6 +13,16 @@ class WireGuardVPNPool(models.Model):
Network address pools from which VPNs can be created
"""
class Meta:
constraints = [
models.UniqueConstraint(fields=['wg_name', 'vpn_server_hostname' ],
name='unique_interface_name_per_host')
]
# Linux interface naming is restricing to max 15 characters
wg_name = models.CharField(max_length=15)
network = models.GenericIPAddressField(unique=True)
network_mask = models.IntegerField(validators=[MinValueValidator(0),
MaxValueValidator(128)])