From 1da3048bb82110bd50b02d58a95c018f646c89e6 Mon Sep 17 00:00:00 2001 From: strawberry Date: Thu, 25 Apr 2024 17:18:37 -0400 Subject: [PATCH] allow accepting `CONDUWUIT_` prefixed config options Signed-off-by: strawberry --- src/config/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index a8d1f977..655e6d3c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -368,12 +368,21 @@ impl Config { Figment::new() .merge(Toml::file(config_file_env).nested()) .merge(Env::prefixed("CONDUIT_").global()) + .merge(Env::prefixed("CONDUWUIT_").global()) + } else if let Some(config_file_arg) = Env::var("CONDUWUIT_CONFIG") { + Figment::new() + .merge(Toml::file(config_file_arg).nested()) + .merge(Env::prefixed("CONDUIT_").global()) + .merge(Env::prefixed("CONDUWUIT_").global()) } else if let Some(config_file_arg) = path { Figment::new() .merge(Toml::file(config_file_arg).nested()) .merge(Env::prefixed("CONDUIT_").global()) + .merge(Env::prefixed("CONDUWUIT_").global()) } else { - Figment::new().merge(Env::prefixed("CONDUIT_").global()) + Figment::new() + .merge(Env::prefixed("CONDUIT_").global()) + .merge(Env::prefixed("CONDUWUIT_").global()) }; let config = match raw_config.extract::() {