From f0bb8b9a730320de7e25b0f9f8bc0b376d7a6335 Mon Sep 17 00:00:00 2001 From: Jonathan Doughty Date: Tue, 31 Mar 2026 16:52:55 -0400 Subject: [PATCH] feat(config): support dynamic elasticsearch port assignments via environment variables --- elastro/config/defaults.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/elastro/config/defaults.py b/elastro/config/defaults.py index 4bbd7fa..13ecad1 100644 --- a/elastro/config/defaults.py +++ b/elastro/config/defaults.py @@ -5,8 +5,12 @@ module. """ -# Default connection settings -DEFAULT_HOSTS = ["http://localhost:9200"] +import os + +_protocol = os.environ.get("ELASTIC_PROTOCOL", "http") +_host = os.environ.get("ELASTIC_HOST", "localhost") +_port = os.environ.get("ELASTIC_PORT", "9200") +DEFAULT_HOSTS = [os.environ.get("ELASTIC_URL", f"{_protocol}://{_host}:{_port}")] DEFAULT_TIMEOUT = 30 DEFAULT_RETRY_ON_TIMEOUT = True DEFAULT_MAX_RETRIES = 3