diff --git a/cms/envs/aws.py b/cms/envs/aws.py deleted file mode 100644 index e0c9d9526bcd..000000000000 --- a/cms/envs/aws.py +++ /dev/null @@ -1,583 +0,0 @@ -""" -This is the default template for our main set of AWS servers. -""" - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -import json -import os -import logging - -from path import Path as path -from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed - -from .common import * - -from openedx.core.lib.derived import derive_settings # pylint: disable=wrong-import-order -from openedx.core.lib.logsettings import get_logger_config # pylint: disable=wrong-import-order - -# SERVICE_VARIANT specifies name of the variant used, which decides what JSON -# configuration files are read during startup. -SERVICE_VARIANT = os.environ.get('SERVICE_VARIANT', None) - -# CONFIG_ROOT specifies the directory where the JSON configuration -# files are expected to be found. If not specified, use the project -# directory. -CONFIG_ROOT = path(os.environ.get('CONFIG_ROOT', ENV_ROOT)) - -# CONFIG_PREFIX specifies the prefix of the JSON configuration files, -# based on the service variant. If no variant is use, don't use a -# prefix. -CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else "" - -############### ALWAYS THE SAME ################################ - -DEBUG = False - -EMAIL_BACKEND = 'django_ses.SESBackend' -SESSION_ENGINE = 'django.contrib.sessions.backends.cache' - -# 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') - -###################################### CELERY ################################ - -# Don't use a connection pool, since connections are dropped by ELB. -BROKER_POOL_LIMIT = 0 -BROKER_CONNECTION_TIMEOUT = 1 - -# For the Result Store, use the django cache named 'celery' -CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheBackend' - -# When the broker is behind an ELB, use a heartbeat to refresh the -# connection and to detect if it has been dropped. -BROKER_HEARTBEAT = 60.0 -BROKER_HEARTBEAT_CHECKRATE = 2 - -# Each worker should only fetch one message at a time -CELERYD_PREFETCH_MULTIPLIER = 1 - -# Rename the exchange and queues for each variant - -QUEUE_VARIANT = CONFIG_PREFIX.lower() - -CELERY_DEFAULT_EXCHANGE = 'edx.{0}core'.format(QUEUE_VARIANT) - -HIGH_PRIORITY_QUEUE = 'edx.{0}core.high'.format(QUEUE_VARIANT) -DEFAULT_PRIORITY_QUEUE = 'edx.{0}core.default'.format(QUEUE_VARIANT) - -CELERY_DEFAULT_QUEUE = DEFAULT_PRIORITY_QUEUE -CELERY_DEFAULT_ROUTING_KEY = DEFAULT_PRIORITY_QUEUE - -CELERY_QUEUES = { - HIGH_PRIORITY_QUEUE: {}, - DEFAULT_PRIORITY_QUEUE: {} -} - -CELERY_ROUTES = "{}celery.Router".format(QUEUE_VARIANT) - -############# NON-SECURE ENV CONFIG ############################## -# Things like server locations, ports, etc. -with open(CONFIG_ROOT / CONFIG_PREFIX + "env.json") as env_file: - ENV_TOKENS = json.load(env_file) - -# Do NOT calculate this dynamically at startup with git because it's *slow*. -EDX_PLATFORM_REVISION = ENV_TOKENS.get('EDX_PLATFORM_REVISION', EDX_PLATFORM_REVISION) - -# STATIC_URL_BASE specifies the base url to use for static files -STATIC_URL_BASE = ENV_TOKENS.get('STATIC_URL_BASE', None) -if STATIC_URL_BASE: - # collectstatic will fail if STATIC_URL is a unicode string - STATIC_URL = STATIC_URL_BASE.encode('ascii') - if not STATIC_URL.endswith("/"): - STATIC_URL += "/" - STATIC_URL += 'studio/' - -# DEFAULT_COURSE_ABOUT_IMAGE_URL specifies the default image to show for courses that don't provide one -DEFAULT_COURSE_ABOUT_IMAGE_URL = ENV_TOKENS.get('DEFAULT_COURSE_ABOUT_IMAGE_URL', DEFAULT_COURSE_ABOUT_IMAGE_URL) - -DEFAULT_COURSE_VISIBILITY_IN_CATALOG = ENV_TOKENS.get( - 'DEFAULT_COURSE_VISIBILITY_IN_CATALOG', - DEFAULT_COURSE_VISIBILITY_IN_CATALOG -) - -# DEFAULT_MOBILE_AVAILABLE specifies if the course is available for mobile by default -DEFAULT_MOBILE_AVAILABLE = ENV_TOKENS.get( - 'DEFAULT_MOBILE_AVAILABLE', - DEFAULT_MOBILE_AVAILABLE -) - -# MEDIA_ROOT specifies the directory where user-uploaded files are stored. -MEDIA_ROOT = ENV_TOKENS.get('MEDIA_ROOT', MEDIA_ROOT) -MEDIA_URL = ENV_TOKENS.get('MEDIA_URL', MEDIA_URL) - -# GITHUB_REPO_ROOT is the base directory -# for course data -GITHUB_REPO_ROOT = ENV_TOKENS.get('GITHUB_REPO_ROOT', GITHUB_REPO_ROOT) - -# STATIC_ROOT specifies the directory where static files are -# collected - -STATIC_ROOT_BASE = ENV_TOKENS.get('STATIC_ROOT_BASE', None) -if STATIC_ROOT_BASE: - STATIC_ROOT = path(STATIC_ROOT_BASE) / 'studio' - WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json" - -EMAIL_BACKEND = ENV_TOKENS.get('EMAIL_BACKEND', EMAIL_BACKEND) -EMAIL_FILE_PATH = ENV_TOKENS.get('EMAIL_FILE_PATH', None) - -EMAIL_HOST = ENV_TOKENS.get('EMAIL_HOST', EMAIL_HOST) -EMAIL_PORT = ENV_TOKENS.get('EMAIL_PORT', EMAIL_PORT) -EMAIL_USE_TLS = ENV_TOKENS.get('EMAIL_USE_TLS', EMAIL_USE_TLS) - -LMS_BASE = ENV_TOKENS.get('LMS_BASE') -LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL') -LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL) -ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/') -ENTERPRISE_CONSENT_API_URL = ENV_TOKENS.get('ENTERPRISE_CONSENT_API_URL', LMS_INTERNAL_ROOT_URL + '/consent/api/v1/') -# Note that FEATURES['PREVIEW_LMS_BASE'] gets read in from the environment file. - -# List of logout URIs for each IDA that the learner should be logged out of when they logout of -# Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit). -IDA_LOGOUT_URI_LIST = ENV_TOKENS.get('IDA_LOGOUT_URI_LIST', []) - -SITE_NAME = ENV_TOKENS['SITE_NAME'] - -ALLOWED_HOSTS = [ - # TODO: bbeggs remove this before prod, temp fix to get load testing running - "*", - ENV_TOKENS.get('CMS_BASE') -] - -LOG_DIR = ENV_TOKENS['LOG_DIR'] -DATA_DIR = path(ENV_TOKENS.get('DATA_DIR', DATA_DIR)) - -CACHES = ENV_TOKENS['CACHES'] -# Cache used for location mapping -- called many times with the same key/value -# in a given request. -if 'loc_cache' not in CACHES: - CACHES['loc_cache'] = { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': 'edx_location_mem_cache', - } - -SESSION_COOKIE_DOMAIN = ENV_TOKENS.get('SESSION_COOKIE_DOMAIN') -SESSION_COOKIE_HTTPONLY = ENV_TOKENS.get('SESSION_COOKIE_HTTPONLY', True) -SESSION_ENGINE = ENV_TOKENS.get('SESSION_ENGINE', SESSION_ENGINE) -SESSION_COOKIE_SECURE = ENV_TOKENS.get('SESSION_COOKIE_SECURE', SESSION_COOKIE_SECURE) -SESSION_SAVE_EVERY_REQUEST = ENV_TOKENS.get('SESSION_SAVE_EVERY_REQUEST', SESSION_SAVE_EVERY_REQUEST) - -# social sharing settings -SOCIAL_SHARING_SETTINGS = ENV_TOKENS.get('SOCIAL_SHARING_SETTINGS', SOCIAL_SHARING_SETTINGS) - -REGISTRATION_EMAIL_PATTERNS_ALLOWED = ENV_TOKENS.get('REGISTRATION_EMAIL_PATTERNS_ALLOWED') - -# allow for environments to specify what cookie name our login subsystem should use -# this is to fix a bug regarding simultaneous logins between edx.org and edge.edx.org which can -# happen with some browsers (e.g. Firefox) -if ENV_TOKENS.get('SESSION_COOKIE_NAME', None): - # NOTE, there's a bug in Django (http://bugs.python.org/issue18012) which necessitates this being a str() - SESSION_COOKIE_NAME = str(ENV_TOKENS.get('SESSION_COOKIE_NAME')) - -# Set the names of cookies shared with the marketing site -# These have the same cookie domain as the session, which in production -# usually includes subdomains. -EDXMKTG_LOGGED_IN_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_LOGGED_IN_COOKIE_NAME', EDXMKTG_LOGGED_IN_COOKIE_NAME) -EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', EDXMKTG_USER_INFO_COOKIE_NAME) - -# Determines whether the CSRF token can be transported on -# unencrypted channels. It is set to False here for backward compatibility, -# but it is highly recommended that this is True for environments accessed -# by end users. -CSRF_COOKIE_SECURE = ENV_TOKENS.get('CSRF_COOKIE_SECURE', False) - -#Email overrides -DEFAULT_FROM_EMAIL = ENV_TOKENS.get('DEFAULT_FROM_EMAIL', DEFAULT_FROM_EMAIL) -DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS.get('DEFAULT_FEEDBACK_EMAIL', DEFAULT_FEEDBACK_EMAIL) -ADMINS = ENV_TOKENS.get('ADMINS', ADMINS) -SERVER_EMAIL = ENV_TOKENS.get('SERVER_EMAIL', SERVER_EMAIL) -MKTG_URLS = ENV_TOKENS.get('MKTG_URLS', MKTG_URLS) -MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {})) -TECH_SUPPORT_EMAIL = ENV_TOKENS.get('TECH_SUPPORT_EMAIL', TECH_SUPPORT_EMAIL) - -for name, value in ENV_TOKENS.get("CODE_JAIL", {}).items(): - oldvalue = CODE_JAIL.get(name) - if isinstance(oldvalue, dict): - for subname, subvalue in value.items(): - oldvalue[subname] = subvalue - else: - CODE_JAIL[name] = value - -COURSES_WITH_UNSAFE_CODE = ENV_TOKENS.get("COURSES_WITH_UNSAFE_CODE", []) - -ASSET_IGNORE_REGEX = ENV_TOKENS.get('ASSET_IGNORE_REGEX', ASSET_IGNORE_REGEX) - -COMPREHENSIVE_THEME_DIRS = ENV_TOKENS.get('COMPREHENSIVE_THEME_DIRS', COMPREHENSIVE_THEME_DIRS) or [] - -# COMPREHENSIVE_THEME_LOCALE_PATHS contain the paths to themes locale directories e.g. -# "COMPREHENSIVE_THEME_LOCALE_PATHS" : [ -# "/edx/src/edx-themes/conf/locale" -# ], -COMPREHENSIVE_THEME_LOCALE_PATHS = ENV_TOKENS.get('COMPREHENSIVE_THEME_LOCALE_PATHS', []) - -DEFAULT_SITE_THEME = ENV_TOKENS.get('DEFAULT_SITE_THEME', DEFAULT_SITE_THEME) -ENABLE_COMPREHENSIVE_THEMING = ENV_TOKENS.get('ENABLE_COMPREHENSIVE_THEMING', ENABLE_COMPREHENSIVE_THEMING) - -#Timezone overrides -TIME_ZONE = ENV_TOKENS.get('TIME_ZONE', TIME_ZONE) - -# Push to LMS overrides -GIT_REPO_EXPORT_DIR = ENV_TOKENS.get('GIT_REPO_EXPORT_DIR', '/edx/var/edxapp/export_course_repos') - -# Translation overrides -LANGUAGES = ENV_TOKENS.get('LANGUAGES', LANGUAGES) -LANGUAGE_CODE = ENV_TOKENS.get('LANGUAGE_CODE', LANGUAGE_CODE) -LANGUAGE_COOKIE = ENV_TOKENS.get('LANGUAGE_COOKIE', LANGUAGE_COOKIE) - -USE_I18N = ENV_TOKENS.get('USE_I18N', USE_I18N) -ALL_LANGUAGES = ENV_TOKENS.get('ALL_LANGUAGES', ALL_LANGUAGES) - -ENV_FEATURES = ENV_TOKENS.get('FEATURES', {}) -for feature, value in ENV_FEATURES.items(): - FEATURES[feature] = value - -# Additional installed apps -for app in ENV_TOKENS.get('ADDL_INSTALLED_APPS', []): - INSTALLED_APPS.append(app) - -WIKI_ENABLED = ENV_TOKENS.get('WIKI_ENABLED', WIKI_ENABLED) - -LOGGING = get_logger_config(LOG_DIR, - logging_env=ENV_TOKENS['LOGGING_ENV'], - service_variant=SERVICE_VARIANT) - -#theming start: -PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', PLATFORM_NAME) -PLATFORM_DESCRIPTION = ENV_TOKENS.get('PLATFORM_DESCRIPTION', PLATFORM_DESCRIPTION) -STUDIO_NAME = ENV_TOKENS.get('STUDIO_NAME', STUDIO_NAME) -STUDIO_SHORT_NAME = ENV_TOKENS.get('STUDIO_SHORT_NAME', STUDIO_SHORT_NAME) - -# Event Tracking -if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS: - TRACKING_IGNORE_URL_PATTERNS = ENV_TOKENS.get("TRACKING_IGNORE_URL_PATTERNS") - -# Heartbeat -HEARTBEAT_CHECKS = ENV_TOKENS.get('HEARTBEAT_CHECKS', HEARTBEAT_CHECKS) -HEARTBEAT_EXTENDED_CHECKS = ENV_TOKENS.get('HEARTBEAT_EXTENDED_CHECKS', HEARTBEAT_EXTENDED_CHECKS) -HEARTBEAT_CELERY_TIMEOUT = ENV_TOKENS.get('HEARTBEAT_CELERY_TIMEOUT', HEARTBEAT_CELERY_TIMEOUT) - -# 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) - -# Zendesk -ZENDESK_URL = ENV_TOKENS.get('ZENDESK_URL', ZENDESK_URL) -ZENDESK_CUSTOM_FIELDS = ENV_TOKENS.get('ZENDESK_CUSTOM_FIELDS', ZENDESK_CUSTOM_FIELDS) - -################ SECURE AUTH ITEMS ############################### -# Secret things: passwords, access keys, etc. -with open(CONFIG_ROOT / CONFIG_PREFIX + "auth.json") as auth_file: - AUTH_TOKENS = json.load(auth_file) - -############### XBlock filesystem field config ########## -if 'DJFS' in AUTH_TOKENS and AUTH_TOKENS['DJFS'] is not None: - DJFS = AUTH_TOKENS['DJFS'] - if 'url_root' in DJFS: - DJFS['url_root'] = DJFS['url_root'].format(platform_revision=EDX_PLATFORM_REVISION) - -EMAIL_HOST_USER = AUTH_TOKENS.get('EMAIL_HOST_USER', EMAIL_HOST_USER) -EMAIL_HOST_PASSWORD = AUTH_TOKENS.get('EMAIL_HOST_PASSWORD', EMAIL_HOST_PASSWORD) - -AWS_SES_REGION_NAME = ENV_TOKENS.get('AWS_SES_REGION_NAME', 'us-east-1') -AWS_SES_REGION_ENDPOINT = ENV_TOKENS.get('AWS_SES_REGION_ENDPOINT', 'email.us-east-1.amazonaws.com') - -# Note that this is the Studio key for Segment. There is a separate key for the LMS. -CMS_SEGMENT_KEY = AUTH_TOKENS.get('SEGMENT_KEY') - -SECRET_KEY = AUTH_TOKENS['SECRET_KEY'] - -AWS_ACCESS_KEY_ID = AUTH_TOKENS["AWS_ACCESS_KEY_ID"] -if AWS_ACCESS_KEY_ID == "": - AWS_ACCESS_KEY_ID = None - -AWS_SECRET_ACCESS_KEY = AUTH_TOKENS["AWS_SECRET_ACCESS_KEY"] -if AWS_SECRET_ACCESS_KEY == "": - AWS_SECRET_ACCESS_KEY = None - -AWS_STORAGE_BUCKET_NAME = AUTH_TOKENS.get('AWS_STORAGE_BUCKET_NAME', 'edxuploads') - -# Disabling querystring auth instructs Boto to exclude the querystring parameters (e.g. signature, access key) it -# normally appends to every returned URL. -AWS_QUERYSTRING_AUTH = AUTH_TOKENS.get('AWS_QUERYSTRING_AUTH', True) - -AWS_DEFAULT_ACL = 'private' -AWS_BUCKET_ACL = AWS_DEFAULT_ACL -AWS_QUERYSTRING_EXPIRE = 7 * 24 * 60 * 60 # 7 days -AWS_S3_CUSTOM_DOMAIN = AUTH_TOKENS.get('AWS_S3_CUSTOM_DOMAIN', 'edxuploads.s3.amazonaws.com') - -if AUTH_TOKENS.get('DEFAULT_FILE_STORAGE'): - DEFAULT_FILE_STORAGE = AUTH_TOKENS.get('DEFAULT_FILE_STORAGE') -elif AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY: - DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' -else: - DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' - -COURSE_IMPORT_EXPORT_BUCKET = ENV_TOKENS.get('COURSE_IMPORT_EXPORT_BUCKET', '') - -if COURSE_IMPORT_EXPORT_BUCKET: - COURSE_IMPORT_EXPORT_STORAGE = 'contentstore.storage.ImportExportS3Storage' -else: - COURSE_IMPORT_EXPORT_STORAGE = DEFAULT_FILE_STORAGE - -USER_TASKS_ARTIFACT_STORAGE = COURSE_IMPORT_EXPORT_STORAGE - -DATABASES = AUTH_TOKENS['DATABASES'] - -# The normal database user does not have enough permissions to run migrations. -# Migrations are run with separate credentials, given as DB_MIGRATION_* -# environment variables -for name, database in DATABASES.items(): - if name != 'read_replica': - database.update({ - 'ENGINE': os.environ.get('DB_MIGRATION_ENGINE', database['ENGINE']), - 'USER': os.environ.get('DB_MIGRATION_USER', database['USER']), - 'PASSWORD': os.environ.get('DB_MIGRATION_PASS', database['PASSWORD']), - 'NAME': os.environ.get('DB_MIGRATION_NAME', database['NAME']), - 'HOST': os.environ.get('DB_MIGRATION_HOST', database['HOST']), - 'PORT': os.environ.get('DB_MIGRATION_PORT', database['PORT']), - }) - -MODULESTORE = convert_module_store_setting_if_needed(AUTH_TOKENS.get('MODULESTORE', MODULESTORE)) - -MODULESTORE_FIELD_OVERRIDE_PROVIDERS = ENV_TOKENS.get( - 'MODULESTORE_FIELD_OVERRIDE_PROVIDERS', - MODULESTORE_FIELD_OVERRIDE_PROVIDERS -) - -XBLOCK_FIELD_DATA_WRAPPERS = ENV_TOKENS.get( - 'XBLOCK_FIELD_DATA_WRAPPERS', - XBLOCK_FIELD_DATA_WRAPPERS -) - -CONTENTSTORE = AUTH_TOKENS['CONTENTSTORE'] -DOC_STORE_CONFIG = AUTH_TOKENS['DOC_STORE_CONFIG'] -# Datadog for events! -DATADOG = AUTH_TOKENS.get("DATADOG", {}) -DATADOG.update(ENV_TOKENS.get("DATADOG", {})) - -# TODO: deprecated (compatibility with previous settings) -if 'DATADOG_API' in AUTH_TOKENS: - DATADOG['api_key'] = AUTH_TOKENS['DATADOG_API'] - -# Celery Broker -CELERY_ALWAYS_EAGER = ENV_TOKENS.get("CELERY_ALWAYS_EAGER", False) -CELERY_BROKER_TRANSPORT = ENV_TOKENS.get("CELERY_BROKER_TRANSPORT", "") -CELERY_BROKER_HOSTNAME = ENV_TOKENS.get("CELERY_BROKER_HOSTNAME", "") -CELERY_BROKER_VHOST = ENV_TOKENS.get("CELERY_BROKER_VHOST", "") -CELERY_BROKER_USER = AUTH_TOKENS.get("CELERY_BROKER_USER", "") -CELERY_BROKER_PASSWORD = AUTH_TOKENS.get("CELERY_BROKER_PASSWORD", "") - -BROKER_URL = "{0}://{1}:{2}@{3}/{4}".format(CELERY_BROKER_TRANSPORT, - CELERY_BROKER_USER, - CELERY_BROKER_PASSWORD, - CELERY_BROKER_HOSTNAME, - CELERY_BROKER_VHOST) -BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False) - -# Message expiry time in seconds -CELERY_EVENT_QUEUE_TTL = ENV_TOKENS.get('CELERY_EVENT_QUEUE_TTL', None) - -# Allow CELERY_QUEUES to be overwritten by ENV_TOKENS, -ENV_CELERY_QUEUES = ENV_TOKENS.get('CELERY_QUEUES', None) -if ENV_CELERY_QUEUES: - CELERY_QUEUES = {queue: {} for queue in ENV_CELERY_QUEUES} - -# Then add alternate environment queues -ALTERNATE_QUEUE_ENVS = ENV_TOKENS.get('ALTERNATE_WORKER_QUEUES', '').split() -ALTERNATE_QUEUES = [ - DEFAULT_PRIORITY_QUEUE.replace(QUEUE_VARIANT, alternate + '.') - for alternate in ALTERNATE_QUEUE_ENVS -] - -CELERY_QUEUES.update( - { - alternate: {} - for alternate in ALTERNATE_QUEUES - if alternate not in CELERY_QUEUES.keys() - } -) - -# Queue to use for updating grades due to grading policy change -POLICY_CHANGE_GRADES_ROUTING_KEY = ENV_TOKENS.get('POLICY_CHANGE_GRADES_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) - -# Rate limit for regrading tasks that a grading policy change can kick off -POLICY_CHANGE_TASK_RATE_LIMIT = ENV_TOKENS.get('POLICY_CHANGE_TASK_RATE_LIMIT', POLICY_CHANGE_TASK_RATE_LIMIT) - -# Event tracking -TRACKING_BACKENDS.update(AUTH_TOKENS.get("TRACKING_BACKENDS", {})) -EVENT_TRACKING_BACKENDS['tracking_logs']['OPTIONS']['backends'].update(AUTH_TOKENS.get("EVENT_TRACKING_BACKENDS", {})) -EVENT_TRACKING_BACKENDS['segmentio']['OPTIONS']['processors'][0]['OPTIONS']['whitelist'].extend( - AUTH_TOKENS.get("EVENT_TRACKING_SEGMENTIO_EMIT_WHITELIST", [])) - -##### ACCOUNT LOCKOUT DEFAULT PARAMETERS ##### -MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED", 5) -MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS", 15 * 60) - -#### PASSWORD POLICY SETTINGS ##### -AUTH_PASSWORD_VALIDATORS = ENV_TOKENS.get("AUTH_PASSWORD_VALIDATORS", AUTH_PASSWORD_VALIDATORS) - -### INACTIVITY SETTINGS #### -SESSION_INACTIVITY_TIMEOUT_IN_SECONDS = AUTH_TOKENS.get("SESSION_INACTIVITY_TIMEOUT_IN_SECONDS") - -##### X-Frame-Options response header settings ##### -X_FRAME_OPTIONS = ENV_TOKENS.get('X_FRAME_OPTIONS', X_FRAME_OPTIONS) - -################ ADVANCED COMPONENT/PROBLEM TYPES ############### - -ADVANCED_PROBLEM_TYPES = ENV_TOKENS.get('ADVANCED_PROBLEM_TYPES', ADVANCED_PROBLEM_TYPES) - -################ VIDEO UPLOAD PIPELINE ############### - -VIDEO_UPLOAD_PIPELINE = ENV_TOKENS.get('VIDEO_UPLOAD_PIPELINE', VIDEO_UPLOAD_PIPELINE) - -################ VIDEO IMAGE STORAGE ############### - -VIDEO_IMAGE_SETTINGS = ENV_TOKENS.get('VIDEO_IMAGE_SETTINGS', VIDEO_IMAGE_SETTINGS) - -################ VIDEO TRANSCRIPTS STORAGE ############### - -VIDEO_TRANSCRIPTS_SETTINGS = ENV_TOKENS.get('VIDEO_TRANSCRIPTS_SETTINGS', VIDEO_TRANSCRIPTS_SETTINGS) - -################ PUSH NOTIFICATIONS ############### - -PARSE_KEYS = AUTH_TOKENS.get("PARSE_KEYS", {}) - - -# Video Caching. Pairing country codes with CDN URLs. -# Example: {'CN': 'http://api.xuetangx.com/edx/video?s3_url='} -VIDEO_CDN_URL = ENV_TOKENS.get('VIDEO_CDN_URL', {}) - -if FEATURES['ENABLE_COURSEWARE_INDEX'] or FEATURES['ENABLE_LIBRARY_INDEX']: - # Use ElasticSearch for the search engine - SEARCH_ENGINE = "search.elastic.ElasticSearchEngine" - -ELASTIC_SEARCH_CONFIG = ENV_TOKENS.get('ELASTIC_SEARCH_CONFIG', [{}]) - -XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {}) -XBLOCK_SETTINGS.setdefault("VideoDescriptor", {})["licensing_enabled"] = FEATURES.get("LICENSING", False) -XBLOCK_SETTINGS.setdefault("VideoModule", {})['YOUTUBE_API_KEY'] = AUTH_TOKENS.get('YOUTUBE_API_KEY', YOUTUBE_API_KEY) - -################# MICROSITE #################### -# microsite specific configurations. -MICROSITE_CONFIGURATION = ENV_TOKENS.get('MICROSITE_CONFIGURATION', {}) -MICROSITE_ROOT_DIR = path(ENV_TOKENS.get('MICROSITE_ROOT_DIR', '')) -# this setting specify which backend to be used when pulling microsite specific configuration -MICROSITE_BACKEND = ENV_TOKENS.get("MICROSITE_BACKEND", MICROSITE_BACKEND) -# this setting specify which backend to be used when loading microsite specific templates -MICROSITE_TEMPLATE_BACKEND = ENV_TOKENS.get("MICROSITE_TEMPLATE_BACKEND", MICROSITE_TEMPLATE_BACKEND) -# TTL for microsite database template cache -MICROSITE_DATABASE_TEMPLATE_CACHE_TTL = ENV_TOKENS.get( - "MICROSITE_DATABASE_TEMPLATE_CACHE_TTL", MICROSITE_DATABASE_TEMPLATE_CACHE_TTL -) - -############################ OAUTH2 Provider ################################### - -# OpenID Connect issuer ID. Normally the URL of the authentication endpoint. -OAUTH_OIDC_ISSUER = ENV_TOKENS['OAUTH_OIDC_ISSUER'] - -#### JWT configuration #### -JWT_AUTH.update(ENV_TOKENS.get('JWT_AUTH', {})) -JWT_AUTH.update(AUTH_TOKENS.get('JWT_AUTH', {})) - -######################## CUSTOM COURSES for EDX CONNECTOR ###################### -if FEATURES.get('CUSTOM_COURSES_EDX'): - INSTALLED_APPS.append('openedx.core.djangoapps.ccxcon.apps.CCXConnectorConfig') - -# Partner support link for CMS footer -PARTNER_SUPPORT_EMAIL = ENV_TOKENS.get('PARTNER_SUPPORT_EMAIL', PARTNER_SUPPORT_EMAIL) - -# Affiliate cookie tracking -AFFILIATE_COOKIE_NAME = ENV_TOKENS.get('AFFILIATE_COOKIE_NAME', AFFILIATE_COOKIE_NAME) - -############## Settings for Studio Context Sensitive Help ############## - -HELP_TOKENS_BOOKS = ENV_TOKENS.get('HELP_TOKENS_BOOKS', HELP_TOKENS_BOOKS) - -############## Settings for CourseGraph ############################ -COURSEGRAPH_JOB_QUEUE = ENV_TOKENS.get('COURSEGRAPH_JOB_QUEUE', DEFAULT_PRIORITY_QUEUE) - -########## Settings for video transcript migration tasks ############ -VIDEO_TRANSCRIPT_MIGRATIONS_JOB_QUEUE = ENV_TOKENS.get('VIDEO_TRANSCRIPT_MIGRATIONS_JOB_QUEUE', DEFAULT_PRIORITY_QUEUE) - -########## Settings youtube thumbnails scraper tasks ############ -SCRAPE_YOUTUBE_THUMBNAILS_JOB_QUEUE = ENV_TOKENS.get('SCRAPE_YOUTUBE_THUMBNAILS_JOB_QUEUE', DEFAULT_PRIORITY_QUEUE) - -########################## Parental controls config ####################### - -# The age at which a learner no longer requires parental consent, or None -# if parental consent is never required. -PARENTAL_CONSENT_AGE_LIMIT = ENV_TOKENS.get( - 'PARENTAL_CONSENT_AGE_LIMIT', - PARENTAL_CONSENT_AGE_LIMIT -) - -########################## Extra middleware classes ####################### - -# Allow extra middleware classes to be added to the app through configuration. -MIDDLEWARE_CLASSES.extend(ENV_TOKENS.get('EXTRA_MIDDLEWARE_CLASSES', [])) - -########################## Settings for Completion API ##################### - -# Once a user has watched this percentage of a video, mark it as complete: -# (0.0 = 0%, 1.0 = 100%) -COMPLETION_VIDEO_COMPLETE_PERCENTAGE = ENV_TOKENS.get( - 'COMPLETION_VIDEO_COMPLETE_PERCENTAGE', - COMPLETION_VIDEO_COMPLETE_PERCENTAGE, -) - -####################### Enterprise Settings ###################### -# A shared secret to be used for encrypting passwords passed from the enterprise api -# to the enteprise reporting script. -ENTERPRISE_REPORTING_SECRET = AUTH_TOKENS.get( - 'ENTERPRISE_REPORTING_SECRET', - ENTERPRISE_REPORTING_SECRET -) - -# A default dictionary to be used for filtering out enterprise customer catalog. -ENTERPRISE_CUSTOMER_CATALOG_DEFAULT_CONTENT_FILTER = ENV_TOKENS.get( - 'ENTERPRISE_CUSTOMER_CATALOG_DEFAULT_CONTENT_FILTER', - ENTERPRISE_CUSTOMER_CATALOG_DEFAULT_CONTENT_FILTER -) - -############### Settings for Retirement ##################### -RETIRED_USERNAME_PREFIX = ENV_TOKENS.get('RETIRED_USERNAME_PREFIX', RETIRED_USERNAME_PREFIX) -RETIRED_EMAIL_PREFIX = ENV_TOKENS.get('RETIRED_EMAIL_PREFIX', RETIRED_EMAIL_PREFIX) -RETIRED_EMAIL_DOMAIN = ENV_TOKENS.get('RETIRED_EMAIL_DOMAIN', RETIRED_EMAIL_DOMAIN) -RETIRED_USER_SALTS = ENV_TOKENS.get('RETIRED_USER_SALTS', RETIRED_USER_SALTS) -RETIREMENT_SERVICE_WORKER_USERNAME = ENV_TOKENS.get( - 'RETIREMENT_SERVICE_WORKER_USERNAME', - RETIREMENT_SERVICE_WORKER_USERNAME -) -RETIREMENT_STATES = ENV_TOKENS.get('RETIREMENT_STATES', RETIREMENT_STATES) - -############## Settings for Course Enrollment Modes ###################### -COURSE_ENROLLMENT_MODES = ENV_TOKENS.get('COURSE_ENROLLMENT_MODES', COURSE_ENROLLMENT_MODES) - -####################### Plugin Settings ########################## - -# This is at the bottom because it is going to load more settings after base settings are loaded -from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants # pylint: disable=wrong-import-order, wrong-import-position -plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.AWS) - -########################## Derive Any Derived Settings ####################### - -derive_settings(__name__) - -logging.warn('DEPRECATION WARNING: aws.py has been deprecated, you should use production.py instead.') diff --git a/cms/envs/common.py b/cms/envs/common.py index 2a5c20cd8a07..2a050fb61747 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -654,7 +654,7 @@ ADMINS = [] MANAGERS = ADMINS -# Initialize to 'unknown', but read from JSON in aws.py +# Initialize to 'unknown', but read from JSON in production.py EDX_PLATFORM_REVISION = 'unknown' # Static content diff --git a/cms/envs/openstack.py b/cms/envs/openstack.py index 05f60692450c..8e35122c761c 100644 --- a/cms/envs/openstack.py +++ b/cms/envs/openstack.py @@ -2,8 +2,6 @@ Settings for OpenStack deployments. """ -# We import the aws settings because that's currently where the base settings are stored for all deployments. -# TODO - fix this when aws.py is split/renamed. from .production import * # pylint: disable=wildcard-import, unused-wildcard-import SWIFT_AUTH_URL = AUTH_TOKENS.get('SWIFT_AUTH_URL') diff --git a/cms/envs/production.py b/cms/envs/production.py index 906756b0b487..3d1a21793cd6 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -604,12 +604,6 @@ def get_env_setting(setting): # This is at the bottom because it is going to load more settings after base settings are loaded -# Load aws.py in plugins for reverse compatibility. This can be removed after aws.py -# is officially removed. -plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, - plugin_constants.SettingsType.AWS) - -# We continue to load production.py over aws.py plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_constants.SettingsType.PRODUCTION) ########################## Derive Any Derived Settings ####################### diff --git a/common/djangoapps/third_party_auth/models.py b/common/djangoapps/third_party_auth/models.py index 00423b81599d..12400d506e1a 100644 --- a/common/djangoapps/third_party_auth/models.py +++ b/common/djangoapps/third_party_auth/models.py @@ -338,7 +338,8 @@ class OAuth2ProviderConfig(ProviderConfig): help_text=( "Which python-social-auth OAuth2 provider backend to use. " "The list of backend choices is determined by the THIRD_PARTY_AUTH_BACKENDS setting." - # To be precise, it's set by AUTHENTICATION_BACKENDS - which aws.py sets from THIRD_PARTY_AUTH_BACKENDS + # To be precise, it's set by AUTHENTICATION_BACKENDS + # which production.py sets from THIRD_PARTY_AUTH_BACKENDS ) ) key = models.TextField(blank=True, verbose_name="Client ID") diff --git a/lms/djangoapps/grades/apps.py b/lms/djangoapps/grades/apps.py index 9c1fda902c73..9c992ca17830 100644 --- a/lms/djangoapps/grades/apps.py +++ b/lms/djangoapps/grades/apps.py @@ -26,7 +26,7 @@ class GradesConfig(AppConfig): }, PluginSettings.CONFIG: { ProjectType.LMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'}, } diff --git a/lms/djangoapps/grades/settings/aws.py b/lms/djangoapps/grades/settings/production.py similarity index 81% rename from lms/djangoapps/grades/settings/aws.py rename to lms/djangoapps/grades/settings/production.py index 9b2ffb0b1656..744e0ba95278 100644 --- a/lms/djangoapps/grades/settings/aws.py +++ b/lms/djangoapps/grades/settings/production.py @@ -1,4 +1,8 @@ +"""Common environment variables unique to the grades plugin.""" + + def plugin_settings(settings): + """Common settings for Grades""" # Queue to use for updating persistent grades settings.RECALCULATE_GRADES_ROUTING_KEY = settings.ENV_TOKENS.get( 'RECALCULATE_GRADES_ROUTING_KEY', settings.DEFAULT_PRIORITY_QUEUE, diff --git a/lms/djangoapps/instructor/apps.py b/lms/djangoapps/instructor/apps.py index 5d04fff44af0..491521312867 100644 --- a/lms/djangoapps/instructor/apps.py +++ b/lms/djangoapps/instructor/apps.py @@ -26,7 +26,7 @@ class InstructorConfig(AppConfig): PluginSettings.CONFIG: { ProjectType.LMS: { SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'}, } diff --git a/lms/djangoapps/instructor/settings/aws.py b/lms/djangoapps/instructor/settings/production.py similarity index 100% rename from lms/djangoapps/instructor/settings/aws.py rename to lms/djangoapps/instructor/settings/production.py diff --git a/lms/envs/aws.py b/lms/envs/aws.py deleted file mode 100644 index 9d6bde555107..000000000000 --- a/lms/envs/aws.py +++ /dev/null @@ -1,1101 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -This is the default template for our main set of AWS servers. - -Common traits: -* Use memcached, and cache-backed sessions -* Use a MySQL 5.1 database -""" - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=wildcard-import, unused-wildcard-import - -# Pylint gets confused by path.py instances, which report themselves as class -# objects. As a result, pylint applies the wrong regex in validating names, -# and throws spurious errors. Therefore, we disable invalid-name checking. -# pylint: disable=invalid-name - -import datetime -import json -import os -import logging -import dateutil - -from corsheaders.defaults import default_headers as corsheaders_default_headers -from path import Path as path -from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed - -from .common import * - -from openedx.core.lib.derived import derive_settings # pylint: disable=wrong-import-order -from openedx.core.lib.logsettings import get_logger_config # pylint: disable=wrong-import-order - -# SERVICE_VARIANT specifies name of the variant used, which decides what JSON -# configuration files are read during startup. -SERVICE_VARIANT = os.environ.get('SERVICE_VARIANT', None) - -# CONFIG_ROOT specifies the directory where the JSON configuration -# files are expected to be found. If not specified, use the project -# directory. -CONFIG_ROOT = path(os.environ.get('CONFIG_ROOT', ENV_ROOT)) - -# CONFIG_PREFIX specifies the prefix of the JSON configuration files, -# based on the service variant. If no variant is use, don't use a -# prefix. -CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else "" - -################################ ALWAYS THE SAME ############################## - -DEBUG = False -DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = False - -EMAIL_BACKEND = 'django_ses.SESBackend' -SESSION_ENGINE = 'django.contrib.sessions.backends.cache' - -# 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') - -###################################### CELERY ################################ - -# Don't use a connection pool, since connections are dropped by ELB. -BROKER_POOL_LIMIT = 0 -BROKER_CONNECTION_TIMEOUT = 1 - -# For the Result Store, use the django cache named 'celery' -CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheBackend' - -# When the broker is behind an ELB, use a heartbeat to refresh the -# connection and to detect if it has been dropped. -BROKER_HEARTBEAT = 60.0 -BROKER_HEARTBEAT_CHECKRATE = 2 - -# Each worker should only fetch one message at a time -CELERYD_PREFETCH_MULTIPLIER = 1 - -# Rename the exchange and queues for each variant - -QUEUE_VARIANT = CONFIG_PREFIX.lower() - -CELERY_DEFAULT_EXCHANGE = 'edx.{0}core'.format(QUEUE_VARIANT) - -HIGH_PRIORITY_QUEUE = 'edx.{0}core.high'.format(QUEUE_VARIANT) -DEFAULT_PRIORITY_QUEUE = 'edx.{0}core.default'.format(QUEUE_VARIANT) -HIGH_MEM_QUEUE = 'edx.{0}core.high_mem'.format(QUEUE_VARIANT) - -CELERY_DEFAULT_QUEUE = DEFAULT_PRIORITY_QUEUE -CELERY_DEFAULT_ROUTING_KEY = DEFAULT_PRIORITY_QUEUE - -CELERY_QUEUES = { - HIGH_PRIORITY_QUEUE: {}, - DEFAULT_PRIORITY_QUEUE: {}, - HIGH_MEM_QUEUE: {}, -} - -CELERY_ROUTES = "{}celery.Router".format(QUEUE_VARIANT) -CELERYBEAT_SCHEDULE = {} # For scheduling tasks, entries can be added to this dict - -########################## NON-SECURE ENV CONFIG ############################## -# Things like server locations, ports, etc. - -with open(CONFIG_ROOT / CONFIG_PREFIX + "env.json") as env_file: - ENV_TOKENS = json.load(env_file) - -# STATIC_ROOT specifies the directory where static files are -# collected -STATIC_ROOT_BASE = ENV_TOKENS.get('STATIC_ROOT_BASE', None) -if STATIC_ROOT_BASE: - STATIC_ROOT = path(STATIC_ROOT_BASE) - WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json" - - -# STATIC_URL_BASE specifies the base url to use for static files -STATIC_URL_BASE = ENV_TOKENS.get('STATIC_URL_BASE', None) -if STATIC_URL_BASE: - # collectstatic will fail if STATIC_URL is a unicode string - STATIC_URL = STATIC_URL_BASE.encode('ascii') - if not STATIC_URL.endswith("/"): - STATIC_URL += "/" - -# DEFAULT_COURSE_ABOUT_IMAGE_URL specifies the default image to show for courses that don't provide one -DEFAULT_COURSE_ABOUT_IMAGE_URL = ENV_TOKENS.get('DEFAULT_COURSE_ABOUT_IMAGE_URL', DEFAULT_COURSE_ABOUT_IMAGE_URL) - -# COURSE_MODE_DEFAULTS specifies the course mode to use for courses that do not set one -COURSE_MODE_DEFAULTS = ENV_TOKENS.get('COURSE_MODE_DEFAULTS', COURSE_MODE_DEFAULTS) - -# MEDIA_ROOT specifies the directory where user-uploaded files are stored. -MEDIA_ROOT = ENV_TOKENS.get('MEDIA_ROOT', MEDIA_ROOT) -MEDIA_URL = ENV_TOKENS.get('MEDIA_URL', MEDIA_URL) - -PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', PLATFORM_NAME) -PLATFORM_DESCRIPTION = ENV_TOKENS.get('PLATFORM_DESCRIPTION', PLATFORM_DESCRIPTION) -# For displaying on the receipt. At Stanford PLATFORM_NAME != MERCHANT_NAME, but PLATFORM_NAME is a fine default -PLATFORM_TWITTER_ACCOUNT = ENV_TOKENS.get('PLATFORM_TWITTER_ACCOUNT', PLATFORM_TWITTER_ACCOUNT) -PLATFORM_FACEBOOK_ACCOUNT = ENV_TOKENS.get('PLATFORM_FACEBOOK_ACCOUNT', PLATFORM_FACEBOOK_ACCOUNT) - -SOCIAL_SHARING_SETTINGS = ENV_TOKENS.get('SOCIAL_SHARING_SETTINGS', SOCIAL_SHARING_SETTINGS) - -# Social media links for the page footer -SOCIAL_MEDIA_FOOTER_URLS = ENV_TOKENS.get('SOCIAL_MEDIA_FOOTER_URLS', SOCIAL_MEDIA_FOOTER_URLS) - -CC_MERCHANT_NAME = ENV_TOKENS.get('CC_MERCHANT_NAME', PLATFORM_NAME) -EMAIL_BACKEND = ENV_TOKENS.get('EMAIL_BACKEND', EMAIL_BACKEND) -EMAIL_FILE_PATH = ENV_TOKENS.get('EMAIL_FILE_PATH', None) -EMAIL_HOST = ENV_TOKENS.get('EMAIL_HOST', 'localhost') # django default is localhost -EMAIL_PORT = ENV_TOKENS.get('EMAIL_PORT', 25) # django default is 25 -EMAIL_USE_TLS = ENV_TOKENS.get('EMAIL_USE_TLS', False) # django default is False -SITE_NAME = ENV_TOKENS['SITE_NAME'] -HTTPS = ENV_TOKENS.get('HTTPS', HTTPS) -SESSION_ENGINE = ENV_TOKENS.get('SESSION_ENGINE', SESSION_ENGINE) -SESSION_COOKIE_DOMAIN = ENV_TOKENS.get('SESSION_COOKIE_DOMAIN') -SESSION_COOKIE_HTTPONLY = ENV_TOKENS.get('SESSION_COOKIE_HTTPONLY', True) -SESSION_COOKIE_SECURE = ENV_TOKENS.get('SESSION_COOKIE_SECURE', SESSION_COOKIE_SECURE) -SESSION_SAVE_EVERY_REQUEST = ENV_TOKENS.get('SESSION_SAVE_EVERY_REQUEST', SESSION_SAVE_EVERY_REQUEST) - -AWS_SES_REGION_NAME = ENV_TOKENS.get('AWS_SES_REGION_NAME', 'us-east-1') -AWS_SES_REGION_ENDPOINT = ENV_TOKENS.get('AWS_SES_REGION_ENDPOINT', 'email.us-east-1.amazonaws.com') - -REGISTRATION_EXTRA_FIELDS = ENV_TOKENS.get('REGISTRATION_EXTRA_FIELDS', REGISTRATION_EXTRA_FIELDS) -REGISTRATION_EXTENSION_FORM = ENV_TOKENS.get('REGISTRATION_EXTENSION_FORM', REGISTRATION_EXTENSION_FORM) -REGISTRATION_EMAIL_PATTERNS_ALLOWED = ENV_TOKENS.get('REGISTRATION_EMAIL_PATTERNS_ALLOWED') -REGISTRATION_FIELD_ORDER = ENV_TOKENS.get('REGISTRATION_FIELD_ORDER', REGISTRATION_FIELD_ORDER) - -# Set the names of cookies shared with the marketing site -# These have the same cookie domain as the session, which in production -# usually includes subdomains. -EDXMKTG_LOGGED_IN_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_LOGGED_IN_COOKIE_NAME', EDXMKTG_LOGGED_IN_COOKIE_NAME) -EDXMKTG_USER_INFO_COOKIE_NAME = ENV_TOKENS.get('EDXMKTG_USER_INFO_COOKIE_NAME', EDXMKTG_USER_INFO_COOKIE_NAME) - -LMS_ROOT_URL = ENV_TOKENS.get('LMS_ROOT_URL') -LMS_INTERNAL_ROOT_URL = ENV_TOKENS.get('LMS_INTERNAL_ROOT_URL', LMS_ROOT_URL) - -# List of logout URIs for each IDA that the learner should be logged out of when they logout of the LMS. Only applies to -# IDA for which the social auth flow uses DOT (Django OAuth Toolkit). -IDA_LOGOUT_URI_LIST = ENV_TOKENS.get('IDA_LOGOUT_URI_LIST', []) - -ENV_FEATURES = ENV_TOKENS.get('FEATURES', {}) -for feature, value in ENV_FEATURES.items(): - FEATURES[feature] = value - -CMS_BASE = ENV_TOKENS.get('CMS_BASE', 'studio.edx.org') - -ALLOWED_HOSTS = [ - # TODO: bbeggs remove this before prod, temp fix to get load testing running - "*", - ENV_TOKENS.get('LMS_BASE'), - FEATURES['PREVIEW_LMS_BASE'], -] - -# allow for environments to specify what cookie name our login subsystem should use -# this is to fix a bug regarding simultaneous logins between edx.org and edge.edx.org which can -# happen with some browsers (e.g. Firefox) -if ENV_TOKENS.get('SESSION_COOKIE_NAME', None): - # NOTE, there's a bug in Django (http://bugs.python.org/issue18012) which necessitates this being a str() - SESSION_COOKIE_NAME = str(ENV_TOKENS.get('SESSION_COOKIE_NAME')) - -CACHES = ENV_TOKENS['CACHES'] -# Cache used for location mapping -- called many times with the same key/value -# in a given request. -if 'loc_cache' not in CACHES: - CACHES['loc_cache'] = { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': 'edx_location_mem_cache', - } - -# Email overrides -DEFAULT_FROM_EMAIL = ENV_TOKENS.get('DEFAULT_FROM_EMAIL', DEFAULT_FROM_EMAIL) -DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS.get('DEFAULT_FEEDBACK_EMAIL', DEFAULT_FEEDBACK_EMAIL) -ADMINS = ENV_TOKENS.get('ADMINS', ADMINS) -SERVER_EMAIL = ENV_TOKENS.get('SERVER_EMAIL', SERVER_EMAIL) -TECH_SUPPORT_EMAIL = ENV_TOKENS.get('TECH_SUPPORT_EMAIL', TECH_SUPPORT_EMAIL) -CONTACT_EMAIL = ENV_TOKENS.get('CONTACT_EMAIL', CONTACT_EMAIL) -BUGS_EMAIL = ENV_TOKENS.get('BUGS_EMAIL', BUGS_EMAIL) -PAYMENT_SUPPORT_EMAIL = ENV_TOKENS.get('PAYMENT_SUPPORT_EMAIL', PAYMENT_SUPPORT_EMAIL) -FINANCE_EMAIL = ENV_TOKENS.get('FINANCE_EMAIL', FINANCE_EMAIL) -UNIVERSITY_EMAIL = ENV_TOKENS.get('UNIVERSITY_EMAIL', UNIVERSITY_EMAIL) -PRESS_EMAIL = ENV_TOKENS.get('PRESS_EMAIL', PRESS_EMAIL) - -CONTACT_MAILING_ADDRESS = ENV_TOKENS.get('CONTACT_MAILING_ADDRESS', CONTACT_MAILING_ADDRESS) - -# Account activation email sender address -ACTIVATION_EMAIL_FROM_ADDRESS = ENV_TOKENS.get('ACTIVATION_EMAIL_FROM_ADDRESS', ACTIVATION_EMAIL_FROM_ADDRESS) - -# Currency -PAID_COURSE_REGISTRATION_CURRENCY = ENV_TOKENS.get('PAID_COURSE_REGISTRATION_CURRENCY', - PAID_COURSE_REGISTRATION_CURRENCY) - -# Payment Report Settings -PAYMENT_REPORT_GENERATOR_GROUP = ENV_TOKENS.get('PAYMENT_REPORT_GENERATOR_GROUP', PAYMENT_REPORT_GENERATOR_GROUP) - -# Bulk Email overrides -BULK_EMAIL_DEFAULT_FROM_EMAIL = ENV_TOKENS.get('BULK_EMAIL_DEFAULT_FROM_EMAIL', BULK_EMAIL_DEFAULT_FROM_EMAIL) -BULK_EMAIL_EMAILS_PER_TASK = ENV_TOKENS.get('BULK_EMAIL_EMAILS_PER_TASK', BULK_EMAIL_EMAILS_PER_TASK) -BULK_EMAIL_DEFAULT_RETRY_DELAY = ENV_TOKENS.get('BULK_EMAIL_DEFAULT_RETRY_DELAY', BULK_EMAIL_DEFAULT_RETRY_DELAY) -BULK_EMAIL_MAX_RETRIES = ENV_TOKENS.get('BULK_EMAIL_MAX_RETRIES', BULK_EMAIL_MAX_RETRIES) -BULK_EMAIL_INFINITE_RETRY_CAP = ENV_TOKENS.get('BULK_EMAIL_INFINITE_RETRY_CAP', BULK_EMAIL_INFINITE_RETRY_CAP) -BULK_EMAIL_LOG_SENT_EMAILS = ENV_TOKENS.get('BULK_EMAIL_LOG_SENT_EMAILS', BULK_EMAIL_LOG_SENT_EMAILS) -BULK_EMAIL_RETRY_DELAY_BETWEEN_SENDS = ENV_TOKENS.get( - 'BULK_EMAIL_RETRY_DELAY_BETWEEN_SENDS', - BULK_EMAIL_RETRY_DELAY_BETWEEN_SENDS -) -# We want Bulk Email running on the high-priority queue, so we define the -# routing key that points to it. At the moment, the name is the same. -# We have to reset the value here, since we have changed the value of the queue name. -BULK_EMAIL_ROUTING_KEY = ENV_TOKENS.get('BULK_EMAIL_ROUTING_KEY', HIGH_PRIORITY_QUEUE) - -# We can run smaller jobs on the low priority queue. See note above for why -# we have to reset the value here. -BULK_EMAIL_ROUTING_KEY_SMALL_JOBS = ENV_TOKENS.get('BULK_EMAIL_ROUTING_KEY_SMALL_JOBS', DEFAULT_PRIORITY_QUEUE) - -# Queue to use for expiring old entitlements -ENTITLEMENTS_EXPIRATION_ROUTING_KEY = ENV_TOKENS.get('ENTITLEMENTS_EXPIRATION_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) - -# Message expiry time in seconds -CELERY_EVENT_QUEUE_TTL = ENV_TOKENS.get('CELERY_EVENT_QUEUE_TTL', None) - -# Allow CELERY_QUEUES to be overwritten by ENV_TOKENS, -ENV_CELERY_QUEUES = ENV_TOKENS.get('CELERY_QUEUES', None) -if ENV_CELERY_QUEUES: - CELERY_QUEUES = {queue: {} for queue in ENV_CELERY_QUEUES} - -# Then add alternate environment queues -ALTERNATE_QUEUE_ENVS = ENV_TOKENS.get('ALTERNATE_WORKER_QUEUES', '').split() -ALTERNATE_QUEUES = [ - DEFAULT_PRIORITY_QUEUE.replace(QUEUE_VARIANT, alternate + '.') - for alternate in ALTERNATE_QUEUE_ENVS -] -CELERY_QUEUES.update( - { - alternate: {} - for alternate in ALTERNATE_QUEUES - if alternate not in CELERY_QUEUES.keys() - } -) - -# following setting is for backward compatibility -if ENV_TOKENS.get('COMPREHENSIVE_THEME_DIR', None): - COMPREHENSIVE_THEME_DIR = ENV_TOKENS.get('COMPREHENSIVE_THEME_DIR') - -COMPREHENSIVE_THEME_DIRS = ENV_TOKENS.get('COMPREHENSIVE_THEME_DIRS', COMPREHENSIVE_THEME_DIRS) or [] - -# COMPREHENSIVE_THEME_LOCALE_PATHS contain the paths to themes locale directories e.g. -# "COMPREHENSIVE_THEME_LOCALE_PATHS" : [ -# "/edx/src/edx-themes/conf/locale" -# ], -COMPREHENSIVE_THEME_LOCALE_PATHS = ENV_TOKENS.get('COMPREHENSIVE_THEME_LOCALE_PATHS', []) - -DEFAULT_SITE_THEME = ENV_TOKENS.get('DEFAULT_SITE_THEME', DEFAULT_SITE_THEME) -ENABLE_COMPREHENSIVE_THEMING = ENV_TOKENS.get('ENABLE_COMPREHENSIVE_THEMING', ENABLE_COMPREHENSIVE_THEMING) - -# Marketing link overrides -MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {})) - -# Intentional defaults. -SUPPORT_SITE_LINK = ENV_TOKENS.get('SUPPORT_SITE_LINK', SUPPORT_SITE_LINK) -ID_VERIFICATION_SUPPORT_LINK = ENV_TOKENS.get('ID_VERIFICATION_SUPPORT_LINK', SUPPORT_SITE_LINK) -PASSWORD_RESET_SUPPORT_LINK = ENV_TOKENS.get('PASSWORD_RESET_SUPPORT_LINK', SUPPORT_SITE_LINK) -ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get( - 'ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK -) - -# Mobile store URL overrides -MOBILE_STORE_URLS = ENV_TOKENS.get('MOBILE_STORE_URLS', MOBILE_STORE_URLS) - -# Timezone overrides -TIME_ZONE = ENV_TOKENS.get('TIME_ZONE', TIME_ZONE) - -# Translation overrides -LANGUAGES = ENV_TOKENS.get('LANGUAGES', LANGUAGES) -CERTIFICATE_TEMPLATE_LANGUAGES = ENV_TOKENS.get('CERTIFICATE_TEMPLATE_LANGUAGES', CERTIFICATE_TEMPLATE_LANGUAGES) -LANGUAGE_DICT = dict(LANGUAGES) -LANGUAGE_CODE = ENV_TOKENS.get('LANGUAGE_CODE', LANGUAGE_CODE) -LANGUAGE_COOKIE = ENV_TOKENS.get('LANGUAGE_COOKIE', LANGUAGE_COOKIE) -ALL_LANGUAGES = ENV_TOKENS.get('ALL_LANGUAGES', ALL_LANGUAGES) - -USE_I18N = ENV_TOKENS.get('USE_I18N', USE_I18N) - -# Additional installed apps -for app in ENV_TOKENS.get('ADDL_INSTALLED_APPS', []): - INSTALLED_APPS.append(app) - -WIKI_ENABLED = ENV_TOKENS.get('WIKI_ENABLED', WIKI_ENABLED) - -local_loglevel = ENV_TOKENS.get('LOCAL_LOGLEVEL', 'INFO') -LOG_DIR = ENV_TOKENS['LOG_DIR'] -DATA_DIR = path(ENV_TOKENS.get('DATA_DIR', DATA_DIR)) - -LOGGING = get_logger_config(LOG_DIR, - logging_env=ENV_TOKENS['LOGGING_ENV'], - local_loglevel=local_loglevel, - service_variant=SERVICE_VARIANT) - -COURSE_LISTINGS = ENV_TOKENS.get('COURSE_LISTINGS', {}) -COMMENTS_SERVICE_URL = ENV_TOKENS.get("COMMENTS_SERVICE_URL", '') -COMMENTS_SERVICE_KEY = ENV_TOKENS.get("COMMENTS_SERVICE_KEY", '') -CERT_NAME_SHORT = ENV_TOKENS.get('CERT_NAME_SHORT', CERT_NAME_SHORT) -CERT_NAME_LONG = ENV_TOKENS.get('CERT_NAME_LONG', CERT_NAME_LONG) -CERT_QUEUE = ENV_TOKENS.get("CERT_QUEUE", 'test-pull') -ZENDESK_URL = ENV_TOKENS.get('ZENDESK_URL', ZENDESK_URL) -ZENDESK_CUSTOM_FIELDS = ENV_TOKENS.get('ZENDESK_CUSTOM_FIELDS', ZENDESK_CUSTOM_FIELDS) - -FEEDBACK_SUBMISSION_EMAIL = ENV_TOKENS.get("FEEDBACK_SUBMISSION_EMAIL") -MKTG_URLS = ENV_TOKENS.get('MKTG_URLS', MKTG_URLS) - -# Badgr API -BADGR_API_TOKEN = ENV_TOKENS.get('BADGR_API_TOKEN', BADGR_API_TOKEN) -BADGR_BASE_URL = ENV_TOKENS.get('BADGR_BASE_URL', BADGR_BASE_URL) -BADGR_ISSUER_SLUG = ENV_TOKENS.get('BADGR_ISSUER_SLUG', BADGR_ISSUER_SLUG) -BADGR_TIMEOUT = ENV_TOKENS.get('BADGR_TIMEOUT', BADGR_TIMEOUT) - -# git repo loading environment -GIT_REPO_DIR = ENV_TOKENS.get('GIT_REPO_DIR', '/edx/var/edxapp/course_repos') -GIT_IMPORT_STATIC = ENV_TOKENS.get('GIT_IMPORT_STATIC', True) -GIT_IMPORT_PYTHON_LIB = ENV_TOKENS.get('GIT_IMPORT_PYTHON_LIB', True) -PYTHON_LIB_FILENAME = ENV_TOKENS.get('PYTHON_LIB_FILENAME', 'python_lib.zip') - -for name, value in ENV_TOKENS.get("CODE_JAIL", {}).items(): - oldvalue = CODE_JAIL.get(name) - if isinstance(oldvalue, dict): - for subname, subvalue in value.items(): - oldvalue[subname] = subvalue - else: - CODE_JAIL[name] = value - -COURSES_WITH_UNSAFE_CODE = ENV_TOKENS.get("COURSES_WITH_UNSAFE_CODE", []) - -ASSET_IGNORE_REGEX = ENV_TOKENS.get('ASSET_IGNORE_REGEX', ASSET_IGNORE_REGEX) - -# Event Tracking -if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS: - TRACKING_IGNORE_URL_PATTERNS = ENV_TOKENS.get("TRACKING_IGNORE_URL_PATTERNS") - -# SSL external authentication settings -SSL_AUTH_EMAIL_DOMAIN = ENV_TOKENS.get("SSL_AUTH_EMAIL_DOMAIN", "MIT.EDU") -SSL_AUTH_DN_FORMAT_STRING = ENV_TOKENS.get( - "SSL_AUTH_DN_FORMAT_STRING", - u"/C=US/ST=Massachusetts/O=Massachusetts Institute of Technology/OU=Client CA v1/CN={0}/emailAddress={1}" -) - -# Video Caching. Pairing country codes with CDN URLs. -# Example: {'CN': 'http://api.xuetangx.com/edx/video?s3_url='} -VIDEO_CDN_URL = ENV_TOKENS.get('VIDEO_CDN_URL', {}) - -# Branded footer -FOOTER_OPENEDX_URL = ENV_TOKENS.get('FOOTER_OPENEDX_URL', FOOTER_OPENEDX_URL) -FOOTER_OPENEDX_LOGO_IMAGE = ENV_TOKENS.get('FOOTER_OPENEDX_LOGO_IMAGE', FOOTER_OPENEDX_LOGO_IMAGE) -FOOTER_ORGANIZATION_IMAGE = ENV_TOKENS.get('FOOTER_ORGANIZATION_IMAGE', FOOTER_ORGANIZATION_IMAGE) -FOOTER_CACHE_TIMEOUT = ENV_TOKENS.get('FOOTER_CACHE_TIMEOUT', FOOTER_CACHE_TIMEOUT) -FOOTER_BROWSER_CACHE_MAX_AGE = ENV_TOKENS.get('FOOTER_BROWSER_CACHE_MAX_AGE', FOOTER_BROWSER_CACHE_MAX_AGE) - -# Credit notifications settings -NOTIFICATION_EMAIL_CSS = ENV_TOKENS.get('NOTIFICATION_EMAIL_CSS', NOTIFICATION_EMAIL_CSS) -NOTIFICATION_EMAIL_EDX_LOGO = ENV_TOKENS.get('NOTIFICATION_EMAIL_EDX_LOGO', NOTIFICATION_EMAIL_EDX_LOGO) - -# Determines whether the CSRF token can be transported on -# unencrypted channels. It is set to False here for backward compatibility, -# but it is highly recommended that this is True for enviroments accessed -# by end users. -CSRF_COOKIE_SECURE = ENV_TOKENS.get('CSRF_COOKIE_SECURE', False) - -# Whitelist of domains to which the login/logout pages will redirect. -LOGIN_REDIRECT_WHITELIST = ENV_TOKENS.get('LOGIN_REDIRECT_WHITELIST', LOGIN_REDIRECT_WHITELIST) - -############# CORS headers for cross-domain requests ################# - -if FEATURES.get('ENABLE_CORS_HEADERS') or FEATURES.get('ENABLE_CROSS_DOMAIN_CSRF_COOKIE'): - CORS_ALLOW_CREDENTIALS = True - CORS_ORIGIN_WHITELIST = ENV_TOKENS.get('CORS_ORIGIN_WHITELIST', ()) - CORS_ORIGIN_ALLOW_ALL = ENV_TOKENS.get('CORS_ORIGIN_ALLOW_ALL', False) - CORS_ALLOW_INSECURE = ENV_TOKENS.get('CORS_ALLOW_INSECURE', False) - CORS_ALLOW_HEADERS = corsheaders_default_headers + ( - 'use-jwt-cookie', - ) - - # If setting a cross-domain cookie, it's really important to choose - # a name for the cookie that is DIFFERENT than the cookies used - # by each subdomain. For example, suppose the applications - # at these subdomains are configured to use the following cookie names: - # - # 1) foo.example.com --> "csrftoken" - # 2) baz.example.com --> "csrftoken" - # 3) bar.example.com --> "csrftoken" - # - # For the cross-domain version of the CSRF cookie, you need to choose - # a name DIFFERENT than "csrftoken"; otherwise, the new token configured - # for ".example.com" could conflict with the other cookies, - # non-deterministically causing 403 responses. - # - # Because of the way Django stores cookies, the cookie name MUST - # be a `str`, not unicode. Otherwise there will `TypeError`s will be raised - # when Django tries to call the unicode `translate()` method with the wrong - # number of parameters. - CROSS_DOMAIN_CSRF_COOKIE_NAME = str(ENV_TOKENS.get('CROSS_DOMAIN_CSRF_COOKIE_NAME')) - - # When setting the domain for the "cross-domain" version of the CSRF - # cookie, you should choose something like: ".example.com" - # (note the leading dot), where both the referer and the host - # are subdomains of "example.com". - # - # Browser security rules require that - # the cookie domain matches the domain of the server; otherwise - # the cookie won't get set. And once the cookie gets set, the client - # needs to be on a domain that matches the cookie domain, otherwise - # the client won't be able to read the cookie. - CROSS_DOMAIN_CSRF_COOKIE_DOMAIN = ENV_TOKENS.get('CROSS_DOMAIN_CSRF_COOKIE_DOMAIN') - - -# Field overrides. To use the IDDE feature, add -# 'lms.djangoapps.courseware.student_field_overrides.IndividualStudentOverrideProvider'. -FIELD_OVERRIDE_PROVIDERS = tuple(ENV_TOKENS.get('FIELD_OVERRIDE_PROVIDERS', [])) - -############################## SECURE AUTH ITEMS ############### -# Secret things: passwords, access keys, etc. - -with open(CONFIG_ROOT / CONFIG_PREFIX + "auth.json") as auth_file: - AUTH_TOKENS = json.load(auth_file) - -############### XBlock filesystem field config ########## -if 'DJFS' in AUTH_TOKENS and AUTH_TOKENS['DJFS'] is not None: - DJFS = AUTH_TOKENS['DJFS'] - -############### Module Store Items ########## -HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS = ENV_TOKENS.get('HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS', {}) -# PREVIEW DOMAIN must be present in HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS for the preview to show draft changes -if 'PREVIEW_LMS_BASE' in FEATURES and FEATURES['PREVIEW_LMS_BASE'] != '': - PREVIEW_DOMAIN = FEATURES['PREVIEW_LMS_BASE'].split(':')[0] - # update dictionary with preview domain regex - HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS.update({ - PREVIEW_DOMAIN: 'draft-preferred' - }) - -MODULESTORE_FIELD_OVERRIDE_PROVIDERS = ENV_TOKENS.get( - 'MODULESTORE_FIELD_OVERRIDE_PROVIDERS', - MODULESTORE_FIELD_OVERRIDE_PROVIDERS -) - -XBLOCK_FIELD_DATA_WRAPPERS = ENV_TOKENS.get( - 'XBLOCK_FIELD_DATA_WRAPPERS', - XBLOCK_FIELD_DATA_WRAPPERS -) - -############### Mixed Related(Secure/Not-Secure) Items ########## -LMS_SEGMENT_KEY = AUTH_TOKENS.get('SEGMENT_KEY') - -CC_PROCESSOR_NAME = AUTH_TOKENS.get('CC_PROCESSOR_NAME', CC_PROCESSOR_NAME) -CC_PROCESSOR = AUTH_TOKENS.get('CC_PROCESSOR', CC_PROCESSOR) - -SECRET_KEY = AUTH_TOKENS['SECRET_KEY'] - -AWS_ACCESS_KEY_ID = AUTH_TOKENS["AWS_ACCESS_KEY_ID"] -if AWS_ACCESS_KEY_ID == "": - AWS_ACCESS_KEY_ID = None - -AWS_SECRET_ACCESS_KEY = AUTH_TOKENS["AWS_SECRET_ACCESS_KEY"] -if AWS_SECRET_ACCESS_KEY == "": - AWS_SECRET_ACCESS_KEY = None - -AWS_STORAGE_BUCKET_NAME = AUTH_TOKENS.get('AWS_STORAGE_BUCKET_NAME', 'edxuploads') - -# Disabling querystring auth instructs Boto to exclude the querystring parameters (e.g. signature, access key) it -# normally appends to every returned URL. -AWS_QUERYSTRING_AUTH = AUTH_TOKENS.get('AWS_QUERYSTRING_AUTH', True) -AWS_S3_CUSTOM_DOMAIN = AUTH_TOKENS.get('AWS_S3_CUSTOM_DOMAIN', 'edxuploads.s3.amazonaws.com') - -if AUTH_TOKENS.get('DEFAULT_FILE_STORAGE'): - DEFAULT_FILE_STORAGE = AUTH_TOKENS.get('DEFAULT_FILE_STORAGE') -elif AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY: - DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' -else: - DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' - -# 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) - -# If there is a database called 'read_replica', you can use the use_read_replica_if_available -# function in util/query.py, which is useful for very large database reads -DATABASES = AUTH_TOKENS['DATABASES'] - -# The normal database user does not have enough permissions to run migrations. -# Migrations are run with separate credentials, given as DB_MIGRATION_* -# environment variables -for name, database in DATABASES.items(): - if name != 'read_replica': - database.update({ - 'ENGINE': os.environ.get('DB_MIGRATION_ENGINE', database['ENGINE']), - 'USER': os.environ.get('DB_MIGRATION_USER', database['USER']), - 'PASSWORD': os.environ.get('DB_MIGRATION_PASS', database['PASSWORD']), - 'NAME': os.environ.get('DB_MIGRATION_NAME', database['NAME']), - 'HOST': os.environ.get('DB_MIGRATION_HOST', database['HOST']), - 'PORT': os.environ.get('DB_MIGRATION_PORT', database['PORT']), - }) - -XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] - -# Get the MODULESTORE from auth.json, but if it doesn't exist, -# use the one from common.py -MODULESTORE = convert_module_store_setting_if_needed(AUTH_TOKENS.get('MODULESTORE', MODULESTORE)) -CONTENTSTORE = AUTH_TOKENS.get('CONTENTSTORE', CONTENTSTORE) -DOC_STORE_CONFIG = AUTH_TOKENS.get('DOC_STORE_CONFIG', DOC_STORE_CONFIG) -MONGODB_LOG = AUTH_TOKENS.get('MONGODB_LOG', {}) - -EMAIL_HOST_USER = AUTH_TOKENS.get('EMAIL_HOST_USER', '') # django default is '' -EMAIL_HOST_PASSWORD = AUTH_TOKENS.get('EMAIL_HOST_PASSWORD', '') # django default is '' - -# Datadog for events! -DATADOG = AUTH_TOKENS.get("DATADOG", {}) -DATADOG.update(ENV_TOKENS.get("DATADOG", {})) - -# TODO: deprecated (compatibility with previous settings) -if 'DATADOG_API' in AUTH_TOKENS: - DATADOG['api_key'] = AUTH_TOKENS['DATADOG_API'] - -# Analytics API -ANALYTICS_API_KEY = AUTH_TOKENS.get("ANALYTICS_API_KEY", ANALYTICS_API_KEY) -ANALYTICS_API_URL = ENV_TOKENS.get("ANALYTICS_API_URL", ANALYTICS_API_URL) - -# Mailchimp New User List -MAILCHIMP_NEW_USER_LIST_ID = ENV_TOKENS.get("MAILCHIMP_NEW_USER_LIST_ID") - -# Zendesk -ZENDESK_USER = AUTH_TOKENS.get("ZENDESK_USER") -ZENDESK_API_KEY = AUTH_TOKENS.get("ZENDESK_API_KEY") - -# API Key for inbound requests from Notifier service -EDX_API_KEY = AUTH_TOKENS.get("EDX_API_KEY") - -# Celery Broker -CELERY_BROKER_TRANSPORT = ENV_TOKENS.get("CELERY_BROKER_TRANSPORT", "") -CELERY_BROKER_HOSTNAME = ENV_TOKENS.get("CELERY_BROKER_HOSTNAME", "") -CELERY_BROKER_VHOST = ENV_TOKENS.get("CELERY_BROKER_VHOST", "") -CELERY_BROKER_USER = AUTH_TOKENS.get("CELERY_BROKER_USER", "") -CELERY_BROKER_PASSWORD = AUTH_TOKENS.get("CELERY_BROKER_PASSWORD", "") - -BROKER_URL = "{0}://{1}:{2}@{3}/{4}".format(CELERY_BROKER_TRANSPORT, - CELERY_BROKER_USER, - CELERY_BROKER_PASSWORD, - CELERY_BROKER_HOSTNAME, - CELERY_BROKER_VHOST) -BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False) - -# Block Structures -BLOCK_STRUCTURES_SETTINGS = ENV_TOKENS.get('BLOCK_STRUCTURES_SETTINGS', BLOCK_STRUCTURES_SETTINGS) - -# upload limits -STUDENT_FILEUPLOAD_MAX_SIZE = ENV_TOKENS.get("STUDENT_FILEUPLOAD_MAX_SIZE", STUDENT_FILEUPLOAD_MAX_SIZE) - -# Event tracking -TRACKING_BACKENDS.update(AUTH_TOKENS.get("TRACKING_BACKENDS", {})) -EVENT_TRACKING_BACKENDS['tracking_logs']['OPTIONS']['backends'].update(AUTH_TOKENS.get("EVENT_TRACKING_BACKENDS", {})) -EVENT_TRACKING_BACKENDS['segmentio']['OPTIONS']['processors'][0]['OPTIONS']['whitelist'].extend( - AUTH_TOKENS.get("EVENT_TRACKING_SEGMENTIO_EMIT_WHITELIST", [])) -TRACKING_SEGMENTIO_WEBHOOK_SECRET = AUTH_TOKENS.get( - "TRACKING_SEGMENTIO_WEBHOOK_SECRET", - TRACKING_SEGMENTIO_WEBHOOK_SECRET -) -TRACKING_SEGMENTIO_ALLOWED_TYPES = ENV_TOKENS.get("TRACKING_SEGMENTIO_ALLOWED_TYPES", TRACKING_SEGMENTIO_ALLOWED_TYPES) -TRACKING_SEGMENTIO_DISALLOWED_SUBSTRING_NAMES = ENV_TOKENS.get( - "TRACKING_SEGMENTIO_DISALLOWED_SUBSTRING_NAMES", - TRACKING_SEGMENTIO_DISALLOWED_SUBSTRING_NAMES -) -TRACKING_SEGMENTIO_SOURCE_MAP = ENV_TOKENS.get("TRACKING_SEGMENTIO_SOURCE_MAP", TRACKING_SEGMENTIO_SOURCE_MAP) - -# Heartbeat -HEARTBEAT_CHECKS = ENV_TOKENS.get('HEARTBEAT_CHECKS', HEARTBEAT_CHECKS) -HEARTBEAT_EXTENDED_CHECKS = ENV_TOKENS.get('HEARTBEAT_EXTENDED_CHECKS', HEARTBEAT_EXTENDED_CHECKS) -HEARTBEAT_CELERY_TIMEOUT = ENV_TOKENS.get('HEARTBEAT_CELERY_TIMEOUT', HEARTBEAT_CELERY_TIMEOUT) - -# Student identity verification settings -VERIFY_STUDENT = AUTH_TOKENS.get("VERIFY_STUDENT", VERIFY_STUDENT) -DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH = ENV_TOKENS.get( - "DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH", - DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH -) - -# Grades download -GRADES_DOWNLOAD_ROUTING_KEY = ENV_TOKENS.get('GRADES_DOWNLOAD_ROUTING_KEY', HIGH_MEM_QUEUE) - -GRADES_DOWNLOAD = ENV_TOKENS.get("GRADES_DOWNLOAD", GRADES_DOWNLOAD) - -# Rate limit for regrading tasks that a grading policy change can kick off -POLICY_CHANGE_TASK_RATE_LIMIT = ENV_TOKENS.get('POLICY_CHANGE_TASK_RATE_LIMIT', POLICY_CHANGE_TASK_RATE_LIMIT) - -# financial reports -FINANCIAL_REPORTS = ENV_TOKENS.get("FINANCIAL_REPORTS", FINANCIAL_REPORTS) - -##### 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) - -##### ACCOUNT LOCKOUT DEFAULT PARAMETERS ##### -MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED", 5) -MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS", 15 * 60) - -#### PASSWORD POLICY SETTINGS ##### -AUTH_PASSWORD_VALIDATORS = ENV_TOKENS.get("AUTH_PASSWORD_VALIDATORS", AUTH_PASSWORD_VALIDATORS) - -### INACTIVITY SETTINGS #### -SESSION_INACTIVITY_TIMEOUT_IN_SECONDS = AUTH_TOKENS.get("SESSION_INACTIVITY_TIMEOUT_IN_SECONDS") - -##### LMS DEADLINE DISPLAY TIME_ZONE ####### -TIME_ZONE_DISPLAYED_FOR_DEADLINES = ENV_TOKENS.get("TIME_ZONE_DISPLAYED_FOR_DEADLINES", - TIME_ZONE_DISPLAYED_FOR_DEADLINES) - -##### X-Frame-Options response header settings ##### -X_FRAME_OPTIONS = ENV_TOKENS.get('X_FRAME_OPTIONS', X_FRAME_OPTIONS) - -##### Third-party auth options ################################################ -if FEATURES.get('ENABLE_THIRD_PARTY_AUTH'): - tmp_backends = ENV_TOKENS.get('THIRD_PARTY_AUTH_BACKENDS', [ - 'social_core.backends.google.GoogleOAuth2', - 'social_core.backends.linkedin.LinkedinOAuth2', - 'social_core.backends.facebook.FacebookOAuth2', - 'social_core.backends.azuread.AzureADOAuth2', - 'third_party_auth.saml.SAMLAuthBackend', - 'third_party_auth.lti.LTIAuthBackend', - ]) - - AUTHENTICATION_BACKENDS = list(tmp_backends) + list(AUTHENTICATION_BACKENDS) - del tmp_backends - - # The reduced session expiry time during the third party login pipeline. (Value in seconds) - SOCIAL_AUTH_PIPELINE_TIMEOUT = ENV_TOKENS.get('SOCIAL_AUTH_PIPELINE_TIMEOUT', 600) - - # Most provider configuration is done via ConfigurationModels but for a few sensitive values - # we allow configuration via AUTH_TOKENS instead (optionally). - # The SAML private/public key values do not need the delimiter lines (such as - # "-----BEGIN PRIVATE KEY-----", "-----END PRIVATE KEY-----" etc.) but they may be included - # if you want (though it's easier to format the key values as JSON without the delimiters). - SOCIAL_AUTH_SAML_SP_PRIVATE_KEY = AUTH_TOKENS.get('SOCIAL_AUTH_SAML_SP_PRIVATE_KEY', '') - SOCIAL_AUTH_SAML_SP_PUBLIC_CERT = AUTH_TOKENS.get('SOCIAL_AUTH_SAML_SP_PUBLIC_CERT', '') - SOCIAL_AUTH_SAML_SP_PRIVATE_KEY_DICT = AUTH_TOKENS.get('SOCIAL_AUTH_SAML_SP_PRIVATE_KEY_DICT', {}) - SOCIAL_AUTH_SAML_SP_PUBLIC_CERT_DICT = AUTH_TOKENS.get('SOCIAL_AUTH_SAML_SP_PUBLIC_CERT_DICT', {}) - SOCIAL_AUTH_OAUTH_SECRETS = AUTH_TOKENS.get('SOCIAL_AUTH_OAUTH_SECRETS', {}) - SOCIAL_AUTH_LTI_CONSUMER_SECRETS = AUTH_TOKENS.get('SOCIAL_AUTH_LTI_CONSUMER_SECRETS', {}) - - # third_party_auth config moved to ConfigurationModels. This is for data migration only: - THIRD_PARTY_AUTH_OLD_CONFIG = AUTH_TOKENS.get('THIRD_PARTY_AUTH', None) - - if ENV_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS', 24) is not None: - CELERYBEAT_SCHEDULE['refresh-saml-metadata'] = { - 'task': 'third_party_auth.fetch_saml_metadata', - 'schedule': datetime.timedelta(hours=ENV_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS', 24)), - } - - # The following can be used to integrate a custom login form with third_party_auth. - # It should be a dict where the key is a word passed via ?auth_entry=, and the value is a - # dict with an arbitrary 'secret_key' and a 'url'. - THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS = AUTH_TOKENS.get('THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS', {}) - - # Whether to allow unprivileged users to discover SSO providers for arbitrary usernames. - ALLOW_UNPRIVILEGED_SSO_PROVIDER_QUERY = ENV_TOKENS.get('ALLOW_UNPRIVILEGED_SSO_PROVIDER_QUERY', False) - -##### OAUTH2 Provider ############## -if FEATURES.get('ENABLE_OAUTH2_PROVIDER'): - OAUTH_OIDC_ISSUER = ENV_TOKENS['OAUTH_OIDC_ISSUER'] - OAUTH_ENFORCE_SECURE = ENV_TOKENS.get('OAUTH_ENFORCE_SECURE', True) - OAUTH_ENFORCE_CLIENT_SECURE = ENV_TOKENS.get('OAUTH_ENFORCE_CLIENT_SECURE', True) - # Defaults for the following are defined in lms.envs.common - OAUTH_EXPIRE_DELTA = datetime.timedelta( - days=ENV_TOKENS.get('OAUTH_EXPIRE_CONFIDENTIAL_CLIENT_DAYS', OAUTH_EXPIRE_CONFIDENTIAL_CLIENT_DAYS) - ) - OAUTH_EXPIRE_DELTA_PUBLIC = datetime.timedelta( - days=ENV_TOKENS.get('OAUTH_EXPIRE_PUBLIC_CLIENT_DAYS', OAUTH_EXPIRE_PUBLIC_CLIENT_DAYS) - ) - OAUTH_ID_TOKEN_EXPIRATION = ENV_TOKENS.get('OAUTH_ID_TOKEN_EXPIRATION', OAUTH_ID_TOKEN_EXPIRATION) - OAUTH_DELETE_EXPIRED = ENV_TOKENS.get('OAUTH_DELETE_EXPIRED', OAUTH_DELETE_EXPIRED) - -##### THIRD_PARTY_AUTH ############# -TPA_PROVIDER_BURST_THROTTLE = ENV_TOKENS.get('TPA_PROVIDER_BURST_THROTTLE', TPA_PROVIDER_BURST_THROTTLE) -TPA_PROVIDER_SUSTAINED_THROTTLE = ENV_TOKENS.get('TPA_PROVIDER_SUSTAINED_THROTTLE', TPA_PROVIDER_SUSTAINED_THROTTLE) - -##### GOOGLE ANALYTICS IDS ##### -GOOGLE_ANALYTICS_ACCOUNT = AUTH_TOKENS.get('GOOGLE_ANALYTICS_ACCOUNT') -GOOGLE_ANALYTICS_TRACKING_ID = AUTH_TOKENS.get('GOOGLE_ANALYTICS_TRACKING_ID') -GOOGLE_ANALYTICS_LINKEDIN = AUTH_TOKENS.get('GOOGLE_ANALYTICS_LINKEDIN') -GOOGLE_SITE_VERIFICATION_ID = ENV_TOKENS.get('GOOGLE_SITE_VERIFICATION_ID') - -##### BRANCH.IO KEY ##### -BRANCH_IO_KEY = AUTH_TOKENS.get('BRANCH_IO_KEY') - -##### OPTIMIZELY PROJECT ID ##### -OPTIMIZELY_PROJECT_ID = AUTH_TOKENS.get('OPTIMIZELY_PROJECT_ID', OPTIMIZELY_PROJECT_ID) - -#### Course Registration Code length #### -REGISTRATION_CODE_LENGTH = ENV_TOKENS.get('REGISTRATION_CODE_LENGTH', 8) - -# REGISTRATION CODES DISPLAY INFORMATION -INVOICE_CORP_ADDRESS = ENV_TOKENS.get('INVOICE_CORP_ADDRESS', INVOICE_CORP_ADDRESS) -INVOICE_PAYMENT_INSTRUCTIONS = ENV_TOKENS.get('INVOICE_PAYMENT_INSTRUCTIONS', INVOICE_PAYMENT_INSTRUCTIONS) - -# Which access.py permission names to check; -# We default this to the legacy permission 'see_exists'. -COURSE_CATALOG_VISIBILITY_PERMISSION = ENV_TOKENS.get( - 'COURSE_CATALOG_VISIBILITY_PERMISSION', - COURSE_CATALOG_VISIBILITY_PERMISSION -) -COURSE_ABOUT_VISIBILITY_PERMISSION = ENV_TOKENS.get( - 'COURSE_ABOUT_VISIBILITY_PERMISSION', - COURSE_ABOUT_VISIBILITY_PERMISSION -) - -DEFAULT_COURSE_VISIBILITY_IN_CATALOG = ENV_TOKENS.get( - 'DEFAULT_COURSE_VISIBILITY_IN_CATALOG', - DEFAULT_COURSE_VISIBILITY_IN_CATALOG -) - -DEFAULT_MOBILE_AVAILABLE = ENV_TOKENS.get( - 'DEFAULT_MOBILE_AVAILABLE', - DEFAULT_MOBILE_AVAILABLE -) - - -# Enrollment API Cache Timeout -ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT = ENV_TOKENS.get('ENROLLMENT_COURSE_DETAILS_CACHE_TIMEOUT', 60) - -# PDF RECEIPT/INVOICE OVERRIDES -PDF_RECEIPT_TAX_ID = ENV_TOKENS.get('PDF_RECEIPT_TAX_ID', PDF_RECEIPT_TAX_ID) -PDF_RECEIPT_FOOTER_TEXT = ENV_TOKENS.get('PDF_RECEIPT_FOOTER_TEXT', PDF_RECEIPT_FOOTER_TEXT) -PDF_RECEIPT_DISCLAIMER_TEXT = ENV_TOKENS.get('PDF_RECEIPT_DISCLAIMER_TEXT', PDF_RECEIPT_DISCLAIMER_TEXT) -PDF_RECEIPT_BILLING_ADDRESS = ENV_TOKENS.get('PDF_RECEIPT_BILLING_ADDRESS', PDF_RECEIPT_BILLING_ADDRESS) -PDF_RECEIPT_TERMS_AND_CONDITIONS = ENV_TOKENS.get('PDF_RECEIPT_TERMS_AND_CONDITIONS', PDF_RECEIPT_TERMS_AND_CONDITIONS) -PDF_RECEIPT_TAX_ID_LABEL = ENV_TOKENS.get('PDF_RECEIPT_TAX_ID_LABEL', PDF_RECEIPT_TAX_ID_LABEL) -PDF_RECEIPT_LOGO_PATH = ENV_TOKENS.get('PDF_RECEIPT_LOGO_PATH', PDF_RECEIPT_LOGO_PATH) -PDF_RECEIPT_COBRAND_LOGO_PATH = ENV_TOKENS.get('PDF_RECEIPT_COBRAND_LOGO_PATH', PDF_RECEIPT_COBRAND_LOGO_PATH) -PDF_RECEIPT_LOGO_HEIGHT_MM = ENV_TOKENS.get('PDF_RECEIPT_LOGO_HEIGHT_MM', PDF_RECEIPT_LOGO_HEIGHT_MM) -PDF_RECEIPT_COBRAND_LOGO_HEIGHT_MM = ENV_TOKENS.get( - 'PDF_RECEIPT_COBRAND_LOGO_HEIGHT_MM', PDF_RECEIPT_COBRAND_LOGO_HEIGHT_MM -) - -if FEATURES.get('ENABLE_COURSEWARE_SEARCH') or \ - FEATURES.get('ENABLE_DASHBOARD_SEARCH') or \ - FEATURES.get('ENABLE_COURSE_DISCOVERY') or \ - FEATURES.get('ENABLE_TEAMS'): - # Use ElasticSearch as the search engine herein - SEARCH_ENGINE = "search.elastic.ElasticSearchEngine" - -ELASTIC_SEARCH_CONFIG = ENV_TOKENS.get('ELASTIC_SEARCH_CONFIG', [{}]) - -# Facebook app -FACEBOOK_API_VERSION = AUTH_TOKENS.get("FACEBOOK_API_VERSION") -FACEBOOK_APP_SECRET = AUTH_TOKENS.get("FACEBOOK_APP_SECRET") -FACEBOOK_APP_ID = AUTH_TOKENS.get("FACEBOOK_APP_ID") - -XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {}) -XBLOCK_SETTINGS.setdefault("VideoDescriptor", {})["licensing_enabled"] = FEATURES.get("LICENSING", False) -XBLOCK_SETTINGS.setdefault("VideoModule", {})['YOUTUBE_API_KEY'] = AUTH_TOKENS.get('YOUTUBE_API_KEY', YOUTUBE_API_KEY) - -##### VIDEO IMAGE STORAGE ##### -VIDEO_IMAGE_SETTINGS = ENV_TOKENS.get('VIDEO_IMAGE_SETTINGS', VIDEO_IMAGE_SETTINGS) - -##### VIDEO TRANSCRIPTS STORAGE ##### -VIDEO_TRANSCRIPTS_SETTINGS = ENV_TOKENS.get('VIDEO_TRANSCRIPTS_SETTINGS', VIDEO_TRANSCRIPTS_SETTINGS) - -##### ECOMMERCE API CONFIGURATION SETTINGS ##### -ECOMMERCE_PUBLIC_URL_ROOT = ENV_TOKENS.get('ECOMMERCE_PUBLIC_URL_ROOT', ECOMMERCE_PUBLIC_URL_ROOT) -ECOMMERCE_API_URL = ENV_TOKENS.get('ECOMMERCE_API_URL', ECOMMERCE_API_URL) -ECOMMERCE_API_TIMEOUT = ENV_TOKENS.get('ECOMMERCE_API_TIMEOUT', ECOMMERCE_API_TIMEOUT) - -COURSE_CATALOG_API_URL = ENV_TOKENS.get('COURSE_CATALOG_API_URL', COURSE_CATALOG_API_URL) - -ECOMMERCE_SERVICE_WORKER_USERNAME = ENV_TOKENS.get( - 'ECOMMERCE_SERVICE_WORKER_USERNAME', - ECOMMERCE_SERVICE_WORKER_USERNAME -) - -##### Custom Courses for EdX ##### -if FEATURES.get('CUSTOM_COURSES_EDX'): - INSTALLED_APPS += ['lms.djangoapps.ccx', 'openedx.core.djangoapps.ccxcon.apps.CCXConnectorConfig'] - MODULESTORE_FIELD_OVERRIDE_PROVIDERS += ( - 'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider', - ) -CCX_MAX_STUDENTS_ALLOWED = ENV_TOKENS.get('CCX_MAX_STUDENTS_ALLOWED', CCX_MAX_STUDENTS_ALLOWED) - -##### Individual Due Date Extensions ##### -if FEATURES.get('INDIVIDUAL_DUE_DATES'): - FIELD_OVERRIDE_PROVIDERS += ( - 'lms.djangoapps.courseware.student_field_overrides.IndividualStudentOverrideProvider', - ) - -##### Self-Paced Course Due Dates ##### -XBLOCK_FIELD_DATA_WRAPPERS += ( - 'lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap', -) - -MODULESTORE_FIELD_OVERRIDE_PROVIDERS += ( - 'courseware.self_paced_overrides.SelfPacedDateOverrideProvider', -) - -# PROFILE IMAGE CONFIG -PROFILE_IMAGE_BACKEND = ENV_TOKENS.get('PROFILE_IMAGE_BACKEND', PROFILE_IMAGE_BACKEND) -PROFILE_IMAGE_SECRET_KEY = AUTH_TOKENS.get('PROFILE_IMAGE_SECRET_KEY', PROFILE_IMAGE_SECRET_KEY) -PROFILE_IMAGE_MAX_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MAX_BYTES', PROFILE_IMAGE_MAX_BYTES) -PROFILE_IMAGE_MIN_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MIN_BYTES', PROFILE_IMAGE_MIN_BYTES) -PROFILE_IMAGE_DEFAULT_FILENAME = 'images/profiles/default' -PROFILE_IMAGE_SIZES_MAP = ENV_TOKENS.get( - 'PROFILE_IMAGE_SIZES_MAP', - PROFILE_IMAGE_SIZES_MAP -) - -# EdxNotes config - -EDXNOTES_PUBLIC_API = ENV_TOKENS.get('EDXNOTES_PUBLIC_API', EDXNOTES_PUBLIC_API) -EDXNOTES_INTERNAL_API = ENV_TOKENS.get('EDXNOTES_INTERNAL_API', EDXNOTES_INTERNAL_API) - -EDXNOTES_CONNECT_TIMEOUT = ENV_TOKENS.get('EDXNOTES_CONNECT_TIMEOUT', EDXNOTES_CONNECT_TIMEOUT) -EDXNOTES_READ_TIMEOUT = ENV_TOKENS.get('EDXNOTES_READ_TIMEOUT', EDXNOTES_READ_TIMEOUT) - -##### Credit Provider Integration ##### - -CREDIT_PROVIDER_SECRET_KEYS = AUTH_TOKENS.get("CREDIT_PROVIDER_SECRET_KEYS", {}) - -##################### LTI Provider ##################### -if FEATURES.get('ENABLE_LTI_PROVIDER'): - INSTALLED_APPS.append('lti_provider.apps.LtiProviderConfig') - AUTHENTICATION_BACKENDS.append('lti_provider.users.LtiBackend') - -LTI_USER_EMAIL_DOMAIN = ENV_TOKENS.get('LTI_USER_EMAIL_DOMAIN', 'lti.example.com') - -# For more info on this, see the notes in common.py -LTI_AGGREGATE_SCORE_PASSBACK_DELAY = ENV_TOKENS.get( - 'LTI_AGGREGATE_SCORE_PASSBACK_DELAY', LTI_AGGREGATE_SCORE_PASSBACK_DELAY -) - -##################### Credit Provider help link #################### -CREDIT_HELP_LINK_URL = ENV_TOKENS.get('CREDIT_HELP_LINK_URL', CREDIT_HELP_LINK_URL) - -#### JWT configuration #### -JWT_AUTH.update(ENV_TOKENS.get('JWT_AUTH', {})) -JWT_AUTH.update(AUTH_TOKENS.get('JWT_AUTH', {})) - -################# MICROSITE #################### -MICROSITE_CONFIGURATION = ENV_TOKENS.get('MICROSITE_CONFIGURATION', {}) -MICROSITE_ROOT_DIR = path(ENV_TOKENS.get('MICROSITE_ROOT_DIR', '')) -# this setting specify which backend to be used when pulling microsite specific configuration -MICROSITE_BACKEND = ENV_TOKENS.get("MICROSITE_BACKEND", MICROSITE_BACKEND) -# this setting specify which backend to be used when loading microsite specific templates -MICROSITE_TEMPLATE_BACKEND = ENV_TOKENS.get("MICROSITE_TEMPLATE_BACKEND", MICROSITE_TEMPLATE_BACKEND) -# TTL for microsite database template cache -MICROSITE_DATABASE_TEMPLATE_CACHE_TTL = ENV_TOKENS.get( - "MICROSITE_DATABASE_TEMPLATE_CACHE_TTL", MICROSITE_DATABASE_TEMPLATE_CACHE_TTL -) - -# Offset for pk of courseware.StudentModuleHistoryExtended -STUDENTMODULEHISTORYEXTENDED_OFFSET = ENV_TOKENS.get( - 'STUDENTMODULEHISTORYEXTENDED_OFFSET', STUDENTMODULEHISTORYEXTENDED_OFFSET -) - -# Cutoff date for granting audit certificates -if ENV_TOKENS.get('AUDIT_CERT_CUTOFF_DATE', None): - AUDIT_CERT_CUTOFF_DATE = dateutil.parser.parse(ENV_TOKENS.get('AUDIT_CERT_CUTOFF_DATE')) - -################################ Settings for Credentials Service ################################ - -CREDENTIALS_GENERATION_ROUTING_KEY = ENV_TOKENS.get('CREDENTIALS_GENERATION_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) - -# Queue to use for award program certificates -PROGRAM_CERTIFICATES_ROUTING_KEY = ENV_TOKENS.get('PROGRAM_CERTIFICATES_ROUTING_KEY', DEFAULT_PRIORITY_QUEUE) - -# The extended StudentModule history table -if FEATURES.get('ENABLE_CSMH_EXTENDED'): - INSTALLED_APPS.append('coursewarehistoryextended') - -API_ACCESS_MANAGER_EMAIL = ENV_TOKENS.get('API_ACCESS_MANAGER_EMAIL') -API_ACCESS_FROM_EMAIL = ENV_TOKENS.get('API_ACCESS_FROM_EMAIL') - -# Mobile App Version Upgrade config -APP_UPGRADE_CACHE_TIMEOUT = ENV_TOKENS.get('APP_UPGRADE_CACHE_TIMEOUT', APP_UPGRADE_CACHE_TIMEOUT) - -AFFILIATE_COOKIE_NAME = ENV_TOKENS.get('AFFILIATE_COOKIE_NAME', AFFILIATE_COOKIE_NAME) - -############## Settings for LMS Context Sensitive Help ############## - -HELP_TOKENS_BOOKS = ENV_TOKENS.get('HELP_TOKENS_BOOKS', HELP_TOKENS_BOOKS) - - -############## OPEN EDX ENTERPRISE SERVICE CONFIGURATION ###################### -# The Open edX Enterprise service is currently hosted via the LMS container/process. -# However, for all intents and purposes this service is treated as a standalone IDA. -# These configuration settings are specific to the Enterprise service and you should -# not find references to them within the edx-platform project. - -# Publicly-accessible enrollment URL, for use on the client side. -ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENV_TOKENS.get( - 'ENTERPRISE_PUBLIC_ENROLLMENT_API_URL', - (LMS_ROOT_URL or '') + LMS_ENROLLMENT_API_PATH -) - -# Enrollment URL used on the server-side. -ENTERPRISE_ENROLLMENT_API_URL = ENV_TOKENS.get( - 'ENTERPRISE_ENROLLMENT_API_URL', - (LMS_INTERNAL_ROOT_URL or '') + LMS_ENROLLMENT_API_PATH -) - -# Enterprise logo image size limit in KB's -ENTERPRISE_CUSTOMER_LOGO_IMAGE_SIZE = ENV_TOKENS.get( - 'ENTERPRISE_CUSTOMER_LOGO_IMAGE_SIZE', - ENTERPRISE_CUSTOMER_LOGO_IMAGE_SIZE -) - -# Course enrollment modes to be hidden in the Enterprise enrollment page -# if the "Hide audit track" flag is enabled for an EnterpriseCustomer -ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES = ENV_TOKENS.get( - 'ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES', - ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES -) - -# A support URL used on Enterprise landing pages for when a warning -# message goes off. -ENTERPRISE_SUPPORT_URL = ENV_TOKENS.get( - 'ENTERPRISE_SUPPORT_URL', - ENTERPRISE_SUPPORT_URL -) - -# A shared secret to be used for encrypting passwords passed from the enterprise api -# to the enteprise reporting script. -ENTERPRISE_REPORTING_SECRET = AUTH_TOKENS.get( - 'ENTERPRISE_REPORTING_SECRET', - ENTERPRISE_REPORTING_SECRET -) - -# A default dictionary to be used for filtering out enterprise customer catalog. -ENTERPRISE_CUSTOMER_CATALOG_DEFAULT_CONTENT_FILTER = ENV_TOKENS.get( - 'ENTERPRISE_CUSTOMER_CATALOG_DEFAULT_CONTENT_FILTER', - ENTERPRISE_CUSTOMER_CATALOG_DEFAULT_CONTENT_FILTER -) - -############## ENTERPRISE SERVICE API CLIENT CONFIGURATION ###################### -# The LMS communicates with the Enterprise service via the EdxRestApiClient class -# The below environmental settings are utilized by the LMS when interacting with -# the service, and override the default parameters which are defined in common.py - -DEFAULT_ENTERPRISE_API_URL = None -if LMS_INTERNAL_ROOT_URL is not None: - DEFAULT_ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' -ENTERPRISE_API_URL = ENV_TOKENS.get('ENTERPRISE_API_URL', DEFAULT_ENTERPRISE_API_URL) - -DEFAULT_ENTERPRISE_CONSENT_API_URL = None -if LMS_INTERNAL_ROOT_URL is not None: - DEFAULT_ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' -ENTERPRISE_CONSENT_API_URL = ENV_TOKENS.get('ENTERPRISE_CONSENT_API_URL', DEFAULT_ENTERPRISE_CONSENT_API_URL) - -ENTERPRISE_SERVICE_WORKER_USERNAME = ENV_TOKENS.get( - 'ENTERPRISE_SERVICE_WORKER_USERNAME', - ENTERPRISE_SERVICE_WORKER_USERNAME -) -ENTERPRISE_API_CACHE_TIMEOUT = ENV_TOKENS.get( - 'ENTERPRISE_API_CACHE_TIMEOUT', - ENTERPRISE_API_CACHE_TIMEOUT -) - -############## ENTERPRISE SERVICE LMS CONFIGURATION ################################## -# The LMS has some features embedded that are related to the Enterprise service, but -# which are not provided by the Enterprise service. These settings override the -# base values for the parameters as defined in common.py - -ENTERPRISE_PLATFORM_WELCOME_TEMPLATE = ENV_TOKENS.get( - 'ENTERPRISE_PLATFORM_WELCOME_TEMPLATE', - ENTERPRISE_PLATFORM_WELCOME_TEMPLATE -) -ENTERPRISE_SPECIFIC_BRANDED_WELCOME_TEMPLATE = ENV_TOKENS.get( - 'ENTERPRISE_SPECIFIC_BRANDED_WELCOME_TEMPLATE', - ENTERPRISE_SPECIFIC_BRANDED_WELCOME_TEMPLATE -) -ENTERPRISE_TAGLINE = ENV_TOKENS.get( - 'ENTERPRISE_TAGLINE', - ENTERPRISE_TAGLINE -) -ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS = set( - ENV_TOKENS.get( - 'ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS', - ENTERPRISE_EXCLUDED_REGISTRATION_FIELDS - ) -) -BASE_COOKIE_DOMAIN = ENV_TOKENS.get( - 'BASE_COOKIE_DOMAIN', - BASE_COOKIE_DOMAIN -) - -############## CATALOG/DISCOVERY SERVICE API CLIENT CONFIGURATION ###################### -# The LMS communicates with the Catalog service via the EdxRestApiClient class -# The below environmental settings are utilized by the LMS when interacting with -# the service, and override the default parameters which are defined in common.py - -COURSES_API_CACHE_TIMEOUT = ENV_TOKENS.get('COURSES_API_CACHE_TIMEOUT', COURSES_API_CACHE_TIMEOUT) - -# Add an ICP license for serving content in China if your organization is registered to do so -ICP_LICENSE = ENV_TOKENS.get('ICP_LICENSE', None) - -############## Settings for CourseGraph ############################ -COURSEGRAPH_JOB_QUEUE = ENV_TOKENS.get('COURSEGRAPH_JOB_QUEUE', DEFAULT_PRIORITY_QUEUE) - -########################## Parental controls config ####################### - -# The age at which a learner no longer requires parental consent, or None -# if parental consent is never required. -PARENTAL_CONSENT_AGE_LIMIT = ENV_TOKENS.get( - 'PARENTAL_CONSENT_AGE_LIMIT', - PARENTAL_CONSENT_AGE_LIMIT -) - -# Do NOT calculate this dynamically at startup with git because it's *slow*. -EDX_PLATFORM_REVISION = ENV_TOKENS.get('EDX_PLATFORM_REVISION', EDX_PLATFORM_REVISION) - -########################## Extra middleware classes ####################### - -# Allow extra middleware classes to be added to the app through configuration. -MIDDLEWARE_CLASSES.extend(ENV_TOKENS.get('EXTRA_MIDDLEWARE_CLASSES', [])) - -########################## Settings for Completion API ##################### - -# Once a user has watched this percentage of a video, mark it as complete: -# (0.0 = 0%, 1.0 = 100%) -COMPLETION_VIDEO_COMPLETE_PERCENTAGE = ENV_TOKENS.get( - 'COMPLETION_VIDEO_COMPLETE_PERCENTAGE', - COMPLETION_VIDEO_COMPLETE_PERCENTAGE, -) -# The time a block needs to be viewed to be considered complete, in milliseconds. -COMPLETION_BY_VIEWING_DELAY_MS = ENV_TOKENS.get('COMPLETION_BY_VIEWING_DELAY_MS', COMPLETION_BY_VIEWING_DELAY_MS) - -############### Settings for django-fernet-fields ################## -FERNET_KEYS = AUTH_TOKENS.get('FERNET_KEYS', FERNET_KEYS) - -################# Settings for the maintenance banner ################# -MAINTENANCE_BANNER_TEXT = ENV_TOKENS.get('MAINTENANCE_BANNER_TEXT', None) - -############### Settings for Retirement ##################### -RETIRED_USERNAME_PREFIX = ENV_TOKENS.get('RETIRED_USERNAME_PREFIX', RETIRED_USERNAME_PREFIX) -RETIRED_EMAIL_PREFIX = ENV_TOKENS.get('RETIRED_EMAIL_PREFIX', RETIRED_EMAIL_PREFIX) -RETIRED_EMAIL_DOMAIN = ENV_TOKENS.get('RETIRED_EMAIL_DOMAIN', RETIRED_EMAIL_DOMAIN) -RETIRED_USER_SALTS = ENV_TOKENS.get('RETIRED_USER_SALTS', RETIRED_USER_SALTS) -RETIREMENT_SERVICE_WORKER_USERNAME = ENV_TOKENS.get( - 'RETIREMENT_SERVICE_WORKER_USERNAME', - RETIREMENT_SERVICE_WORKER_USERNAME -) -RETIREMENT_STATES = ENV_TOKENS.get('RETIREMENT_STATES', RETIREMENT_STATES) - -############## Settings for Course Enrollment Modes ###################### -COURSE_ENROLLMENT_MODES = ENV_TOKENS.get('COURSE_ENROLLMENT_MODES', COURSE_ENROLLMENT_MODES) - -############## Settings for Writable Gradebook ######################### -WRITABLE_GRADEBOOK_URL = ENV_TOKENS.get('WRITABLE_GRADEBOOK_URL', WRITABLE_GRADEBOOK_URL) - -############################### Plugin Settings ############################### - -# This is at the bottom because it is going to load more settings after base settings are loaded -from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants # pylint: disable=wrong-import-order, wrong-import-position -plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.LMS, plugin_constants.SettingsType.AWS) - -########################## Derive Any Derived Settings ####################### - -derive_settings(__name__) - -logging.warn('DEPRECATION WARNING: aws.py has been deprecated, you should use production.py instead.') diff --git a/lms/envs/common.py b/lms/envs/common.py index 66e95a0d5345..a9d321077cee 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3283,7 +3283,7 @@ def _make_locale_paths(settings): ############## ENTERPRISE SERVICE API CLIENT CONFIGURATION ###################### # The LMS communicates with the Enterprise service via the EdxRestApiClient class # These default settings are utilized by the LMS when interacting with the service, -# and are overridden by the configuration parameter accessors defined in aws.py +# and are overridden by the configuration parameter accessors defined in production.py ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/' ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/' @@ -3385,7 +3385,7 @@ def _make_locale_paths(settings): COURSEGRAPH_JOB_QUEUE = DEFAULT_PRIORITY_QUEUE -# Initialize to 'unknown', but read from JSON in aws.py +# Initialize to 'unknown', but read from JSON in production.py EDX_PLATFORM_REVISION = 'unknown' ############## Settings for Completion API ######################### diff --git a/lms/envs/docs/README.rst b/lms/envs/docs/README.rst index 60948e9a929c..f7c767ae220a 100644 --- a/lms/envs/docs/README.rst +++ b/lms/envs/docs/README.rst @@ -17,7 +17,7 @@ JSON Configuration Files ------------------------ In addition, there is a mechanism for reading and overriding configuration -settings from JSON files on-disk. The :file:`/lms/envs/aws.py` module loads +settings from JSON files on-disk. The :file:`/lms/envs/production.py` module loads settings from ``lms.env.json`` and ``lms.auth.json`` files. All security-sensitive settings and data belong in the ``lms.auth.json`` file, while the rest are configured via the ``lms.env.json`` file. @@ -66,7 +66,7 @@ In this case, ``LOCALE_PATHS`` will be defined correctly at the end of the settings module parsing no matter what ``REPO_ROOT``, `ENABLE_COMPREHENSIVE_THEMING`, and ``COMPREHENSIVE_THEME_LOCALE_PATHS`` are currently set to. This is true even if the ``LOCALE_PATHS`` calculation was -defined in ``lms/envs/common.py`` and you're using ``lms/envs/aws.py`` which +defined in ``lms/envs/common.py`` and you're using ``lms/envs/production.py`` which includes overrides both from that module and the JSON configuration files. List entries and dictionary values can also be derived from other settings, even diff --git a/lms/envs/openstack.py b/lms/envs/openstack.py index 1fe8bb525435..d19fdb9c4435 100644 --- a/lms/envs/openstack.py +++ b/lms/envs/openstack.py @@ -2,8 +2,6 @@ Settings for OpenStack deployments. """ -# We import the aws settings because that's currently where the base settings are stored for all deployments. -# TODO - fix this when aws.py is split/renamed. from .production import * # pylint: disable=wildcard-import, unused-wildcard-import SWIFT_AUTH_URL = AUTH_TOKENS.get('SWIFT_AUTH_URL') diff --git a/lms/envs/production.py b/lms/envs/production.py index 441200e6f556..fea4cdbd0abb 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -1101,11 +1101,6 @@ def get_env_setting(setting): # This is at the bottom because it is going to load more settings after base settings are loaded -# Load aws.py in plugins for reverse compatibility. This can be removed after aws.py -# is officially removed. -plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.LMS, - plugin_constants.SettingsType.AWS) - # Load production.py in plugins plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.LMS, plugin_constants.SettingsType.PRODUCTION) diff --git a/manage.py b/manage.py index cb96611111c8..db44ae802bf0 100755 --- a/manage.py +++ b/manage.py @@ -48,7 +48,7 @@ def parse_args(): '--service-variant', choices=['lms', 'lms-xml', 'lms-preview'], default='lms', - help='Which service variant to run, when using the aws environment') + help='Which service variant to run, when using the production environment') lms.add_argument( '--contracts', action='store_true', diff --git a/openedx/core/djangoapps/ace_common/apps.py b/openedx/core/djangoapps/ace_common/apps.py index 9a4c1f4e3f5e..397640fe87b8 100644 --- a/openedx/core/djangoapps/ace_common/apps.py +++ b/openedx/core/djangoapps/ace_common/apps.py @@ -17,12 +17,12 @@ class AceCommonConfig(AppConfig): plugin_app = { PluginSettings.CONFIG: { ProjectType.LMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, }, ProjectType.CMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, } diff --git a/openedx/core/djangoapps/ace_common/settings/aws.py b/openedx/core/djangoapps/ace_common/settings/production.py similarity index 91% rename from openedx/core/djangoapps/ace_common/settings/aws.py rename to openedx/core/djangoapps/ace_common/settings/production.py index bd8c5899cef6..cc4da91c18db 100644 --- a/openedx/core/djangoapps/ace_common/settings/aws.py +++ b/openedx/core/djangoapps/ace_common/settings/production.py @@ -1,4 +1,9 @@ +"""Common environment variables unique to the ace_common plugin.""" + + def plugin_settings(settings): + """Settings for the ace_common plugin. """ + settings.ACE_ENABLED_CHANNELS = settings.ENV_TOKENS.get('ACE_ENABLED_CHANNELS', settings.ACE_ENABLED_CHANNELS) settings.ACE_ENABLED_POLICIES = settings.ENV_TOKENS.get('ACE_ENABLED_POLICIES', settings.ACE_ENABLED_POLICIES) settings.ACE_CHANNEL_SAILTHRU_DEBUG = settings.ENV_TOKENS.get( diff --git a/openedx/core/djangoapps/bookmarks/apps.py b/openedx/core/djangoapps/bookmarks/apps.py index 5b4bec435334..7c60e201b430 100644 --- a/openedx/core/djangoapps/bookmarks/apps.py +++ b/openedx/core/djangoapps/bookmarks/apps.py @@ -23,7 +23,7 @@ class BookmarksConfig(AppConfig): }, PluginSettings.CONFIG: { ProjectType.LMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, } } diff --git a/openedx/core/djangoapps/bookmarks/settings/aws.py b/openedx/core/djangoapps/bookmarks/settings/production.py similarity index 55% rename from openedx/core/djangoapps/bookmarks/settings/aws.py rename to openedx/core/djangoapps/bookmarks/settings/production.py index fb9587a0e0a0..0d4c62bf9ffe 100644 --- a/openedx/core/djangoapps/bookmarks/settings/aws.py +++ b/openedx/core/djangoapps/bookmarks/settings/production.py @@ -1,5 +1,8 @@ +"""Common environment variables unique to the Course Content Bookmarks plugin.""" + + def plugin_settings(settings): - # Course Content Bookmarks Settings + """Settings for the Course Content Bookmarks plugin. """ settings.MAX_BOOKMARKS_PER_COURSE = settings.ENV_TOKENS.get( 'MAX_BOOKMARKS_PER_COURSE', settings.MAX_BOOKMARKS_PER_COURSE diff --git a/openedx/core/djangoapps/coursegraph/management/commands/dump_to_neo4j.py b/openedx/core/djangoapps/coursegraph/management/commands/dump_to_neo4j.py index bc3649f34bf3..b6dc89654768 100644 --- a/openedx/core/djangoapps/coursegraph/management/commands/dump_to_neo4j.py +++ b/openedx/core/djangoapps/coursegraph/management/commands/dump_to_neo4j.py @@ -33,7 +33,7 @@ class Command(BaseCommand): Example usage: python manage.py lms dump_to_neo4j --host localhost --https_port 7473 \ - --secure --user user --password password --settings=aws + --secure --user user --password password --settings=production """ def add_arguments(self, parser): parser.add_argument('--host', type=six.text_type) diff --git a/openedx/core/djangoapps/credentials/apps.py b/openedx/core/djangoapps/credentials/apps.py index a715e7b41d30..4fb484c9e6a5 100644 --- a/openedx/core/djangoapps/credentials/apps.py +++ b/openedx/core/djangoapps/credentials/apps.py @@ -16,7 +16,7 @@ class CredentialsConfig(AppConfig): plugin_app = { PluginSettings.CONFIG: { ProjectType.LMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'}, diff --git a/openedx/core/djangoapps/credentials/settings/aws.py b/openedx/core/djangoapps/credentials/settings/production.py similarity index 100% rename from openedx/core/djangoapps/credentials/settings/aws.py rename to openedx/core/djangoapps/credentials/settings/production.py diff --git a/openedx/core/djangoapps/password_policy/apps.py b/openedx/core/djangoapps/password_policy/apps.py index 9905cf3abffe..8bf29da123fe 100644 --- a/openedx/core/djangoapps/password_policy/apps.py +++ b/openedx/core/djangoapps/password_policy/apps.py @@ -23,12 +23,12 @@ class PasswordPolicyConfig(AppConfig): plugin_app = { PluginSettings.CONFIG: { ProjectType.LMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, }, ProjectType.CMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, } diff --git a/openedx/core/djangoapps/password_policy/settings/aws.py b/openedx/core/djangoapps/password_policy/settings/production.py similarity index 100% rename from openedx/core/djangoapps/password_policy/settings/aws.py rename to openedx/core/djangoapps/password_policy/settings/production.py diff --git a/openedx/core/djangoapps/plugins/README.rst b/openedx/core/djangoapps/plugins/README.rst index 2f2bad94c36d..2013200231ed 100644 --- a/openedx/core/djangoapps/plugins/README.rst +++ b/openedx/core/djangoapps/plugins/README.rst @@ -148,7 +148,7 @@ class:: # The python path (relative to this app) to the settings module for the relevant Project Type and Settings Type. # Optional; Defaults to u'settings'. - PluginSettings.RELATIVE_PATH: u'settings.aws', + PluginSettings.RELATIVE_PATH: u'settings.production', }, SettingsType.COMMON: { PluginSettings.RELATIVE_PATH: u'settings.common', @@ -203,7 +203,7 @@ OR use string constants when they cannot import from djangoapps.plugins:: }, u'settings_config': { u'lms.djangoapp': { - u'aws': { relative_path: u'settings.aws' }, + u'production': { relative_path: u'settings.production' }, u'common': { relative_path: u'settings.common'}, } }, diff --git a/openedx/core/djangoapps/plugins/constants.py b/openedx/core/djangoapps/plugins/constants.py index ea4671acacb1..56949535dffe 100644 --- a/openedx/core/djangoapps/plugins/constants.py +++ b/openedx/core/djangoapps/plugins/constants.py @@ -29,7 +29,6 @@ class SettingsType(object): See https://github.com/edx/edx-platform/master/lms/envs/docs/README.rst for further information on each Settings Type. """ - AWS = u'aws' # aws.py has been deprecated. See https://openedx.atlassian.net/browse/DEPR-14 PRODUCTION = u'production' COMMON = u'common' DEVSTACK = u'devstack' diff --git a/openedx/core/djangoapps/zendesk_proxy/apps.py b/openedx/core/djangoapps/zendesk_proxy/apps.py index fbe6da2572be..81c18f225a63 100644 --- a/openedx/core/djangoapps/zendesk_proxy/apps.py +++ b/openedx/core/djangoapps/zendesk_proxy/apps.py @@ -30,11 +30,11 @@ class ZendeskProxyConfig(AppConfig): PluginSettings.CONFIG: { ProjectType.CMS: { SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, }, ProjectType.LMS: { SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, } } } diff --git a/openedx/core/djangoapps/zendesk_proxy/settings/aws.py b/openedx/core/djangoapps/zendesk_proxy/settings/production.py similarity index 100% rename from openedx/core/djangoapps/zendesk_proxy/settings/aws.py rename to openedx/core/djangoapps/zendesk_proxy/settings/production.py diff --git a/openedx/features/journals/apps.py b/openedx/features/journals/apps.py index 6df6b660ae46..34010042afee 100644 --- a/openedx/features/journals/apps.py +++ b/openedx/features/journals/apps.py @@ -21,7 +21,7 @@ class JournalsConfig(AppConfig): }, PluginSettings.CONFIG: { ProjectType.LMS: { - SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'}, + SettingsType.PRODUCTION: {PluginSettings.RELATIVE_PATH: u'settings.production'}, SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'}, SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'}, SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'}, diff --git a/openedx/features/journals/settings/aws.py b/openedx/features/journals/settings/production.py similarity index 100% rename from openedx/features/journals/settings/aws.py rename to openedx/features/journals/settings/production.py diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 949787eb4e12..8e990d23e0dc 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -44,6 +44,3 @@ pytest-randomly<2.0.0 # Tornado dropped support for Python 2.7 and 3.4 with version 6.0. Only Python 3.5.2+ is now supported tornado<6.0 - -# Preventing https://github.com/edx/edx-proctoring/pull/557 being installed before https://github.com/edx/edx-platform/pull/19959 -edx-proctoring==1.5.21 diff --git a/requirements/edx/base.in b/requirements/edx/base.in index 875e0d49614f..b873fb4dfe3b 100644 --- a/requirements/edx/base.in +++ b/requirements/edx/base.in @@ -79,7 +79,7 @@ edx-enterprise edx-milestones edx-oauth2-provider edx-organizations -edx-proctoring>=1.5.3 +edx-proctoring>=1.6.0 edx-proctoring-proctortrack edx-rest-api-client edx-search diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index b92c30f3b8bf..ebf6b5edba57 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -120,7 +120,7 @@ edx-oauth2-provider==1.2.2 edx-opaque-keys[django]==0.4.4 edx-organizations==1.0.1 edx-proctoring-proctortrack==1.0.4 -edx-proctoring==1.5.21 +edx-proctoring==1.6.0 edx-rbac==0.1.5 # via edx-enterprise edx-rest-api-client==1.9.2 edx-search==1.2.2 @@ -168,7 +168,7 @@ mongoengine==0.10.0 mpmath==1.1.0 # via sympy mysqlclient==1.4.2.post1 networkx==1.7 -newrelic==4.14.0.115 +newrelic==4.16.0.116 nltk==3.4 nodeenv==1.1.1 numpy==1.16.2 # via scipy @@ -208,7 +208,7 @@ pytz==2018.9 pyuca==1.1 pyyaml==5.1 redis==2.10.6 -reportlab==3.5.13 +reportlab==3.5.16 requests-oauthlib==1.1.0 requests==2.21.0 rest-condition==1.0.3 @@ -228,7 +228,7 @@ social-auth-app-django==2.1.0 social-auth-core==1.7.0 sorl-thumbnail==12.3 sortedcontainers==2.1.0 -soupsieve==1.8 # via beautifulsoup4 +soupsieve==1.9 # via beautifulsoup4 sqlparse==0.3.0 stevedore==1.30.1 sympy==1.3 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index f6dc9c80b907..a2415ca2aba5 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -72,7 +72,7 @@ click-log==0.1.8 click==7.0 code-annotations==0.3.1 colorama==0.4.1 -configparser==3.7.3 +configparser==3.7.4 constantly==15.1.0 coreapi==2.3.3 coreschema==0.0.4 @@ -143,7 +143,7 @@ edx-oauth2-provider==1.2.2 edx-opaque-keys[django]==0.4.4 edx-organizations==1.0.1 edx-proctoring-proctortrack==1.0.4 -edx-proctoring==1.5.21 +edx-proctoring==1.6.0 edx-rbac==0.1.5 edx-rest-api-client==1.9.2 edx-search==1.2.2 @@ -189,7 +189,7 @@ incremental==17.5.0 inflect==2.1.0 ipaddress==1.0.22 isodate==0.6.0 -isort==4.3.15 +isort==4.3.16 itsdangerous==1.1.0 itypes==1.1.0 jinja2-pluralize==0.3.0 @@ -221,7 +221,7 @@ moto==0.3.1 mpmath==1.1.0 mysqlclient==1.4.2.post1 networkx==1.7 -newrelic==4.14.0.115 +newrelic==4.16.0.116 nltk==3.4 nodeenv==1.1.1 numpy==1.16.2 @@ -294,7 +294,7 @@ pyyaml==5.1 queuelib==1.5.0 radon==3.0.1 redis==2.10.6 -reportlab==3.5.13 +reportlab==3.5.16 requests-oauthlib==1.1.0 requests==2.21.0 rest-condition==1.0.3 @@ -320,7 +320,7 @@ social-auth-app-django==2.1.0 social-auth-core==1.7.0 sorl-thumbnail==12.3 sortedcontainers==2.1.0 -soupsieve==1.8 +soupsieve==1.9 sphinx==1.8.5 sphinxcontrib-websupport==1.1.0 # via sphinx splinter==0.9.0 @@ -334,7 +334,7 @@ text-unidecode==1.2 tincan==0.0.5 toml==0.10.0 tox-battery==0.5.1 -tox==3.7.0 +tox==3.8.0 traceback2==1.4.0 transifex-client==0.13.6 twisted==18.9.0 diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 8b22de6e62cc..b9eef64eb64b 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -70,7 +70,7 @@ click-log==0.1.8 # via edx-lint click==7.0 code-annotations==0.3.1 colorama==0.4.1 # via radon -configparser==3.7.3 # via entrypoints, flake8, pylint +configparser==3.7.4 # via entrypoints, flake8, pylint constantly==15.1.0 # via twisted coreapi==2.3.3 coreschema==0.0.4 @@ -139,7 +139,7 @@ edx-oauth2-provider==1.2.2 edx-opaque-keys[django]==0.4.4 edx-organizations==1.0.1 edx-proctoring-proctortrack==1.0.4 -edx-proctoring==1.5.21 +edx-proctoring==1.6.0 edx-rbac==0.1.5 edx-rest-api-client==1.9.2 edx-search==1.2.2 @@ -183,7 +183,7 @@ incremental==17.5.0 # via twisted inflect==2.1.0 ipaddress==1.0.22 isodate==0.6.0 -isort==4.3.15 +isort==4.3.16 itsdangerous==1.1.0 # via flask itypes==1.1.0 jinja2-pluralize==0.3.0 @@ -214,7 +214,7 @@ moto==0.3.1 mpmath==1.1.0 mysqlclient==1.4.2.post1 networkx==1.7 -newrelic==4.14.0.115 +newrelic==4.16.0.116 nltk==3.4 nodeenv==1.1.1 numpy==1.16.2 @@ -285,7 +285,7 @@ pyyaml==5.1 queuelib==1.5.0 # via scrapy radon==3.0.1 redis==2.10.6 -reportlab==3.5.13 +reportlab==3.5.16 requests-oauthlib==1.1.0 requests==2.21.0 rest-condition==1.0.3 @@ -309,7 +309,7 @@ social-auth-app-django==2.1.0 social-auth-core==1.7.0 sorl-thumbnail==12.3 sortedcontainers==2.1.0 -soupsieve==1.8 +soupsieve==1.9 splinter==0.9.0 sqlparse==0.3.0 stevedore==1.30.1 @@ -321,7 +321,7 @@ text-unidecode==1.2 # via faker tincan==0.0.5 toml==0.10.0 # via tox tox-battery==0.5.1 -tox==3.7.0 +tox==3.8.0 traceback2==1.4.0 # via testtools, unittest2 transifex-client==0.13.6 twisted==18.9.0 # via scrapy diff --git a/themes/README.rst b/themes/README.rst index 8379801b1695..a91f1f38f524 100644 --- a/themes/README.rst +++ b/themes/README.rst @@ -151,7 +151,7 @@ name in the ``@import`` line. Run the ``update_assets`` command to recompile the theme:: - $ paver update_assets lms --settings=aws + $ paver update_assets lms --settings=production Microsites ==========