bundles/wireguard: add no_autoconnect option
This commit is contained in:
parent
ffb5125ddd
commit
63d42c6b42
2 changed files with 5 additions and 2 deletions
|
@ -175,11 +175,13 @@ def peer_endpoints(metadata):
|
||||||
except NoSuchNode:
|
except NoSuchNode:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if repo.libs.s2s.WG_AUTOGEN_SETTINGS.get(name, {}).get('no_autoconnect'):
|
||||||
|
continue
|
||||||
|
|
||||||
peers[rnode.name] = {
|
peers[rnode.name] = {
|
||||||
'endpoint': '{}:{}'.format(
|
'endpoint': '{}:{}'.format(
|
||||||
rnode.metadata.get('wireguard/external_hostname', rnode.hostname),
|
rnode.hostname,
|
||||||
rnode.metadata.get(f'wireguard/peers/{node.name}/my_port', 51820),
|
rnode.metadata.get(f'wireguard/peers/{node.name}/my_port'),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ WG_AUTOGEN_NODES = [
|
||||||
WG_AUTOGEN_SETTINGS = {
|
WG_AUTOGEN_SETTINGS = {
|
||||||
# special settings to apply when peering with a specific node
|
# special settings to apply when peering with a specific node
|
||||||
'home.router': {
|
'home.router': {
|
||||||
|
'no_autoconnect': True,
|
||||||
'persistent_keepalive': False,
|
'persistent_keepalive': False,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue