Mercurial > code > home > repos > infra
comparison wireguard.py @ 12:15c5ce7c74b5
refactor, cleanup, split large deploys
author | drewp@bigasterisk.com |
---|---|
date | Thu, 11 Nov 2021 23:31:21 -0800 |
parents | 7e76e6dcc080 |
children | 52156d3898c5 |
comparison
equal
deleted
inserted
replaced
11:82e46d7ff527 | 12:15c5ce7c74b5 |
---|---|
44 | 44 |
45 pub_key = subprocess.check_output(['wg', 'pubkey'], input=priv_key.encode('ascii')).strip().decode('ascii') | 45 pub_key = subprocess.check_output(['wg', 'pubkey'], input=priv_key.encode('ascii')).strip().decode('ascii') |
46 # todo: if this was new, it should be added to a file of pubkeys that peer_block can refer to | 46 # todo: if this was new, it should be added to a file of pubkeys that peer_block can refer to |
47 | 47 |
48 files.template( | 48 files.template( |
49 src=f'templates/wireguard_{wireguard_interface}.conf.j2', | 49 src=f'templates/wireguard/{wireguard_interface}.conf.j2', |
50 dest=f'/etc/wireguard/{wireguard_interface}.conf', | 50 dest=f'/etc/wireguard/{wireguard_interface}.conf', |
51 mode='600', | 51 mode='600', |
52 wireguard_ip=wireguard_ip, | 52 wireguard_ip=wireguard_ip, |
53 priv_key=priv_key, | 53 priv_key=priv_key, |
54 peer_block=peer_block, | 54 peer_block=peer_block, |