No description
- Python 99.3%
- Shell 0.7%
| internal | ||
| .gitignore | ||
| bind.py | ||
| bird.py | ||
| gen-cert.sh | ||
| install_bird.yml | ||
| nebula.py | ||
| nftables.py | ||
| README.md | ||
| ssh.py | ||
| wireguard.py | ||
Scripts I use to manage VPS.
This only works on Alpine Linux remotes.
Still WIP
Very unclean snippet to convert WireGuard .conf files to a list of WireGuardInterface assuming keys and values are separated with a equals sign surrounded by spaces and lots of other assumptions
def vv(name):
vals = dict([i.split(' = ') for i in open(name).read().split('\n') if '=' in i])
params = {
'id': name[:-5],
'peer': vals['PostUp'].split(' ')[-1],
'public_key': vals['PublicKey'],
'endpoint': vals.get('Endpoint'),
'listen_port': int(vals.get('ListenPort')),
'preshared_key': vals.get('PresharedKey')
}
return f'WireGuardInterface({', '.join([f'{k}={f'"{v}"' if type(v) != int else v}' for k, v in params.items() if v is not None])})'
print('[\n ' + ',\n '.join([vv(f) for f in sorted(listdir()) if f[-5:] == '.conf']) + '\n]')