diff --git a/.env.default b/.env.default index 48e43d8..677feaf 100644 --- a/.env.default +++ b/.env.default @@ -96,7 +96,7 @@ AE_API_LOG_PATH="/logs/aether_api.log" AE_API_WORKERS=2 AE_API_THREADS=1 AE_API_RELOAD=False - +AE_API_JWT_KEY="ABC123 22 CHARS" # 22 characters; super secret Aether JWT signing key # Aether app specific config (Flask with Svelte) AE_APP_CFG_ID=0 @@ -110,4 +110,6 @@ AE_APP_WORKERS=2 AE_APP_THREADS=1 AE_APP_RELOAD=True # Generate a new key with: # python -c 'import os; print(os.urandom(16))' -AE_APP_CACHE_SECRET_KEY="$\x93\x12\xb4R\x80R\xb5\xe50\xa0k\xc8#RN" \ No newline at end of file +AE_APP_CACHE_SECRET_KEY="$\x93\x12\xb4R\x80R\xb5\xe50\xa0k\xc8#RN" +AE_APP_SESSION_LIFETIME=86400 # How long the browser cookies last in seconds (default=86400) +AE_APP_CACHE_TIMEOUT=5 # How long the Flask app caching last in seconds (default=5) diff --git a/conf/aether_api_config.py b/conf/aether_api_config.py index 9a9c7c1..25d1845 100644 --- a/conf/aether_api_config.py +++ b/conf/aether_api_config.py @@ -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' diff --git a/conf/aether_app_config.py b/conf/aether_app_config.py index 89792ff..940fcb7 100644 --- a/conf/aether_app_config.py +++ b/conf/aether_app_config.py @@ -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