bundles/wireguard: add no_autoconnect option

This commit is contained in:
Franzi 2023-12-10 15:20:05 +01:00
parent ffb5125ddd
commit 63d42c6b42
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 5 additions and 2 deletions

View file

@ -175,11 +175,13 @@ def peer_endpoints(metadata):
except NoSuchNode:
continue
if repo.libs.s2s.WG_AUTOGEN_SETTINGS.get(name, {}).get('no_autoconnect'):
continue
peers[rnode.name] = {
'endpoint': '{}:{}'.format(
rnode.metadata.get('wireguard/external_hostname', rnode.hostname),
rnode.metadata.get(f'wireguard/peers/{node.name}/my_port', 51820),
rnode.hostname,
rnode.metadata.get(f'wireguard/peers/{node.name}/my_port'),
),
}

View file

@ -23,6 +23,7 @@ WG_AUTOGEN_NODES = [
WG_AUTOGEN_SETTINGS = {
# special settings to apply when peering with a specific node
'home.router': {
'no_autoconnect': True,
'persistent_keepalive': False,
},
}