From e8e7fc23831df91426c2d15776a417adaea90cc5 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 8 Sep 2023 14:45:02 -0400 Subject: [PATCH] More work on configs and env --- .env.default | 1 + conf/aether_api_config.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.default b/.env.default index 502a065..1843803 100644 --- a/.env.default +++ b/.env.default @@ -100,6 +100,7 @@ AE_API_GUNICORN_WORKERS=2 # (default=2) AE_API_GUNICORN_THREADS=2 # (default=2) AE_API_RELOAD=False AE_API_JWT_KEY="ABC123 22 CHARS" # 22 characters; super secret Aether JWT signing key +AE_API_ORIGINS_REGEX="(https://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(https://.*\.oneskyit\.com:8443)" # default allows for some sane domains related to https://.*\.oneskyit\.com with some common extra ports # Aether app specific config (Flask with Svelte) AE_APP_CFG_ID=0 diff --git a/conf/aether_api_config.py b/conf/aether_api_config.py index 25d1845..94e6927 100644 --- a/conf/aether_api_config.py +++ b/conf/aether_api_config.py @@ -59,7 +59,7 @@ class Settings(BaseSettings): # CORS Origins - ORIGINS_REGEX = '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(http://.*\.oneskyit\.com:8080)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)' + ORIGINS_REGEX = os.getenv('AE_API_ORIGINS_REGEX', '(https://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(https://.*\.oneskyit\.com:8443)') # '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)|(http://.*\.oneskyit\.com:8080)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)' # A reasonable, but fairly open example regular expression for the CORS origins: # '(https://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com)|(http://.*\.oneskyit\.com:8181)|(https://.*\.oneskyit\.com:8443)|(http://.*\.oneskyit\.local)|(http://.*\.oneskyit\.local:5000)|(http://.*.localhost)|(http://.*.localhost:5000)|(http://.*.localhost:8181)'