diff --git a/compair/configuration.py b/compair/configuration.py index 34d362c78..5360aee6a 100644 --- a/compair/configuration.py +++ b/compair/configuration.py @@ -22,6 +22,7 @@ import os +from distutils.util import strtobool from flask import Config from sqlalchemy.engine.url import URL @@ -64,22 +65,30 @@ del config['DATABASE'] env_overridables = [ - 'APP_LOGIN_ENABLED', 'CAS_LOGIN_ENABLED', 'LTI_LOGIN_ENABLED', 'CAS_SERVER', 'CAS_AFTER_LOGIN', 'CAS_AFTER_LOGOUT', - 'CAS_LOGIN_ROUTE', 'CAS_LOGOUT_ROUTE', - 'CAS_LOGOUT_RETURN_URL', + 'CAS_LOGIN_ROUTE', 'CAS_LOGOUT_ROUTE', 'CAS_LOGOUT_RETURN_URL', 'CAS_VALIDATE_ROUTE', 'CAS_ATTRIBUTES_TO_STORE', 'SECRET_KEY', 'REPORT_FOLDER', 'UPLOAD_FOLDER', 'ATTACHMENT_UPLOAD_FOLDER', 'ASSET_LOCATION', 'ASSET_CLOUD_URI_PREFIX', - 'CELERY_ALWAYS_EAGER', 'CELERY_RESULT_BACKEND', 'CELERY_BROKER_URL', - 'XAPI_ENABLED', 'XAPI_APP_BASE_URL', + 'CELERY_RESULT_BACKEND', 'CELERY_BROKER_URL', + 'XAPI_APP_BASE_URL', 'LRS_STATEMENT_ENDPOINT', 'LRS_AUTH', 'LRS_USERNAME', 'LRS_PASSWORD', - 'LRS_ACTOR_ACCOUNT_USE_CAS', 'LRS_ACTOR_ACCOUNT_CAS_IDENTIFIER', 'LRS_ACTOR_ACCOUNT_CAS_HOMEPAGE', - 'GA_TRACKING_ID', 'ENFORCE_SSL'] + 'GA_TRACKING_ID' +] + +env_bool_overridables = [ + 'APP_LOGIN_ENABLED', 'CAS_LOGIN_ENABLED', 'LTI_LOGIN_ENABLED', + 'CELERY_ALWAYS_EAGER', 'XAPI_ENABLED', 'LRS_ACTOR_ACCOUNT_USE_CAS', + 'ENFORCE_SSL' +] for env in env_overridables: - if os.environ.get(env): + if os.environ.get(env) != None: config[env] = os.environ.get(env) +for env in env_bool_overridables: + if os.environ.get(env) != None: + config[env] = strtobool(os.environ.get(env)) + # print config \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1d07fd936..8931d016a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,7 @@ services: - DEV=1 - CELERY_BROKER_URL=redis://redis:6379 #- GA_TRACKING_ID=12345 + - ENFORCE_SSL=0 volumes: - .:/code - ./.data/persistent:/code/persistent @@ -51,6 +52,7 @@ services: - DEV=1 - CELERY_BROKER_URL=redis://redis:6379 - C_FORCE_ROOT=1 + - ENFORCE_SSL=0 web: image: nginx:1.11 volumes: