From 3aea713a1b4d01bce85efd6beef155083e60cd8a Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 6 Apr 2022 22:04:56 +0000 Subject: [PATCH] Listen to all hosts if BINALL env var is set --- apiserver/apiserver/settings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apiserver/apiserver/settings.py b/apiserver/apiserver/settings.py index 20e873b..e72c7c3 100644 --- a/apiserver/apiserver/settings.py +++ b/apiserver/apiserver/settings.py @@ -29,6 +29,7 @@ SECRET_KEY = secrets.DJANGO_SECRET_KEY or 'OaOBN2E+brpoRyDMlTD9eTE5PgBtkkl+L7Bzt # SECURITY WARNING: don't run with debug turned on in production! DEBUG_ENV = os.environ.get('DEBUG', False) +BINDALL_ENV = os.environ.get('BINDALL', False) DEBUG = DEBUG_ENV or False @@ -44,12 +45,13 @@ if DEBUG: ALLOWED_HOSTS += [ 'localhost', '127.0.0.1', - 'spaceport-api.dns.t0.vc', 'api.spaceport.dns.t0.vc', - 'api.my.dns.t0.vc', - 'api.my.protospace.ca', ] +if BINDALL_ENV: + ALLOWED_HOSTS = ['*'] + + SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True