Mercurial > code > home > repos > infra
diff wireguard.py @ 215:db8787bd800e
wireguard now uses ditto (and prime) as hubs for home/remote
author | drewp@bigasterisk.com |
---|---|
date | Sat, 12 Aug 2023 15:57:46 -0700 |
parents | 8012f6095220 |
children | e45e93a797b0 |
line wrap: on
line diff
--- a/wireguard.py Sat Aug 12 14:27:49 2023 -0700 +++ b/wireguard.py Sat Aug 12 15:57:46 2023 -0700 @@ -3,6 +3,7 @@ from pyinfra import host from pyinfra.facts.files import FindInFile from pyinfra.operations import apt, files, server, systemd +import wireguard_pubkey # other options: # https://www.reddit.com/r/WireGuard/comments/fkr240/shortest_path_between_peers/ @@ -11,11 +12,12 @@ # -def peer_block(hostname, public_key, allowed_ips, endpoint=None, keepalive=None): +def peer_block(hostname, allowed_ips, endpoint=None, keepalive=None): # if allowed_ips.startswith('10.5'): # # k3s nets also need to travel over wg # allowed_ips += ', 10.42.0.0/24, 10.43.0.0/24' + public_key = wireguard_pubkey.pubkey[hostname] out = f'''\ [Peer]