1
0
Fork 0
forked from 2sys/shoutdotdev

change env separator from . to __

This commit is contained in:
Brent Schroeter 2025-03-11 22:21:23 -07:00
parent 9abdf38b06
commit f6adc2ba88
2 changed files with 12 additions and 12 deletions

View file

@ -1,15 +1,15 @@
RUST_LOG=debug RUST_LOG=debug
DATABASE_URL=postgresql://shoutdotdev:callous@127.0.0.1:5447/shoutdotdev DATABASE_URL=postgresql://shoutdotdev:callous@127.0.0.1:5447/shoutdotdev
AUTH.CLIENT_ID= AUTH__CLIENT_ID=
AUTH.CLIENT_SECRET= AUTH__CLIENT_SECRET=
AUTH.REDIRECT_URL=http://localhost:3000/auth/callback AUTH__REDIRECT_URL=http://localhost:3000/auth/callback
AUTH.AUTH_URL=https://example.com/authorize AUTH__AUTH_URL=https://example.com/authorize
AUTH.TOKEN_URL=https://example.com/token AUTH__TOKEN_URL=https://example.com/token
AUTH.USERINFO_URL=https://example.com/userinfo AUTH__USERINFO_URL=https://example.com/userinfo
# The .env parser (dotenvy) requires quotes around any value with spaces. Note # 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. # that in this regard it is incompatible with Docker's --env-file parser.
EMAIL.VERIFICATION_FROM=no-reply@shout.dev EMAIL__VERIFICATION_FROM=no-reply@shout.dev
EMAIL.MESSAGE_FROM=no-reply@shout.dev EMAIL__MESSAGE_FROM=no-reply@shout.dev
EMAIL.SMTP.SERVER=smtp.example.com EMAIL__SMTP__SERVER=smtp.example.com
EMAIL.SMTP.USERNAME= EMAIL__SMTP__USERNAME=
EMAIL.SMTP.PASSWORD= EMAIL__SMTP__PASSWORD=

View file

@ -103,7 +103,7 @@ impl Settings {
} }
} }
let s = Config::builder() let s = Config::builder()
.add_source(Environment::default()) .add_source(Environment::default().separator("__"))
.build() .build()
.context("config error")?; .context("config error")?;
Ok(s.try_deserialize().context("deserialize error")?) Ok(s.try_deserialize().context("deserialize error")?)