add wireguard instance public_key

This commit is contained in:
Eduardo Silva
2024-02-15 12:08:46 -03:00
parent f036daf779
commit 19d5e665ec
8 changed files with 43 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ def generate_peer_default(wireguard_instance):
# the code below can be an issue for larger networks, for now it's fine, but it should be optimized in the future
used_ips = set(WireGuardInstance.objects.all().values_list('address', flat=True)) | \
set(PeerAllowedIP.objects.all().values_list('allowed_ip', flat=True))
set(PeerAllowedIP.objects.filter(priority=0).values_list('allowed_ip', flat=True))
free_ip_address = None
for ip in network.hosts():