Skip to content
Snippets Groups Projects
config.py 1.75 KiB
Newer Older
Luka's avatar
Luka committed
import os

LOG_LEVEL = os.environ.get("LOG_LEVEL")

Luka's avatar
Luka committed
SECRET_KEY = os.environ.get("SECRET_KEY")
HYDRA_CLIENT_ID = os.environ.get("HYDRA_CLIENT_ID")
HYDRA_CLIENT_SECRET = os.environ.get("HYDRA_CLIENT_SECRET")
HYDRA_AUTHORIZATION_BASE_URL = os.environ.get("HYDRA_AUTHORIZATION_BASE_URL")
TOKEN_URL = os.environ.get("TOKEN_URL")
Arie Peterson's avatar
Arie Peterson committed
DASHBOARD_URL = os.environ.get("DASHBOARD_URL")
Luka's avatar
Luka committed
LOGIN_PANEL_URL = os.environ.get("LOGIN_PANEL_URL")

HYDRA_PUBLIC_URL = os.environ.get("HYDRA_PUBLIC_URL")
Luka's avatar
Luka committed
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")) + "/"
Luka's avatar
Luka committed
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL")
SQLALCHEMY_TRACK_MODIFICATIONS = False

# 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.
Arie Peterson's avatar
Arie Peterson committed
LOAD_INCLUSTER_CONFIG = os.environ.get("LOAD_INCLUSTER_CONFIG", "").lower() == "true"
RUN_BY_GUNICORN = "gunicorn" in os.environ.get("SERVER_SOFTWARE", "")
Arie Peterson's avatar
Arie Peterson committed
if os.environ.get("TELEPRESENCE_ROOT"):
    TELEPRESENCE = True
    TELEPRESENCE_MODE = os.environ.get("TELEPRESENCE_MODE")
    print(f"TELEPRESENCE_MODE: {TELEPRESENCE_MODE}")
    if TELEPRESENCE_MODE == "docker":
        KUBECONFIG = os.environ["TELEPRESENCE_MOUNTS"]
    else:
        KUBECONFIG = os.environ.get("TELEPRESENCE_ROOT") + os.environ["TELEPRESENCE_MOUNTS"]
    print(f"KUBECONFIG from telepresence: {KUBECONFIG}")
    print(os.stat(KUBECONFIG))
Arie Peterson's avatar
Arie Peterson committed
else:
    TELEPRESENCE = False
    KUBECONFIG = None

DEMO_INSTANCE = os.environ.get("DASHBOARD_DEMO_INSTANCE", "False").lower() in ('true', '1')
ENFORCE_2FA = os.environ.get("DASHBOARD_ENFORCE_2FA", "False").lower() in ('true', '1')