From 6d7efdb5eac478cc950538c279f80fffb88c2a84 Mon Sep 17 00:00:00 2001 From: solidDoWant Date: Fri, 22 May 2026 19:54:13 +0000 Subject: [PATCH 1/2] Get config file path from `OPENARC_CONFIG_FILE` if set Signed-off-by: solidDoWant --- src/cli/modules/server_config.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cli/modules/server_config.py b/src/cli/modules/server_config.py index 62dec8d3..f577912f 100644 --- a/src/cli/modules/server_config.py +++ b/src/cli/modules/server_config.py @@ -4,6 +4,7 @@ This module handles all configuration file operations without any CLI/presentation logic. """ import json +import os from pathlib import Path from typing import Optional, Dict, Any, List @@ -16,11 +17,16 @@ def __init__(self, config_file: Optional[Path] = None): Initialize ServerConfig with a config file path. Args: - config_file: Path to the config file. If None, defaults to openarc_config.json in project root. + config_file: Path to the config file. If None, OPENARC_CONFIG_FILE env var when set, + otherwise defaults to openarc_config.json in project root. """ if config_file is None: - project_root = Path(__file__).parent.parent.parent.parent - config_file = project_root / "openarc_config.json" + env_path = os.environ.get("OPENARC_CONFIG_FILE") + if env_path: + config_file = Path(env_path) + else: + project_root = Path(__file__).parent.parent.parent.parent + config_file = project_root / "openarc_config.json" self.config_file = Path(config_file) From 7dcdced9fb477a0d906cf63aa72fdd0b0dcf4fbd Mon Sep 17 00:00:00 2001 From: solidDoWant Date: Fri, 22 May 2026 20:29:17 +0000 Subject: [PATCH 2/2] add fix for server code path Signed-off-by: solidDoWant --- src/server/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/main.py b/src/server/main.py index 64ce2e65..66f6a9f5 100644 --- a/src/server/main.py +++ b/src/server/main.py @@ -54,7 +54,8 @@ async def lifespan(app: FastAPI): if models: from pathlib import Path - config_file = Path(__file__).parent.parent.parent / "openarc_config.json" + env_config = os.environ.get("OPENARC_CONFIG_FILE") + config_file = Path(env_config) if env_config else Path(__file__).parent.parent.parent / "openarc_config.json" if config_file.exists(): with open(config_file) as f: config = json.load(f)