Explicitly pass DOMAIN_SUFFIX and CADDY_API_URL to build script

Environment inheritance from the server process was not reliably
propagating these vars into the spawned bash subprocess.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
Claude 2026-03-20 09:28:50 +00:00
parent f92545ed4e
commit ee78f3ff0a
No known key found for this signature in database

View file

@ -118,6 +118,9 @@ async fn run_build(state: &AppState, deploy_id: &str) -> anyhow::Result<()> {
) )
.await?; .await?;
let domain_suffix = std::env::var("DOMAIN_SUFFIX").unwrap_or_else(|_| "localhost".into());
let caddy_api_url = std::env::var("CADDY_API_URL").unwrap_or_else(|_| "http://localhost:2019".into());
let mut child = Command::new("bash") let mut child = Command::new("bash")
.arg(&build_script) .arg(&build_script)
.env("APP_ID", &app.id) .env("APP_ID", &app.id)
@ -128,6 +131,8 @@ async fn run_build(state: &AppState, deploy_id: &str) -> anyhow::Result<()> {
.env("ENV_FILE", &env_file) .env("ENV_FILE", &env_file)
.env("SHA", deploy.sha.as_deref().unwrap_or("")) .env("SHA", deploy.sha.as_deref().unwrap_or(""))
.env("BUILD_DIR", &build_dir) .env("BUILD_DIR", &build_dir)
.env("DOMAIN_SUFFIX", &domain_suffix)
.env("CADDY_API_URL", &caddy_api_url)
.stdout(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped())
.spawn() .spawn()