[vpn] include vpn server public key
This commit is contained in:
parent
cd19c47fdb
commit
aec79cba74
3 changed files with 33 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ class WireGuardVPNPool(models.Model):
|
|||
|
||||
vpn_server_hostname = models.CharField(max_length=256)
|
||||
wireguard_private_key = models.CharField(max_length=48)
|
||||
wireguard_public_key = models.CharField(max_length=48)
|
||||
|
||||
@property
|
||||
def max_pool_index(self):
|
||||
|
|
@ -60,6 +61,14 @@ class WireGuardVPN(models.Model):
|
|||
def network_mask(self):
|
||||
return self.vpnpool.subnetwork_mask
|
||||
|
||||
@property
|
||||
def vpn_server(self):
|
||||
return self.vpnpool.vpn_server_hostname
|
||||
|
||||
@property
|
||||
def vpn_server_public_key(self):
|
||||
return self.vpnpool.wireguard_public_key
|
||||
|
||||
@property
|
||||
def address(self):
|
||||
"""
|
||||
|
|
@ -77,6 +86,7 @@ class WireGuardVPN(models.Model):
|
|||
def __str__(self):
|
||||
return f"{self.address} ({self.pool_index})"
|
||||
|
||||
|
||||
class WireGuardVPNFreeLeases(models.Model):
|
||||
"""
|
||||
Previously used VPNNetworks
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue