2021-09-27 12:03:35 +02:00
|
|
|
import os
|
|
|
|
|
2022-11-08 16:36:16 +01:00
|
|
|
|
2022-11-02 10:25:43 +01:00
|
|
|
def env_file(key: str):
|
|
|
|
file_env = os.environ.get(f"{key}_FILE")
|
|
|
|
if file_env and os.path.exists(file_env):
|
|
|
|
return open(file_env).read().rstrip('\n')
|
|
|
|
return os.environ.get(key)
|
|
|
|
|
2022-11-08 16:36:16 +01:00
|
|
|
|
2022-11-02 10:25:43 +01:00
|
|
|
SECRET_KEY = env_file("SECRET_KEY")
|
|
|
|
|
2022-01-18 10:48:18 +01:00
|
|
|
HYDRA_CLIENT_ID = os.environ.get("HYDRA_CLIENT_ID")
|
2022-11-02 10:25:43 +01:00
|
|
|
HYDRA_CLIENT_SECRET = env_file("HYDRA_CLIENT_SECRET")
|
|
|
|
|
2022-01-18 10:48:18 +01:00
|
|
|
HYDRA_AUTHORIZATION_BASE_URL = os.environ.get("HYDRA_AUTHORIZATION_BASE_URL")
|
|
|
|
TOKEN_URL = os.environ.get("TOKEN_URL")
|
2022-11-02 10:25:43 +01:00
|
|
|
REDIRECT_URL = os.environ.get("REDIRECT_URL")
|
2022-03-21 08:02:29 +01:00
|
|
|
|
2022-04-13 10:27:17 +02:00
|
|
|
LOGIN_PANEL_URL = os.environ.get("LOGIN_PANEL_URL")
|
2022-04-04 14:24:30 +02:00
|
|
|
|
|
|
|
HYDRA_PUBLIC_URL = os.environ.get("HYDRA_PUBLIC_URL")
|
2022-04-13 10:27:17 +02:00
|
|
|
HYDRA_ADMIN_URL = os.environ.get("HYDRA_ADMIN_URL")
|
|
|
|
KRATOS_ADMIN_URL = os.environ.get("KRATOS_ADMIN_URL")
|
|
|
|
KRATOS_PUBLIC_URL = str(os.environ.get("KRATOS_PUBLIC_URL")) + "/"
|
2022-03-21 08:02:29 +01:00
|
|
|
|
2022-04-13 10:27:17 +02:00
|
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
|
2022-03-21 08:02:29 +01:00
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
2022-09-29 16:38:29 +02:00
|
|
|
|
|
|
|
# Set this to "true" to load the config from a Kubernetes serviceaccount
|
|
|
|
# running in a Kubernetes pod. Set it to "false" to load the config from the
|
|
|
|
# `KUBECONFIG` environment variable.
|
2022-11-09 11:40:09 +01:00
|
|
|
LOAD_INCLUSTER_CONFIG = os.environ.get("LOAD_INCLUSTER_CONFIG") == "true"
|
2022-11-08 16:36:16 +01:00
|
|
|
|
|
|
|
AUTHENTIK_BASEURL = os.environ.get("AUTHENTIK_BASEURL")
|