| @@ -6,7 +6,7 @@ from dotenv import load_dotenv | |||||
| def _load_dotenv_chain() -> None: | def _load_dotenv_chain() -> None: | ||||
| # Load local .env first | # Load local .env first | ||||
| load_dotenv() | |||||
| load_dotenv(override=True) | |||||
| # Support shell-style source directives in .env, e.g. ". /data/conf/presence/core.conf" | # Support shell-style source directives in .env, e.g. ". /data/conf/presence/core.conf" | ||||
| local_env = Path(".env") | local_env = Path(".env") | ||||
| @@ -30,7 +30,12 @@ def _load_dotenv_chain() -> None: | |||||
| if not source_path.is_absolute(): | if not source_path.is_absolute(): | ||||
| source_path = (local_env.parent / source_path).resolve() | source_path = (local_env.parent / source_path).resolve() | ||||
| if source_path.exists(): | if source_path.exists(): | ||||
| load_dotenv(dotenv_path=source_path, override=False) | |||||
| load_dotenv(dotenv_path=source_path, override=True) | |||||
| # Safety fallback for deployments that keep Keycloak vars in core.conf. | |||||
| default_core_conf = Path("/data/conf/presence/core.conf") | |||||
| if default_core_conf.exists(): | |||||
| load_dotenv(dotenv_path=default_core_conf, override=True) | |||||
| _load_dotenv_chain() | _load_dotenv_chain() | ||||