* Add and push Dockerfile; add decentralized devstack settings Co-Authored-By: Diana Huang <dkh@edx.org> Co-Authored-By: Kyle McCormick <kmccormick@edx.org> * Remove Python requirements hack Remove the attempted optimization to the installation of Python package dependencies. The dependencies in edx-platform change about three times per day, so this was of dubious value. And because npm is run through nodeenv, which is a Python package, the Python dependencies installation has to happen first. * ARCHBOM-1439: Changing workdir to /edx/app/edxapp/edx-platform (#24835) Context: The Dockerfile tries to stay in sych with legacy stuff. In the ansible we configure the directory structure such that things relating to the app but not in the codebase, such as the env file wind up in /edx/app/edxapp/. And the codebase winds up in /edx/app/edxapp/edx-platform. I think due to accident, the dockerfile does /edx/app/edx-platform/edx-platform instead of /edx/app/edxapp/edx-platform. This commit tries to have Dockerfile more reflect what is currently happening in production * Update ports for decentralized devstack ARCHBOM-1447 (#24841) Switch from the LMS ports we've historically used for NGINX to those used for gunicorn, and fix the Studio ports to match the ones we've historically used for its gunicorn service. Also removed some leftover bits of the requirements hack. Co-authored-by: Adam Blackwell <ablackwell@edx.org> Co-authored-by: Diana Huang <dkh@edx.org> Co-authored-by: jinder1s <msingh@edx.org> Co-authored-by: Jeremy Bowman <jbowman@edx.org> Co-authored-by: Manjinder Singh <49171515+jinder1s@users.noreply.github.com>
186 lines
7.2 KiB
Python
186 lines
7.2 KiB
Python
"""
|
|
Settings file for decentralized devstack
|
|
"""
|
|
|
|
import logging
|
|
from os.path import abspath, dirname, join
|
|
|
|
from .production import * # pylint: disable=wildcard-import, unused-wildcard-import
|
|
|
|
# Don't use S3 in devstack, fall back to filesystem
|
|
del DEFAULT_FILE_STORAGE
|
|
COURSE_IMPORT_EXPORT_STORAGE = 'django.core.files.storage.FileSystemStorage'
|
|
USER_TASKS_ARTIFACT_STORAGE = COURSE_IMPORT_EXPORT_STORAGE
|
|
|
|
DEBUG = True
|
|
USE_I18N = True
|
|
DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = DEBUG
|
|
SITE_NAME = 'localhost:8001'
|
|
HTTPS = 'off'
|
|
|
|
CMS_BASE = 'localhost:8010'
|
|
|
|
################################ LOGGERS ######################################
|
|
|
|
|
|
# Disable noisy loggers
|
|
for pkg_name in ['track.contexts', 'track.middleware']:
|
|
logging.getLogger(pkg_name).setLevel(logging.CRITICAL)
|
|
|
|
# Docker does not support the syslog socket at /dev/log. Rely on the console.
|
|
LOGGING['handlers']['local'] = LOGGING['handlers']['tracking'] = {
|
|
'class': 'logging.NullHandler',
|
|
}
|
|
|
|
LOGGING['loggers']['tracking']['handlers'] = ['console']
|
|
|
|
################################ EMAIL ########################################
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
|
|
EMAIL_FILE_PATH = '/edx/src/ace_messages/'
|
|
|
|
################################# LMS INTEGRATION #############################
|
|
|
|
LMS_BASE = 'localhost:8000'
|
|
LMS_ROOT_URL = 'http://{}'.format(LMS_BASE)
|
|
FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE
|
|
|
|
########################### PIPELINE #################################
|
|
|
|
# Skip packaging and optimization in development
|
|
PIPELINE['PIPELINE_ENABLED'] = False
|
|
STATICFILES_STORAGE = 'openedx.core.storage.DevelopmentStorage'
|
|
|
|
# Revert to the default set of finders as we don't want the production pipeline
|
|
STATICFILES_FINDERS = [
|
|
'openedx.core.djangoapps.theming.finders.ThemeFilesFinder',
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
]
|
|
|
|
# Load development webpack donfiguration
|
|
WEBPACK_CONFIG_PATH = 'webpack.dev.config.js'
|
|
|
|
############################ PYFS XBLOCKS SERVICE #############################
|
|
# Set configuration for Django pyfilesystem
|
|
|
|
DJFS = {
|
|
'type': 'osfs',
|
|
'directory_root': 'cms/static/djpyfs',
|
|
'url_root': '/static/djpyfs',
|
|
}
|
|
|
|
################################# CELERY ######################################
|
|
|
|
# By default don't use a worker, execute tasks as if they were local functions
|
|
CELERY_ALWAYS_EAGER = True
|
|
|
|
|
|
def should_show_debug_toolbar(request):
|
|
return False
|
|
|
|
|
|
################################ MILESTONES ################################
|
|
FEATURES['MILESTONES_APP'] = True
|
|
|
|
|
|
################################ ENTRANCE EXAMS ################################
|
|
FEATURES['ENTRANCE_EXAMS'] = True
|
|
|
|
################################ COURSE LICENSES ################################
|
|
FEATURES['LICENSING'] = True
|
|
# Needed to enable licensing on video modules
|
|
XBLOCK_SETTINGS.update({'VideoBlock': {'licensing_enabled': True}})
|
|
|
|
################################ SEARCH INDEX ################################
|
|
FEATURES['ENABLE_COURSEWARE_INDEX'] = False
|
|
FEATURES['ENABLE_LIBRARY_INDEX'] = False
|
|
SEARCH_ENGINE = "search.elastic.ElasticSearchEngine"
|
|
|
|
################################ COURSE DISCUSSIONS ###########################
|
|
FEATURES['ENABLE_DISCUSSION_SERVICE'] = True
|
|
|
|
################################ CREDENTIALS ###########################
|
|
CREDENTIALS_SERVICE_USERNAME = 'credentials_worker'
|
|
|
|
########################## Certificates Web/HTML View #######################
|
|
FEATURES['CERTIFICATES_HTML_VIEW'] = True
|
|
|
|
########################## AUTHOR PERMISSION #######################
|
|
FEATURES['ENABLE_CREATOR_GROUP'] = False
|
|
|
|
################### FRONTEND APPLICATION PUBLISHER URL ###################
|
|
FEATURES['FRONTEND_APP_PUBLISHER_URL'] = 'http://localhost:18400'
|
|
|
|
################################# DJANGO-REQUIRE ###############################
|
|
|
|
# Whether to run django-require in debug mode.
|
|
REQUIRE_DEBUG = DEBUG
|
|
|
|
########################### OAUTH2 #################################
|
|
JWT_AUTH.update({
|
|
'JWT_ISSUER': '{}/oauth2'.format(LMS_ROOT_URL),
|
|
'JWT_ISSUERS': [{
|
|
'AUDIENCE': 'lms-key',
|
|
'ISSUER': '{}/oauth2'.format(LMS_ROOT_URL),
|
|
'SECRET_KEY': 'lms-secret',
|
|
}],
|
|
'JWT_SECRET_KEY': 'lms-secret',
|
|
'JWT_AUDIENCE': 'lms-key',
|
|
'JWT_PUBLIC_SIGNING_JWK_SET': (
|
|
'{"keys": [{"kid": "devstack_key", "e": "AQAB", "kty": "RSA", "n": "smKFSYowG6nNUAdeqH1jQQnH1PmIHphzBmwJ5vRf1vu'
|
|
'48BUI5VcVtUWIPqzRK_LDSlZYh9D0YFL0ZTxIrlb6Tn3Xz7pYvpIAeYuQv3_H5p8tbz7Fb8r63c1828wXPITVTv8f7oxx5W3lFFgpFAyYMmROC'
|
|
'4Ee9qG5T38LFe8_oAuFCEntimWxN9F3P-FJQy43TL7wG54WodgiM0EgzkeLr5K6cDnyckWjTuZbWI-4ffcTgTZsL_Kq1owa_J2ngEfxMCObnzG'
|
|
'y5ZLcTUomo4rZLjghVpq6KZxfS6I1Vz79ZsMVUWEdXOYePCKKsrQG20ogQEkmTf9FT_SouC6jPcHLXw"}]}'
|
|
),
|
|
|
|
# TODO Remove this once CMS redirects to LMS for Login
|
|
'JWT_PRIVATE_SIGNING_JWK': (
|
|
'{"e": "AQAB", "d": "RQ6k4NpRU3RB2lhwCbQ452W86bMMQiPsa7EJiFJUg-qBJthN0FMNQVbArtrCQ0xA1BdnQHThFiUnHcXfsTZUwmwvTu'
|
|
'iqEGR_MI6aI7h5D8vRj_5x-pxOz-0MCB8TY8dcuK9FkljmgtYvV9flVzCk_uUb3ZJIBVyIW8En7n7nV7JXpS9zey1yVLld2AbRG6W5--Pgqr9J'
|
|
'CI5-bLdc2otCLuen2sKyuUDHO5NIj30qGTaKUL-OW_PgVmxrwKwccF3w5uGNEvMQ-IcicosCOvzBwdIm1uhdm9rnHU1-fXz8VLRHNhGVv7z6mo'
|
|
'ghjNI0_u4smhUkEsYeshPv7RQEWTdkOQ", "n": "smKFSYowG6nNUAdeqH1jQQnH1PmIHphzBmwJ5vRf1vu48BUI5VcVtUWIPqzRK_LDSlZYh'
|
|
'9D0YFL0ZTxIrlb6Tn3Xz7pYvpIAeYuQv3_H5p8tbz7Fb8r63c1828wXPITVTv8f7oxx5W3lFFgpFAyYMmROC4Ee9qG5T38LFe8_oAuFCEntimW'
|
|
'xN9F3P-FJQy43TL7wG54WodgiM0EgzkeLr5K6cDnyckWjTuZbWI-4ffcTgTZsL_Kq1owa_J2ngEfxMCObnzGy5ZLcTUomo4rZLjghVpq6KZxfS'
|
|
'6I1Vz79ZsMVUWEdXOYePCKKsrQG20ogQEkmTf9FT_SouC6jPcHLXw", "q": "7KWj7l-ZkfCElyfvwsl7kiosvi-ppOO7Imsv90cribf88Dex'
|
|
'cO67xdMPesjM9Nh5X209IT-TzbsOtVTXSQyEsy42NY72WETnd1_nAGLAmfxGdo8VV4ZDnRsA8N8POnWjRDwYlVBUEEeuT_MtMWzwIKU94bzkWV'
|
|
'nHCY5vbhBYLeM", "p": "wPkfnjavNV1Hqb5Qqj2crBS9HQS6GDQIZ7WF9hlBb2ofDNe2K2dunddFqCOdvLXr7ydRcK51ZwSeHjcjgD1aJkHA'
|
|
'9i1zqyboxgd0uAbxVDo6ohnlVqYLtap2tXXcavKm4C9MTpob_rk6FBfEuq4uSsuxFvCER4yG3CYBBa4gZVU", "kid": "devstack_key", "'
|
|
'kty": "RSA"}'
|
|
),
|
|
})
|
|
|
|
# pylint: enable=unicode-format-string
|
|
|
|
IDA_LOGOUT_URI_LIST = [
|
|
'http://localhost:18130/logout/', # ecommerce
|
|
'http://localhost:18150/logout/', # credentials
|
|
]
|
|
|
|
############################### BLOCKSTORE #####################################
|
|
BLOCKSTORE_API_URL = "http://edx.devstack.blockstore:18250/api/v1/"
|
|
|
|
#####################################################################
|
|
|
|
# pylint: disable=wrong-import-order, wrong-import-position
|
|
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType
|
|
# pylint: disable=wrong-import-order, wrong-import-position
|
|
from edx_django_utils.plugins import add_plugins
|
|
|
|
add_plugins(__name__, ProjectType.CMS, SettingsType.DEVSTACK)
|
|
|
|
|
|
OPENAPI_CACHE_TIMEOUT = 0
|
|
|
|
#####################################################################
|
|
# Lastly, run any migrations, if needed.
|
|
MODULESTORE = convert_module_store_setting_if_needed(MODULESTORE)
|
|
|
|
# Dummy secret key for dev
|
|
SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'
|
|
|
|
###############################################################################
|
|
# See if the developer has any local overrides.
|
|
if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')):
|
|
from .private import * # pylint: disable=import-error,wildcard-import
|