Better configs with environment vars

This commit is contained in:
Scott Idem
2023-09-08 14:01:00 -04:00
parent cccf9fd24f
commit be1bb21b7e
3 changed files with 7 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ class Settings(BaseSettings):
AETHER_CFG['id'] = os.getenv('AE_CFG_ID', None)
# AETHER_CFG['api_id'] = os.getenv('AE_API_CFG_ID', None) # NOT CURRENTLY NEED OR USED
JWT_KEY = 'EHmSXZFKfMEW65E8kxCKmQ' # 22 characters; super secret Aether JWT signing key
JWT_KEY = os.getenv('AE_API_JWT_KEY', '22 chars 00xXyYzZ99') # 22 characters; super secret Aether JWT signing key
# APP_NAME: str = "Aether API (FastAPI)"
# SUPER_EMAIL: EmailStr = 'Aether.Super@oneskyit.com'

View File

@@ -31,7 +31,7 @@ SECRET_KEY = os.getenv('AE_APP_CACHE_SECRET_KEY', None) # Generate a new key wit
# 7862400 is 91 days or 13 weeks (.25 year)
# 31536000 is 365 days
# 33868800 is 9408 hours or 392 days
PERMANENT_SESSION_LIFETIME = 3600
PERMANENT_SESSION_LIFETIME = int(os.getenv('AE_APP_SESSION_LIFETIME', 86400))
SESSION_REFRESH_EACH_REQUEST = True
# Files and caching
@@ -43,7 +43,7 @@ SESSION_REFRESH_EACH_REQUEST = True
SEND_FILE_MAX_AGE_DEFAULT = 3 # default 43200 (in seconds), 1800 = 30 minutes
CACHE_TYPE = 'SimpleCache'
CACHE_DEFAULT_TIMEOUT = 1
CACHE_DEFAULT_TIMEOUT = int(os.getenv('AE_APP_CACHE_TIMEOUT', 5))
JSONIFY_PRETTYPRINT_REGULAR = True