diff --git a/example.env b/example.env index c6ad823..3f46843 100644 --- a/example.env +++ b/example.env @@ -1,15 +1,15 @@ RUST_LOG=debug DATABASE_URL=postgresql://shoutdotdev:callous@127.0.0.1:5447/shoutdotdev -AUTH.CLIENT_ID= -AUTH.CLIENT_SECRET= -AUTH.REDIRECT_URL=http://localhost:3000/auth/callback -AUTH.AUTH_URL=https://example.com/authorize -AUTH.TOKEN_URL=https://example.com/token -AUTH.USERINFO_URL=https://example.com/userinfo +AUTH__CLIENT_ID= +AUTH__CLIENT_SECRET= +AUTH__REDIRECT_URL=http://localhost:3000/auth/callback +AUTH__AUTH_URL=https://example.com/authorize +AUTH__TOKEN_URL=https://example.com/token +AUTH__USERINFO_URL=https://example.com/userinfo # The .env parser (dotenvy) requires quotes around any value with spaces. Note # that in this regard it is incompatible with Docker's --env-file parser. -EMAIL.VERIFICATION_FROM=no-reply@shout.dev -EMAIL.MESSAGE_FROM=no-reply@shout.dev -EMAIL.SMTP.SERVER=smtp.example.com -EMAIL.SMTP.USERNAME= -EMAIL.SMTP.PASSWORD= +EMAIL__VERIFICATION_FROM=no-reply@shout.dev +EMAIL__MESSAGE_FROM=no-reply@shout.dev +EMAIL__SMTP__SERVER=smtp.example.com +EMAIL__SMTP__USERNAME= +EMAIL__SMTP__PASSWORD= diff --git a/src/settings.rs b/src/settings.rs index 9dc0b7f..fc72aa2 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -103,7 +103,7 @@ impl Settings { } } let s = Config::builder() - .add_source(Environment::default()) + .add_source(Environment::default().separator("__")) .build() .context("config error")?; Ok(s.try_deserialize().context("deserialize error")?)