mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-07-31 00:04:46 +02:00
DNS primary/secondary not required anymore.
This commit is contained in:
parent
f9860bd808
commit
86f4bdadb0
6 changed files with 25 additions and 5 deletions
|
@ -35,12 +35,14 @@ def generate_peer_config(peer_uuid):
|
|||
allowed_ips_line = ", ".join([f"{ip.allowed_ip}/{ip.netmask}" for ip in allowed_ips])
|
||||
else:
|
||||
allowed_ips_line = "0.0.0.0/0, ::/0"
|
||||
dns_entries = [wg_instance.dns_primary, wg_instance.dns_secondary]
|
||||
dns_line = ", ".join(filter(None, dns_entries))
|
||||
|
||||
config_lines = [
|
||||
"[Interface]",
|
||||
f"PrivateKey = {peer.private_key}" if peer.private_key else "",
|
||||
f"Address = {client_address}",
|
||||
f"DNS = {wg_instance.dns_primary}" + (f", {wg_instance.dns_secondary}" if wg_instance.dns_secondary else ""),
|
||||
f"DNS = {dns_line}" if dns_line else "",
|
||||
"\n[Peer]",
|
||||
f"PublicKey = {wg_instance.public_key}",
|
||||
f"Endpoint = {wg_instance.hostname}:{wg_instance.listen_port}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue