mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-13 22:12:56 +00:00
Allow relay policy setting in local.conf
This commit is contained in:
parent
40078a99de
commit
d159e5ca44
@ -883,7 +883,7 @@ public:
|
||||
json &virt = _localConfig["virtual"];
|
||||
if (virt.is_object()) {
|
||||
for(json::iterator v(virt.begin());v!=virt.end();++v) {
|
||||
std::string nstr = v.key();
|
||||
const std::string nstr = v.key();
|
||||
if ((nstr.length() == ZT_ADDRESS_LENGTH_HEX)&&(v.value().is_object())) {
|
||||
const Address ztaddr(nstr.c_str());
|
||||
if (ztaddr)
|
||||
@ -891,6 +891,17 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set any other local config stuff
|
||||
json &settings = _localConfig["settings"];
|
||||
if (settings.is_object()) {
|
||||
const std::string rp(_jS(settings["relayPolicy"],""));
|
||||
if (rp == "always")
|
||||
_node->setRelayPolicy(ZT_RELAY_POLICY_ALWAYS);
|
||||
else if (rp == "never")
|
||||
_node->setRelayPolicy(ZT_RELAY_POLICY_NEVER);
|
||||
else _node->setRelayPolicy(ZT_RELAY_POLICY_TRUSTED);
|
||||
}
|
||||
}
|
||||
|
||||
_controller = new EmbeddedNetworkController(_node,(_homePath + ZT_PATH_SEPARATOR_S + ZT_CONTROLLER_DB_PATH).c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user