Load environment variables from .env files
This allows to properly set the OAuth 2.0 Issuer base in the Codespace
This commit is contained in:
1
.devcontainer/.env
Normal file
1
.devcontainer/.env
Normal file
@@ -0,0 +1 @@
|
||||
MAS_OAUTH2_ISSUER="https://${CODESPACE_NAME}-8080.githubpreview.dev/"
|
||||
@@ -3,6 +3,8 @@ FROM mcr.microsoft.com/vscode/devcontainers/rust:0-1
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends postgresql-client
|
||||
|
||||
COPY .env /.env
|
||||
|
||||
# TODO: pre-build custom images, those take too much time
|
||||
#RUN cargo install sqlx-cli --no-default-features --features postgres
|
||||
#RUN cargo install cargo-edit
|
||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1255,6 +1255,7 @@ dependencies = [
|
||||
"cookie",
|
||||
"crc 2.0.0",
|
||||
"data-encoding",
|
||||
"dotenv",
|
||||
"figment",
|
||||
"headers",
|
||||
"hyper",
|
||||
|
||||
@@ -39,6 +39,7 @@ serde_with = { version = "1.9.4", features = ["hex", "chrono"] }
|
||||
clap = "3.0.0-beta.2"
|
||||
figment = { version = "0.10.6", features = ["env", "yaml", "test"] }
|
||||
schemars = { version = "0.8.3", features = ["url", "chrono"] }
|
||||
dotenv = "0.15.0"
|
||||
|
||||
# Password hashing
|
||||
argon2 = { version = "0.2.2", features = ["password-hash"] }
|
||||
|
||||
@@ -34,6 +34,9 @@ use self::cli::RootCommand;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
// Load environment variables from .env files
|
||||
dotenv::dotenv()?;
|
||||
|
||||
// Setup logging & tracing
|
||||
let fmt_layer = tracing_subscriber::fmt::layer();
|
||||
let filter_layer = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?;
|
||||
|
||||
Reference in New Issue
Block a user