summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2019-12-28 12:11:06 +0100
committerFelix Ableitner <me@nutomic.com>2019-12-28 12:11:06 +0100
commita3065ed39f871e251d2e3762219c78859cb51f06 (patch)
tree165e86def275e250d2ab3c5f89c460c3208ca396 /server
parentb7c24a372bfe80057d71edef856afd985714f660 (diff)
Fix overriding config vars with underscore from environment
Diffstat (limited to 'server')
-rw-r--r--server/src/settings.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/settings.rs b/server/src/settings.rs
index 7da19c0f..446bf04f 100644
--- a/server/src/settings.rs
+++ b/server/src/settings.rs
@@ -70,7 +70,10 @@ impl Settings {
// Add in settings from the environment (with a prefix of LEMMY)
// Eg.. `LEMMY_DEBUG=1 ./target/app` would set the `debug` key
- s.merge(Environment::with_prefix("LEMMY").separator("_"))?;
+ // Note: we need to use double underscore here, because otherwise variables containing
+ // underscore cant be set from environmnet.
+ // https://github.com/mehcode/config-rs/issues/73
+ s.merge(Environment::with_prefix("LEMMY").separator("__"))?;
return s.try_into();
}