diff --git a/src/main.rs b/src/main.rs index 84eb4f6..a0cfb25 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,8 +132,10 @@ impl Config { let mut system_path= system_config_paths[1]; for path in system_config_paths { - if path.exists() { + let cfg_path = path.join("config.toml"); + if cfg_path.exists() { system_path = path; + break; } }; @@ -159,7 +161,7 @@ async fn main() -> std::io::Result<()> { log::set_max_level(LevelFilter::Info); let config = Config::load().expect("Error while loading or generating the config"); - + let loaded_redirects_msg = format!("Loaded {} redirects from user config", config.user.domain_configs.len()); info!(loaded_redirects_msg);