From bc028b7946f1eff438fa9ff3fbb251a507f34f99 Mon Sep 17 00:00:00 2001 From: kemboi22 Date: Sun, 18 Aug 2024 02:50:15 +0300 Subject: [PATCH] feat: added reading config data --- imageroot/actions/get-configuration/20read | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/imageroot/actions/get-configuration/20read b/imageroot/actions/get-configuration/20read index abb0f7b..e6f6342 100755 --- a/imageroot/actions/get-configuration/20read +++ b/imageroot/actions/get-configuration/20read @@ -17,6 +17,21 @@ import agent # Prepare return variable config = {} +if os.path.exists("limesurvey.env"): + data = agent.read_envfile("limesurvey.env") + config["ADMIN_USER"] = data["ADMIN_USER"] + config["ADMIN_NAME"] = data["ADMIN_NAME"] + config["ADMIN_EMAIL"] = data["ADMIN_EMAIL"] + config["ADMIN_PASSWORD"] = data["ADMIN_PASSWORD"] + config["PUBLIC_URL"] = data["PUBLIC_URL"] + config["BASE_URL"] = data["BASE_URL"] +else: + config["ADMIN_USER"] = "" + config["ADMIN_NAME"] = "" + config["ADMIN_EMAIL"] = "" + config["ADMIN_PASSWORD"] = "" + config["PUBLIC_URL"] = "" + config["BASE_URL"] = "" # Read current configuration from the environment file config["host"] = os.getenv("TRAEFIK_HOST","") config["http2https"] = os.getenv("TRAEFIK_HTTP2HTTPS") == "True"