fix(data-mesher): default bootstrap nodes
This commit is contained in:
@@ -12,13 +12,16 @@ let
|
|||||||
# currently only supports zerotier
|
# currently only supports zerotier
|
||||||
defaultBootstrapNodes = builtins.foldl' (
|
defaultBootstrapNodes = builtins.foldl' (
|
||||||
urls: name:
|
urls: name:
|
||||||
if
|
|
||||||
builtins.pathExists "${config.clan.core.settings.directory}/vars/per-machine/${name}/zerotier/zerotier-ip/value"
|
|
||||||
then
|
|
||||||
let
|
let
|
||||||
ip = builtins.readFile "${config.clan.core.settings.directory}/vars/per-machine/${name}/zerotier/zerotier-ip/value";
|
|
||||||
|
ipPath = "${config.clan.core.settings.directory}/vars/per-machine/${name}/zerotier/zerotier-ip/value";
|
||||||
|
|
||||||
in
|
in
|
||||||
urls ++ "${ip}:${cfg.network.port}"
|
if builtins.pathExists ipPath then
|
||||||
|
let
|
||||||
|
ip = builtins.readFile ipPath;
|
||||||
|
in
|
||||||
|
urls ++ [ "[${ip}]:${builtins.toString cfg.network.port}" ]
|
||||||
else
|
else
|
||||||
urls
|
urls
|
||||||
) [ ] (dmLib.machines config).bootstrap;
|
) [ ] (dmLib.machines config).bootstrap;
|
||||||
@@ -87,7 +90,8 @@ in
|
|||||||
push_pull_interval = "30s";
|
push_pull_interval = "30s";
|
||||||
|
|
||||||
interface = cfg.network.interface;
|
interface = cfg.network.interface;
|
||||||
bootstrap_nodes = cfg.bootstrapNodes or defaultBootstrapNodes;
|
|
||||||
|
bootstrap_nodes = if cfg.bootstrapNodes == null then defaultBootstrapNodes else cfg.bootstrapNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
http.port = 7331;
|
http.port = 7331;
|
||||||
|
|||||||
Reference in New Issue
Block a user