}
}
-static void mergeYamlSubFile(const std::string& configname, Recursorsettings& settings, Logr::log_t log)
+static void mergeYamlSubFile(const std::string& configname, Recursorsettings& settings, bool allowabsent, Logr::log_t log)
{
auto file = ifstream(configname);
if (!file.is_open()) {
+ if (allowabsent) {
+ return;
+ }
throw runtime_error("Cannot open " + configname);
}
SLOG(g_log << Logger::Notice << "Processing YAML settings from " << configname << endl,
rust::string key = "allow_from";
rust::string filekey = "allow_from_file";
- if (filename == "allow-from") {
+ if (filename == "allow-notify-from") {
key = "allow_notify_from";
filekey = "allow_notify_from_file";
}
possiblyConvertACLFile(includeDir, apiDir, file, log);
auto path = apiDir;
path.append("/").append(file).append(".yml");
- try {
- mergeYamlSubFile(path, settings, log);
- }
- catch (const runtime_error& err) {
- }
+ mergeYamlSubFile(path, settings, true, log);
}
possiblyConvertForwardsandAuths(includeDir, apiDir, log);
}
::arg().gatherIncludes(!includeDirOnCommandLine.empty() ? includeDirOnCommandLine : string(yamlstruct.recursor.include_dir),
".yml", yamlFiles);
for (const auto& yamlfile : yamlFiles) {
- mergeYamlSubFile(yamlfile, yamlstruct, log);
+ mergeYamlSubFile(yamlfile, yamlstruct, false, log);
}
yamlstruct.validate();
settings = yamlstruct;