From 8fd32543349a9b6c615b49e329d31c8d22b54a10 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Wed, 1 Apr 2026 19:26:32 -0300 Subject: [PATCH] fix: Bootstrap checks stack/.env path in addition to ./.env - Production has .env in botserver-stack/.env not ./.env - Checks both locations to detect completed bootstrap - Prevents full re-bootstrap on restart in production --- src/main_module/bootstrap.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main_module/bootstrap.rs b/src/main_module/bootstrap.rs index b7d4f702..acf2c313 100644 --- a/src/main_module/bootstrap.rs +++ b/src/main_module/bootstrap.rs @@ -88,13 +88,17 @@ pub async fn run_bootstrap( trace!("Creating BootstrapManager..."); let mut bootstrap = BootstrapManager::new(install_mode, tenant); + let stack_path = std::env::var("BOTSERVER_STACK_PATH") + .unwrap_or_else(|_| "./botserver-stack".to_string()); let env_path = std::path::Path::new("./.env"); - let vault_init_path = std::path::Path::new("./botserver-stack/conf/vault/init.json"); - let bootstrap_completed = env_path.exists() && vault_init_path.exists(); + let stack_env_path = std::path::Path::new(&format!("{}/.env", stack_path)); + let vault_init_path = std::path::Path::new(&format!("{}/conf/vault/init.json", stack_path)); + let bootstrap_completed = (env_path.exists() || stack_env_path.exists()) && vault_init_path.exists(); info!( - "Bootstrap check: .env exists={}, init.json exists={}, bootstrap_completed={}", + "Bootstrap check: .env exists={}, stack/.env exists={}, init.json exists={}, bootstrap_completed={}", env_path.exists(), + stack_env_path.exists(), vault_init_path.exists(), bootstrap_completed );