diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 75ae712b88..fbcb9b8e4c 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -23,9 +23,16 @@ DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' MITX_FEATURES['ENABLE_DISCUSSION'] = False MITX_FEATURES['ENABLE_DISCUSSION_SERVICE'] = True +# IMPORTANT: With this enabled, the server must always be behind a proxy that +# strips the header HTTP_X_FORWARDED_PROTO from client requests. Otherwise, +# a user can fool our server into thinking it was an https connection. +# See https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header +# for other warnings. +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') ########################### NON-SECURE ENV CONFIG ############################## # Things like server locations, ports, etc. + with open(ENV_ROOT / "env.json") as env_file: ENV_TOKENS = json.load(env_file) @@ -49,6 +56,8 @@ LOGGING = get_logger_config(LOG_DIR, COURSE_LISTINGS = ENV_TOKENS.get('COURSE_LISTINGS', {}) SUBDOMAIN_BRANDING = ENV_TOKENS.get('SUBDOMAIN_BRANDING', {}) +COMMENTS_SERVICE_URL = ENV_TOKENS.get("COMMENTS_SERVICE_URL",'') +COMMENTS_SERVICE_KEY = ENV_TOKENS.get("COMMENTS_SERVICE_KEY",'') ############################## SECURE AUTH ITEMS ############################### # Secret things: passwords, access keys, etc. @@ -67,5 +76,3 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] if 'COURSE_ID' in ENV_TOKENS: ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID']) -COMMENTS_SERVICE_URL = ENV_TOKENS["COMMENTS_SERVICE_URL"] -COMMENTS_SERVICE_KEY = ENV_TOKENS["COMMENTS_SERVICE_KEY"] diff --git a/lms/static/coffee/src/discussion/discussion_module.coffee b/lms/static/coffee/src/discussion/discussion_module.coffee index 4bcacc1474..8306d4d2ae 100644 --- a/lms/static/coffee/src/discussion/discussion_module.coffee +++ b/lms/static/coffee/src/discussion/discussion_module.coffee @@ -27,7 +27,7 @@ if Backbone? $discussion = @$el.find("section.discussion") $(event.target).html("Hide Discussion") discussion = new Discussion() - discussion.reset(response.discussionData, {silent: false}) + discussion.reset(response.discussion_data, {silent: false}) view = new DiscussionView(el: $discussion[0], model: discussion) DiscussionUtil.bulkUpdateContentInfo(window.$$annotated_content_info) @retrieved = true diff --git a/lms/templates/wiki/article.html b/lms/templates/wiki/article.html index 0e2a997290..5b12942af5 100644 --- a/lms/templates/wiki/article.html +++ b/lms/templates/wiki/article.html @@ -33,11 +33,9 @@ {% if urlpath %} - {% endif %} diff --git a/repo-requirements.txt b/repo-requirements.txt index fc6ae1b301..7119106d8b 100644 --- a/repo-requirements.txt +++ b/repo-requirements.txt @@ -1,6 +1,6 @@ -e git://github.com/MITx/django-staticfiles.git@6d2504e5c8#egg=django-staticfiles -e git://github.com/MITx/django-pipeline.git#egg=django-pipeline --e git://github.com/benjaoming/django-wiki.git@7e42bce#egg=django-wiki +-e git://github.com/benjaoming/django-wiki.git@cd1c23e1#egg=django-wiki -e git://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev -e common/lib/capa -e common/lib/xmodule