|
|
|
@ -22,7 +22,8 @@ namespace llarp
|
|
|
|
|
[&ret](const ConfigParser::Section_t &s) -> bool {
|
|
|
|
|
for(const auto &item : s)
|
|
|
|
|
{
|
|
|
|
|
ret.emplace_back(string_view_string(item.first), string_view_string(item.second));
|
|
|
|
|
ret.emplace_back(string_view_string(item.first),
|
|
|
|
|
string_view_string(item.second));
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}))
|
|
|
|
@ -47,6 +48,7 @@ namespace llarp
|
|
|
|
|
iwp_links = find_section(parser, "bind", section_t{});
|
|
|
|
|
services = find_section(parser, "services", section_t{});
|
|
|
|
|
system = find_section(parser, "system", section_t{});
|
|
|
|
|
metrics = find_section(parser, "metrics", section_t{});
|
|
|
|
|
api = find_section(parser, "api", section_t{});
|
|
|
|
|
lokid = find_section(parser, "lokid", section_t{});
|
|
|
|
|
bootstrap = find_section(parser, "bootstrap", section_t{});
|
|
|
|
@ -57,9 +59,13 @@ namespace llarp
|
|
|
|
|
Config::visit(const Visitor &functor)
|
|
|
|
|
{
|
|
|
|
|
std::unordered_map< std::string, const llarp::Config::section_t & >
|
|
|
|
|
sections = {{"network", network}, {"connect", connect},
|
|
|
|
|
{"bootstrap", bootstrap}, {"system", system},
|
|
|
|
|
{"netdb", netdb}, {"api", api},
|
|
|
|
|
sections = {{"network", network},
|
|
|
|
|
{"connect", connect},
|
|
|
|
|
{"bootstrap", bootstrap},
|
|
|
|
|
{"system", system},
|
|
|
|
|
{"metrics", metrics},
|
|
|
|
|
{"netdb", netdb},
|
|
|
|
|
{"api", api},
|
|
|
|
|
{"services", services}};
|
|
|
|
|
|
|
|
|
|
auto visitor = [&](const char *name, const auto &item) {
|
|
|
|
@ -172,6 +178,12 @@ llarp_generic_ensure_config(std::ofstream &f, std::string basepath)
|
|
|
|
|
f << "# nickname=lokinet" << std::endl;
|
|
|
|
|
f << std::endl << std::endl;
|
|
|
|
|
|
|
|
|
|
// metrics
|
|
|
|
|
f << "[metrics]\n";
|
|
|
|
|
f << "json-metrics-path=" << basepath << "metrics.json\n";
|
|
|
|
|
|
|
|
|
|
f << std::endl << std::endl;
|
|
|
|
|
|
|
|
|
|
f << "# admin api (disabled by default)" << std::endl;
|
|
|
|
|
f << "[api]" << std::endl;
|
|
|
|
|
f << "enabled=false" << std::endl;
|
|
|
|
|