From c3817d5c60d05ac5e8e1bb967203c3d63fb608cf Mon Sep 17 00:00:00 2001 From: hachiyanagi-ks Date: Wed, 30 Nov 2016 15:39:19 +0900 Subject: [PATCH] Add settings of ORA2 fileupload #1498 (#1504) --- cms/envs/aws.py | 16 ++++++++++++++++ cms/envs/common.py | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 648cbe5fa55c..42f85c489d11 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -402,3 +402,19 @@ ### Max character length of course display name MAX_LENGTH_COURSE_DISPLAY_NAME = ENV_TOKENS.get('MAX_LENGTH_COURSE_DISPLAY_NAME', MAX_LENGTH_COURSE_DISPLAY_NAME) + +##### ORA2 ###### +# Prefix for uploads of example-based assessment AI classifiers +# This can be used to separate uploads for different environments +# within the same S3 bucket. +ORA2_FILE_PREFIX = ENV_TOKENS.get("ORA2_FILE_PREFIX", ORA2_FILE_PREFIX) + +# Specific setting for the File Upload Service to store media in a bucket. +FILE_UPLOAD_STORAGE_BUCKET_NAME = ENV_TOKENS.get('FILE_UPLOAD_STORAGE_BUCKET_NAME', FILE_UPLOAD_STORAGE_BUCKET_NAME) +FILE_UPLOAD_STORAGE_PREFIX = ENV_TOKENS.get('FILE_UPLOAD_STORAGE_PREFIX', FILE_UPLOAD_STORAGE_PREFIX) + +# Security settings for ORA2 file upload +if FEATURES.get('ENABLE_ORA2_WAF_PROXY'): + ORA2_WAF_PROXY_SERVER_IP = ENV_TOKENS.get("ORA2_WAF_PROXY_SERVER_IP", ORA2_WAF_PROXY_SERVER_IP) + ORA2_WAF_PROXY_SERVER_PORT = ENV_TOKENS.get("ORA2_WAF_PROXY_SERVER_PORT", ORA2_WAF_PROXY_SERVER_PORT) + ORA2_WAF_VIRUS_DETECTION_KEYWORD = ENV_TOKENS.get("ORA2_WAF_VIRUS_DETECTION_KEYWORD", ORA2_WAF_VIRUS_DETECTION_KEYWORD) diff --git a/cms/envs/common.py b/cms/envs/common.py index 5afdba79253f..79e0af179873 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -47,6 +47,9 @@ REST_FRAMEWORK, # The following settings need to load module(lms.djangoapps.instructor.views.instructor_dashboard). BULK_EMAIL_DEFAULT_RETRY_DELAY, BULK_EMAIL_MAX_RETRIES, GRADES_DOWNLOAD_ROUTING_KEY, + # The following settings need to use ORA2 file upload. + ORA2_FILE_PREFIX, FILE_UPLOAD_STORAGE_BUCKET_NAME, FILE_UPLOAD_STORAGE_PREFIX, + ORA2_WAF_PROXY_SERVER_IP, ORA2_WAF_PROXY_SERVER_PORT, ORA2_WAF_VIRUS_DETECTION_KEYWORD, ) from path import Path as path from warnings import simplefilter @@ -198,6 +201,10 @@ # Enable secure token feature to playback video in JWPlayer XBlock 'ENABLE_JWPLAYER_SECURE_TOKEN': True, + + # Optional security feature for ORA2 file upload + 'ENABLE_ORA2_WAF_PROXY': False, + 'ENABLE_ORA2_FILE_TYPE_STRICT_CHECK': False, } ENABLE_JASMINE = False