The binary now reads a .env file itself (dotenvy::dotenv() at the top of main), so 'cargo run -p server' / the release binary pick up config without relying on just's 'set dotenv-load'. Missing .env is a no-op. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Generated
+1
@@ -2077,6 +2077,7 @@ dependencies = [
|
|||||||
"clap",
|
"clap",
|
||||||
"db",
|
"db",
|
||||||
"domain",
|
"domain",
|
||||||
|
"dotenvy",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"memory-serve",
|
"memory-serve",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
|||||||
@@ -28,4 +28,5 @@ argon2 = "0.5"
|
|||||||
tower-sessions = "0.14"
|
tower-sessions = "0.14"
|
||||||
tower-sessions-sqlx-store = { version = "0.15", features = ["postgres"] }
|
tower-sessions-sqlx-store = { version = "0.15", features = ["postgres"] }
|
||||||
rpassword = "7"
|
rpassword = "7"
|
||||||
|
dotenvy = "0.15"
|
||||||
memory-serve = "2.1"
|
memory-serve = "2.1"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ db = { path = "../db" }
|
|||||||
domain = { path = "../domain" }
|
domain = { path = "../domain" }
|
||||||
search = { path = "../search" }
|
search = { path = "../search" }
|
||||||
rpassword.workspace = true
|
rpassword.workspace = true
|
||||||
|
dotenvy.workspace = true
|
||||||
memory-serve = { workspace = true, optional = true }
|
memory-serve = { workspace = true, optional = true }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ impl From<RoleArg> for Role {
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
|
// Load a .env file (if present) so the binary picks up config when run directly,
|
||||||
|
// not only via `just` (which uses `set dotenv-load`). A missing .env is fine.
|
||||||
|
dotenvy::dotenv().ok();
|
||||||
|
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
|
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
|
||||||
.init();
|
.init();
|
||||||
|
|||||||
Reference in New Issue
Block a user