From 2a2a7b7392652e9175d20d1a32cfb62631339ef1 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 3 Mar 2022 16:18:59 +0100 Subject: [PATCH] provide api password from env variable first --- setup-scripts/bot_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup-scripts/bot_utils.py b/setup-scripts/bot_utils.py index 23cc64c0..b987e464 100644 --- a/setup-scripts/bot_utils.py +++ b/setup-scripts/bot_utils.py @@ -52,6 +52,9 @@ api_endpoint = "http://{}:{}".format( # find siad api password by getting it out of the docker container def get_api_password(): + if os.getenv("SIA_API_PASSWORD"): + return os.getenv("SIA_API_PASSWORD") + api_password_regex = re.compile(r"^\w+$") docker_cmd = "docker exec {} cat /sia-data/apipassword".format(CONTAINER_NAME) output = subprocess.check_output(docker_cmd, shell=True).decode("utf-8")