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