Skip to content

Commit

Permalink
feat: added reading config data
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed Aug 17, 2024
1 parent 52790ca commit bc028b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bc028b7

Please sign in to comment.