add file env
This commit is contained in:
parent
d1838267ea
commit
37e8e97853
1 changed files with 10 additions and 2 deletions
|
@ -1,8 +1,16 @@
|
|||
import os
|
||||
|
||||
SECRET_KEY = os.environ.get("SECRET_KEY")
|
||||
def env_file(key: str):
|
||||
file_env = os.environ.get(f"{key}_FILE")
|
||||
if os.path.exists(file_env):
|
||||
return open(file_env).read().rstrip('\n')
|
||||
return os.environ.get(key)
|
||||
|
||||
SECRET_KEY = env_file("SECRET_KEY")
|
||||
|
||||
HYDRA_CLIENT_ID = os.environ.get("HYDRA_CLIENT_ID")
|
||||
HYDRA_CLIENT_SECRET = os.environ.get("HYDRA_CLIENT_SECRET")
|
||||
HYDRA_CLIENT_SECRET = env_file("HYDRA_CLIENT_SECRET")
|
||||
|
||||
HYDRA_AUTHORIZATION_BASE_URL = os.environ.get("HYDRA_AUTHORIZATION_BASE_URL")
|
||||
TOKEN_URL = os.environ.get("TOKEN_URL")
|
||||
REDIRECT_URL = os.environ.get("REDIRECT_URL")
|
||||
|
|
Loading…
Reference in a new issue