From 1207f2c9cfd25a18abf78ad86355962bb97bb06f Mon Sep 17 00:00:00 2001 From: opencode Date: Sun, 5 Jul 2026 07:01:34 +0000 Subject: [PATCH] fix: remove hardcoded LAN IP from default base_url (issue #5) - Replace hardcoded 192.168.8.223:11434 with error placeholder - Fail loudly if CLOVER_BASE_URL not set in .env - Add helpful error message in validate_config() --- config/settings.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config/settings.py b/config/settings.py index 2a14913..7a3744a 100644 --- a/config/settings.py +++ b/config/settings.py @@ -29,7 +29,9 @@ def load_config(): "threads": int(os.getenv("CLOVER_THREADS", "5")), "model": os.getenv("CLOVER_MODEL", "qwen3-coder:30b"), "api_key": os.getenv("CLOVER_API_KEY"), - "base_url": os.getenv("CLOVER_BASE_URL", "http://192.168.8.223:11434"), + "base_url": os.getenv( + "CLOVER_BASE_URL", "error-set-CLOVER_BASE_URL-in-.env-file" + ), "debug": os.getenv("CLOVER_DEBUG", "false").lower() == "true", "verbose": os.getenv("CLOVER_VERBOSE", "false").lower() == "true", "cache_enabled": os.getenv("CLOVER_CACHE_ENABLED", "true").lower() == "true", @@ -205,8 +207,12 @@ def validate_config(): issues = [] # Check required settings - if not config.get("base_url"): - issues.append("base_url is required") + base_url = config.get("base_url", "") + if not base_url or base_url.startswith("error-set-"): + issues.append( + "CLOVER_BASE_URL is not set. Set it in your .env file or environment. " + "Example: CLOVER_BASE_URL=http://localhost:11434" + ) # Check numeric values try: