ezidam: config via env variables

This commit is contained in:
Philippe Loctaux 2023-11-17 22:32:46 +01:00
parent c1b8fd3c89
commit 89e0432b7a

View file

@ -30,6 +30,8 @@ pub fn config() -> rocket::figment::Figment {
Figment::from(Config::default())
// from `ezidam.toml`
.merge(Toml::file(Env::var_or("EZIDAM_CONFIG", "ezidam.toml")).nested())
// from env variables directly
.merge(Env::prefixed("EZIDAM_").ignore(&["PROFILE"]).global())
// from code below
.merge(("ip_header", "x-forwarded-for"))
}