diff --git a/CHANGELOG.md b/CHANGELOG.md index ac1e78e..c279514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,16 @@ Every user-facing change should have an entry in this changelog. Please respect ## Unreleased +## v14.0.0 (2022-06-09) + +- 💥[Feature] Upgrade to Nutmeg: (by @regisb) + - 💥[Feature] Hide a course from the `/course` search page in the LMS when the course visibility is set to "none" in the Studio. (thanks @ghassanmas!) + - 💥[Improvement] The `lms.env.json` and `cms.env.json` files are moved to `lms.env.yml` and `cms.env.yml`. As a consequence, plugin developers must reformat the following patches to use YAML format, and not JSON: "common-env-features", "lms-env-features", "cms-env-features", "lms-env", "cms-env", "openedx-auth". + - 💥[Feature] Persistent grades are now enabled by default. + - [Bugfix] Remove edX references from bulk emails ([issue](https://github.com/openedx/build-test-release-wg/issues/100)). + - [Improvement] For Tutor Nightly (and only Nightly), official plugins are now installed from their nightly branches on GitHub instead of a version range on PyPI. This will allow Nightly users to install all official plugins by running ``pip install -e ".[full]"``. + - [Bugfix] Start MongoDB when running migrations, because a new data migration fails if MongoDB is not running + ## v13.3.1 (2022-06-06) - [Fix] Crashing celery workers in development (#681). (by @regisb) diff --git a/docs/configuration.rst b/docs/configuration.rst index d803287..54e3677 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -8,7 +8,7 @@ Tutor offers plenty of possibilities for platform customisation out of the box. a. Modifying the Tutor :ref:`configuration parameters `. b. Modifying the :ref:`Open edX docker image ` that runs the Open edX platform. -This section does not cover :ref:`plugin development `. For simple changes, such as modifying the ``*.env.json`` files or the edx-platform settings, *you should not fork edx-platform or tutor*! Instead, you should create a simple :ref:`plugin for Tutor `. +This section does not cover :ref:`plugin development `. For simple changes, such as modifying the ``*.env.yml`` files or the edx-platform settings, *you should not fork edx-platform or tutor*! Instead, you should create a simple :ref:`plugin for Tutor `. .. _configuration: @@ -31,7 +31,7 @@ Or from the system environment:: export TUTOR_PARAM1=VALUE1 -Once the base configuration is created or updated, the environment is automatically re-generated. The environment is the set of all files required to manage an Open edX platform: Dockerfile, ``lms.env.json``, settings files, etc. You can view the environment files in the ``env`` folder:: +Once the base configuration is created or updated, the environment is automatically re-generated. The environment is the set of all files required to manage an Open edX platform: Dockerfile, ``lms.env.yml``, settings files, etc. You can view the environment files in the ``env`` folder:: ls "$(tutor config printroot)/env" @@ -83,7 +83,7 @@ Open edX customisation This defines the git repository from which you install Open edX platform code. If you run an Open edX fork with custom patches, set this to your own git repository. You may also override this configuration parameter at build time, by providing a ``--build-arg`` option. -- ``OPENEDX_COMMON_VERSION`` (default: ``"open-release/maple.3"``) +- ``OPENEDX_COMMON_VERSION`` (default: ``"open-release/nutmeg.1"``) This defines the default version that will be pulled from all Open edX git repositories. @@ -294,16 +294,16 @@ Note that your edx-platform version must be a fork of the latest release **tag** If you don't create your fork from this tag, you *will* have important compatibility issues with other services. In particular: -- Do not try to run a fork from an older (pre-Maple) version of edx-platform: this will simply not work. +- Do not try to run a fork from an older (pre-Nutmeg) version of edx-platform: this will simply not work. - Do not try to run a fork from the edx-platform master branch: there is a 99% probability that it will fail. -- Do not try to run a fork from the open-release/maple.master branch: Tutor will attempt to apply security and bug fix patches that might already be included in the open-release/maple.master but which were not yet applied to the latest release tag. Patch application will thus fail if you base your fork from the open-release/maple.master branch. +- Do not try to run a fork from the open-release/nutmeg.master branch: Tutor will attempt to apply security and bug fix patches that might already be included in the open-release/nutmeg.master but which were not yet applied to the latest release tag. Patch application will thus fail if you base your fork from the open-release/nutmeg.master branch. .. _i18n: Adding custom translations ~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you are not running Open edX in English, chances are that some strings will not be properly translated. In most cases, this is because not enough contributors have helped translate Open edX into your language. It happens! With Tutor, available translated languages include those that come bundled with `edx-platform `__ as well as those from `openedx-i18n `__. +If you are not running Open edX in English, chances are that some strings will not be properly translated. In most cases, this is because not enough contributors have helped translate Open edX into your language. It happens! With Tutor, available translated languages include those that come bundled with `edx-platform `__ as well as those from `openedx-i18n `__. Tutor offers a relatively simple mechanism to add custom translations to the openedx Docker image. You should create a folder that corresponds to your language code in the "build/openedx/locale" folder of the Tutor environment. This folder should contain a "LC_MESSAGES" folder. For instance:: @@ -324,9 +324,9 @@ Then, add a "django.po" file there that will contain your custom translations:: .. warning:: Don't forget to specify the file ``Content-Type`` when adding message strings with non-ASCII characters; otherwise a ``UnicodeDecodeError`` will be raised during compilation. -The "String to translate" part should match *exactly* the string that you would like to translate. You cannot make it up! The best way to find this string is to copy-paste it from the `upstream django.po file for the English language `__. +The "String to translate" part should match *exactly* the string that you would like to translate. You cannot make it up! The best way to find this string is to copy-paste it from the `upstream django.po file for the English language `__. -If you cannot find the string to translate in this file, then it means that you are trying to translate a string that is used in some piece of javascript code. Those strings are stored in a different file named "djangojs.po". You can check it out `in the edx-platform repo as well `__. Your custom javascript strings should also be stored in a "djangojs.po" file that should be placed in the same directory. +If you cannot find the string to translate in this file, then it means that you are trying to translate a string that is used in some piece of javascript code. Those strings are stored in a different file named "djangojs.po". You can check it out `in the edx-platform repo as well `__. Your custom javascript strings should also be stored in a "djangojs.po" file that should be placed in the same directory. To recap, here is an example. To translate a few strings in French, both from django.po and djangojs.po, we would have the following file hierarchy:: diff --git a/docs/dev.rst b/docs/dev.rst index e599933..d552589 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -92,7 +92,7 @@ The ``openedx-dev`` Docker image is based on the same ``openedx`` image used by - Additional Python and system requirements are installed for convenient debugging: `ipython `__, `ipdb `__, vim, telnet. -- The edx-platform `development requirements `__ are installed. +- The edx-platform `development requirements `__ are installed. If you are using a custom ``openedx`` image, then you will need to rebuild ``openedx-dev`` every time you modify ``openedx``. To so, run:: diff --git a/docs/faq.rst b/docs/faq.rst index ec5eb8a..cb6581d 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -38,7 +38,7 @@ The `devstack `_ is meant for development o Is Tutor officially supported by edX? ------------------------------------- -Yes: as of the Open edX Maple release (December 9th 2021), Tutor is the only officially supported installation method for Open edX: see the `official installation instructions `__. +Yes: as of the Open edX Maple release (December 9th 2021), Tutor is the only officially supported installation method for Open edX: see the `official installation instructions `__. What features are missing from Tutor? ------------------------------------- diff --git a/docs/install.rst b/docs/install.rst index 01253ff..b9f8aa9 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -121,11 +121,11 @@ Major Open edX releases are published twice a year, in June and December, by the 4. Test the new release in a sandboxed environment. 5. If you are running edx-platform, or some other repository from a custom branch, then you should rebase (and test) your changes on top of the latest release tag (see :ref:`edx_platform_fork`). -The process for upgrading from one major release to the next works similarly to any other upgrade, with the ``quickstart`` command (see above). The single difference is that if the ``quickstart`` command detects that your tutor environment was generated with an older release, it will perform a few release-specific upgrade steps. These extra upgrade steps will be performed just once. But they will be ignored if you updated your local environment (for instance: with ``tutor config save``) before running ``quickstart``. This situation typically occurs if you need to re-build some Docker images (see above). In such a case, you should make use of the ``upgrade`` command. For instance, to upgrade a local installation from Lilac to Maple and rebuild some Docker images, run:: +The process for upgrading from one major release to the next works similarly to any other upgrade, with the ``quickstart`` command (see above). The single difference is that if the ``quickstart`` command detects that your tutor environment was generated with an older release, it will perform a few release-specific upgrade steps. These extra upgrade steps will be performed just once. But they will be ignored if you updated your local environment (for instance: with ``tutor config save``) before running ``quickstart``. This situation typically occurs if you need to re-build some Docker images (see above). In such a case, you should make use of the ``upgrade`` command. For instance, to upgrade a local installation from Maple to Nutmeg and rebuild some Docker images, run:: tutor config save tutor images build all # list the images that should be rebuilt here - tutor local upgrade --from=lilac + tutor local upgrade --from=maple tutor local quickstart .. _autocomplete: diff --git a/docs/plugins/intro.rst b/docs/plugins/intro.rst index 0de2fdb..c848923 100644 --- a/docs/plugins/intro.rst +++ b/docs/plugins/intro.rst @@ -4,7 +4,7 @@ Introduction ============ -Tutor comes with a plugin system that allows anyone to customise the deployment of an Open edX platform very easily. The vision behind this plugin system is that users should not have to fork the Tutor repository to customise their deployments. For instance, if you have created a new application that integrates with Open edX, you should not have to describe how to manually patch the platform settings, ``urls.py`` or ``*.env.json`` files. Instead, you can create a "tutor-myapp" plugin for Tutor. Then, users will start using your application in three simple steps:: +Tutor comes with a plugin system that allows anyone to customise the deployment of an Open edX platform very easily. The vision behind this plugin system is that users should not have to fork the Tutor repository to customise their deployments. For instance, if you have created a new application that integrates with Open edX, you should not have to describe how to manually patch the platform settings, ``urls.py`` or ``*.env.yml`` files. Instead, you can create a "tutor-myapp" plugin for Tutor. Then, users will start using your application in three simple steps:: # 1) Install the plugin pip install tutor-myapp diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 1b3da4d..e321a29 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -22,7 +22,7 @@ Yes :) This is what happens when you run ``tutor local quickstart``: 2. Configuration files are generated from templates. 3. Docker images are downloaded. 4. Docker containers are provisioned. -5. A full, production-ready Open edX platform (`Maple `__ release) is run with docker-compose. +5. A full, production-ready Open edX platform (`Nutmeg `__ release) is run with docker-compose. The whole procedure should require less than 10 minutes, on a server with good bandwidth. Note that your host environment will not be affected in any way, since everything runs inside docker containers. Root access is not even necessary. diff --git a/docs/reference/patches.rst b/docs/reference/patches.rst index 3dc104a..9b76c5b 100644 --- a/docs/reference/patches.rst +++ b/docs/reference/patches.rst @@ -53,21 +53,21 @@ File: ``apps/caddy/Caddyfile`` ``cms-env`` =========== -File: ``apps/openedx/config/cms.env.json`` +File: ``apps/openedx/config/cms.env.yml`` .. patch:: cms-env-features ``cms-env-features`` ==================== -File: ``apps/openedx/config/cms.env.json`` +File: ``apps/openedx/config/cms.env.yml`` .. patch:: common-env-features ``common-env-features`` ======================= -Files: ``apps/openedx/config/cms.env.json``, ``apps/openedx/config/lms.env.json`` +Files: ``apps/openedx/config/cms.env.yml``, ``apps/openedx/config/lms.env.yml`` .. patch:: dev-docker-compose-jobs-services @@ -137,14 +137,14 @@ File: ``kustomization.yml`` ``lms-env`` =========== -File: ``apps/openedx/config/lms.env.json`` +File: ``apps/openedx/config/lms.env.yml`` .. patch:: lms-env-features ``lms-env-features`` ==================== -File: ``apps/openedx/config/lms.env.json`` +File: ``apps/openedx/config/lms.env.yml`` .. patch:: local-docker-compose-caddy-aliases @@ -200,7 +200,7 @@ File: ``local/docker-compose.yml`` ``openedx-auth`` ================ -File: ``apps/openedx/config/partials/auth.json`` +File: ``apps/openedx/config/partials/auth.yml`` .. patch:: openedx-cms-common-settings diff --git a/requirements/plugins.txt b/requirements/plugins.txt index 5107ef7..b7976ec 100644 --- a/requirements/plugins.txt +++ b/requirements/plugins.txt @@ -1,12 +1,12 @@ -# change version ranges when upgrading from maple -tutor-android>=13.0.0,<14.0.0 -tutor-discovery>=13.0.0,<14.0.0 -tutor-ecommerce>=13.0.0,<14.0.0 -tutor-forum>=13.0.0,<14.0.0 -tutor-license>=13.0.0,<14.0.0 -tutor-mfe>=13.0.0,<14.0.0 -tutor-minio>=13.0.0,<14.0.0 -tutor-notes>=13.0.0,<14.0.0 -tutor-richie>=13.0.0,<14.0.0 -tutor-webui>=13.0.0,<14.0.0 -tutor-xqueue>=13.0.0,<14.0.0 +# change version ranges when upgrading from nutmeg +tutor-android>=14.0.0,<15.0.0 +tutor-discovery>=14.0.0,<15.0.0 +tutor-ecommerce>=14.0.0,<15.0.0 +tutor-forum>=14.0.0,<15.0.0 +tutor-license>=14.0.0,<15.0.0 +tutor-mfe>=14.0.0,<15.0.0 +tutor-minio>=14.0.0,<15.0.0 +tutor-notes>=14.0.0,<15.0.0 +tutor-richie>=14.0.0,<15.0.0 +tutor-webui>=14.0.0,<15.0.0 +tutor-xqueue>=14.0.0,<15.0.0 diff --git a/tests/test_env.py b/tests/test_env.py index 44447be..f0de174 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -258,6 +258,6 @@ class CurrentVersionTests(unittest.TestCase): ) as f: f.write(__version__) self.assertEqual(__version__, env.current_version(root)) - self.assertEqual("maple", env.get_env_release(root)) + self.assertEqual("nutmeg", env.get_env_release(root)) self.assertIsNone(env.should_upgrade_from_release(root)) self.assertTrue(env.is_up_to_date(root)) diff --git a/tutor/__about__.py b/tutor/__about__.py index d210a12..36667fd 100644 --- a/tutor/__about__.py +++ b/tutor/__about__.py @@ -2,7 +2,7 @@ import os # Increment this version number to trigger a new release. See # docs/tutor.html#versioning for information on the versioning scheme. -__version__ = "13.3.1" +__version__ = "14.0.0" # The version suffix will be appended to the actual version, separated by a # dash. Use this suffix to differentiate between the actual released version and diff --git a/tutor/commands/k8s.py b/tutor/commands/k8s.py index 14d5e42..ea82ec8 100644 --- a/tutor/commands/k8s.py +++ b/tutor/commands/k8s.py @@ -468,7 +468,7 @@ def wait(context: K8sContext, name: str) -> None: @click.option( "--from", "from_release", - type=click.Choice(["ironwood", "juniper", "koa", "lilac"]), + type=click.Choice(["ironwood", "juniper", "koa", "lilac", "maple"]), ) @click.pass_context def upgrade(context: click.Context, from_release: Optional[str]) -> None: diff --git a/tutor/commands/local.py b/tutor/commands/local.py index 7e48175..57ec977 100644 --- a/tutor/commands/local.py +++ b/tutor/commands/local.py @@ -154,7 +154,7 @@ Your Open edX platform is ready and can be accessed at the following urls: @click.option( "--from", "from_release", - type=click.Choice(["ironwood", "juniper", "koa", "lilac"]), + type=click.Choice(["ironwood", "juniper", "koa", "lilac", "maple"]), ) @click.pass_context def upgrade(context: click.Context, from_release: t.Optional[str]) -> None: diff --git a/tutor/commands/upgrade/k8s.py b/tutor/commands/upgrade/k8s.py index 86143b4..60ebe6e 100644 --- a/tutor/commands/upgrade/k8s.py +++ b/tutor/commands/upgrade/k8s.py @@ -1,4 +1,5 @@ from tutor import config as tutor_config +from tutor import env as tutor_env from tutor import fmt from tutor.commands import k8s from tutor.commands.context import Context @@ -27,6 +28,10 @@ def upgrade_from(context: Context, from_release: str) -> None: upgrade_from_lilac(config) running_release = "maple" + if running_release == "maple": + upgrade_from_maple(context, config) + running_release = "nutmeg" + def upgrade_from_ironwood(config: Config) -> None: if not config["RUN_MONGODB"]: @@ -102,3 +107,42 @@ def upgrade_from_lilac(config: Config) -> None: "upgrade from Lilac to Maple" ) k8s.delete_resources(config, resources=["deployments", "services"]) + + +def upgrade_from_maple(context: Context, config: Config) -> None: + fmt.echo_info("Upgrading from Maple") + # The environment needs to be updated because the backpopulate/backfill commands are from Nutmeg + tutor_env.save(context.root, config) + + # Start mysql + k8s.kubectl_apply( + context.root, + "--selector", + "app.kubernetes.io/name=mysql", + ) + k8s.wait_for_pod_ready(config, "mysql") + + # lms upgrade + k8s.kubectl_apply( + context.root, + "--selector", + "app.kubernetes.io/name=lms", + ) + k8s.wait_for_pod_ready(config, "lms") + k8s.kubectl_exec( + config, "lms", ["sh", "-e", "-c", "./manage.py lms backpopulate_user_tours"] + ) + + # cms upgrade + k8s.kubectl_apply( + context.root, + "--selector", + "app.kubernetes.io/name=cms", + ) + k8s.wait_for_pod_ready(config, "cms") + k8s.kubectl_exec( + config, "cms", ["sh", "-e", "-c", "./manage.py cms backfill_course_tabs"] + ) + k8s.kubectl_exec( + config, "cms", ["sh", "-e", "-c", "./manage.py cms simulate_publish"] + ) diff --git a/tutor/commands/upgrade/local.py b/tutor/commands/upgrade/local.py index 98fe7ca..1fecbc3 100644 --- a/tutor/commands/upgrade/local.py +++ b/tutor/commands/upgrade/local.py @@ -31,6 +31,10 @@ def upgrade_from(context: click.Context, from_release: str) -> None: common_upgrade.upgrade_from_lilac(config) running_release = "maple" + if running_release == "maple": + upgrade_from_maple(context, config) + running_release = "nutmeg" + def upgrade_from_ironwood(context: click.Context, config: Config) -> None: click.echo(fmt.title("Upgrading from Ironwood")) @@ -95,6 +99,24 @@ def upgrade_from_koa(context: click.Context, config: Config) -> None: upgrade_mongodb(context, config, "4.0.25", "4.0") +def upgrade_from_maple(context: click.Context, config: Config) -> None: + click.echo(fmt.title("Upgrading from Maple")) + # The environment needs to be updated because the management commands are from Nutmeg + tutor_env.save(context.obj.root, config) + context.invoke( + compose.run, + args=["lms", "sh", "-e", "-c", "./manage.py lms backpopulate_user_tours"], + ) + context.invoke( + compose.run, + args=["cms", "sh", "-e", "-c", "./manage.py cms backfill_course_tabs"], + ) + context.invoke( + compose.run, + args=["cms", "sh", "-e", "-c", "./manage.py cms simulate_publish"], + ) + + def upgrade_mongodb( context: click.Context, config: Config, diff --git a/tutor/env.py b/tutor/env.py index bd0636c..5d74368 100644 --- a/tutor/env.py +++ b/tutor/env.py @@ -388,6 +388,7 @@ def get_release(version: str) -> str: "11": "koa", "12": "lilac", "13": "maple", + "14": "nutmeg", }[version.split(".", maxsplit=1)[0]] diff --git a/tutor/templates/apps/openedx/config/cms.env.json b/tutor/templates/apps/openedx/config/cms.env.json deleted file mode 100644 index 68aca49..0000000 --- a/tutor/templates/apps/openedx/config/cms.env.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "SITE_NAME": "{{ CMS_HOST }}", - "BOOK_URL": "", - "LOG_DIR": "/openedx/data/logs", - "LOGGING_ENV": "sandbox", - "OAUTH_OIDC_ISSUER": "{{ JWT_COMMON_ISSUER }}", - "PLATFORM_NAME": "{{ PLATFORM_NAME }}", - "FEATURES": { - {{ patch("common-env-features", separator=",\n", suffix=",")|indent(4) }} - {{ patch("cms-env-features", separator=",\n", suffix=",")|indent(4) }} - "CERTIFICATES_HTML_VIEW": true, - "PREVIEW_LMS_BASE": "{{ PREVIEW_LMS_HOST }}", - "ENABLE_COURSEWARE_INDEX": true, - "ENABLE_CSMH_EXTENDED": false, - "ENABLE_LEARNER_RECORDS": false, - "ENABLE_LIBRARY_INDEX": true, - "MILESTONES_APP": true, - "ENABLE_PREREQUISITE_COURSES": true - }, - "LMS_ROOT_URL": "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}", - "CMS_ROOT_URL": "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}", - "CMS_BASE": "{{ CMS_HOST }}", - "LMS_BASE": "{{ LMS_HOST }}", - "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", - "CELERY_BROKER_TRANSPORT": "redis", - "CELERY_BROKER_HOSTNAME": "{{ REDIS_HOST }}:{{ REDIS_PORT }}", - "CELERY_BROKER_VHOST": "{{ OPENEDX_CELERY_REDIS_DB }}", - "CELERY_BROKER_USER": "{{ REDIS_USERNAME }}", - "CELERY_BROKER_PASSWORD": "{{ REDIS_PASSWORD }}", - "ALTERNATE_WORKER_QUEUES": "lms", - "ENABLE_COMPREHENSIVE_THEMING": true, - "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], - "STATIC_ROOT_BASE": "/openedx/staticfiles", - "EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend", - "EMAIL_HOST": "{{ SMTP_HOST }}", - "EMAIL_PORT": {{ SMTP_PORT }}, - "EMAIL_USE_TLS": {{ "true" if SMTP_USE_TLS else "false" }}, - "HTTPS": "{{ "on" if ENABLE_HTTPS else "off" }}", - "LANGUAGE_CODE": "{{ LANGUAGE_CODE }}", - "SESSION_COOKIE_DOMAIN": "{{ CMS_HOST }}", - {{ patch("cms-env", separator=",\n", suffix=",")|indent(2) }} - "CACHES": { - "default": { - "KEY_PREFIX": "default", - "VERSION": "1", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "general": { - "KEY_PREFIX": "general", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "mongo_metadata_inheritance": { - "KEY_PREFIX": "mongo_metadata_inheritance", - "TIMEOUT": 300, - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "staticfiles": { - "KEY_PREFIX": "staticfiles_cms", - "BACKEND": "django.core.cache.backends.locmem.LocMemCache", - "LOCATION": "staticfiles_cms" - }, - "configuration": { - "KEY_PREFIX": "configuration", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "celery": { - "KEY_PREFIX": "celery", - "TIMEOUT": "7200", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "course_structure_cache": { - "KEY_PREFIX": "course_structure", - "TIMEOUT": "7200", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - } - }, -{% include "apps/openedx/config/partials/auth.json" %} -} diff --git a/tutor/templates/apps/openedx/config/cms.env.yml b/tutor/templates/apps/openedx/config/cms.env.yml new file mode 100644 index 0000000..58a4ca1 --- /dev/null +++ b/tutor/templates/apps/openedx/config/cms.env.yml @@ -0,0 +1,73 @@ +SITE_NAME: "{{ CMS_HOST }}" +BOOK_URL: "" +LOG_DIR: "/openedx/data/logs" +LOGGING_ENV: "sandbox" +OAUTH_OIDC_ISSUER: "{{ JWT_COMMON_ISSUER }}" +PLATFORM_NAME: "{{ PLATFORM_NAME }}" +FEATURES: + {{ patch("common-env-features") }} + {{ patch("cms-env-features") }} + CERTIFICATES_HTML_VIEW: true + PREVIEW_LMS_BASE: "{{ PREVIEW_LMS_HOST }}" + ENABLE_COURSEWARE_INDEX: true + ENABLE_CSMH_EXTENDED: false + ENABLE_LEARNER_RECORDS: false + ENABLE_LIBRARY_INDEX: true + MILESTONES_APP: true + ENABLE_PREREQUISITE_COURSES: true +LMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}" +CMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}" +CMS_BASE: "{{ CMS_HOST }}" +LMS_BASE: "{{ LMS_HOST }}" +CONTACT_EMAIL: "{{ CONTACT_EMAIL }}" +CELERY_BROKER_TRANSPORT: "redis" +CELERY_BROKER_HOSTNAME: "{{ REDIS_HOST }}:{{ REDIS_PORT }}" +CELERY_BROKER_VHOST: "{{ OPENEDX_CELERY_REDIS_DB }}" +CELERY_BROKER_USER: "{{ REDIS_USERNAME }}" +CELERY_BROKER_PASSWORD: "{{ REDIS_PASSWORD }}" +ALTERNATE_WORKER_QUEUES: "lms" +ENABLE_COMPREHENSIVE_THEMING: true +COMPREHENSIVE_THEME_DIRS: ["/openedx/themes"] +STATIC_ROOT_BASE: "/openedx/staticfiles" +EMAIL_BACKEND: "django.core.mail.backends.smtp.EmailBackend" +EMAIL_HOST: "{{ SMTP_HOST }}" +EMAIL_PORT: {{ SMTP_PORT }}, +EMAIL_USE_TLS: {{ "true" if SMTP_USE_TLS else "false" }} +HTTPS: "{{ "on" if ENABLE_HTTPS else "off" }}" +LANGUAGE_CODE: "{{ LANGUAGE_CODE }}" +SESSION_COOKIE_DOMAIN: "{{ CMS_HOST }}" +{{ patch("cms-env") }} +CACHES: + default: + KEY_PREFIX: "default" + VERSION: "1" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + general: + KEY_PREFIX: "general" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + mongo_metadata_inheritance: + KEY_PREFIX: "mongo_metadata_inheritance" + TIMEOUT: 300, + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + staticfiles: + KEY_PREFIX: "staticfiles_cms" + BACKEND: "django.core.cache.backends.locmem.LocMemCache" + LOCATION: "staticfiles_cms" + configuration: + KEY_PREFIX: "configuration" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + celery: + KEY_PREFIX: "celery" + TIMEOUT: "7200" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + course_structure_cache: + KEY_PREFIX: "course_structure" + TIMEOUT: "7200" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" +{% include "apps/openedx/config/partials/auth.yml" %} diff --git a/tutor/templates/apps/openedx/config/lms.env.json b/tutor/templates/apps/openedx/config/lms.env.json deleted file mode 100644 index b3188f9..0000000 --- a/tutor/templates/apps/openedx/config/lms.env.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "SITE_NAME": "{{ LMS_HOST }}", - "BOOK_URL": "", - "LOG_DIR": "/openedx/data/logs", - "LOGGING_ENV": "sandbox", - "OAUTH_OIDC_ISSUER": "{{ JWT_COMMON_ISSUER }}", - "PLATFORM_NAME": "{{ PLATFORM_NAME }}", - "FEATURES": { - {{ patch("common-env-features", separator=",\n", suffix=",")|indent(4) }} - {{ patch("lms-env-features", separator=",\n", suffix=",")|indent(4) }} - "CERTIFICATES_HTML_VIEW": true, - "PREVIEW_LMS_BASE": "{{ PREVIEW_LMS_HOST }}", - "ENABLE_CORS_HEADERS": true, - "ENABLE_COURSE_DISCOVERY": true, - "ENABLE_COURSEWARE_SEARCH": true, - "ENABLE_CSMH_EXTENDED": false, - "ENABLE_DASHBOARD_SEARCH": true, - "ENABLE_COMBINED_LOGIN_REGISTRATION": true, - "ENABLE_GRADE_DOWNLOADS": true, - "ENABLE_LEARNER_RECORDS": false, - "ENABLE_MOBILE_REST_API": true, - "ENABLE_OAUTH2_PROVIDER": true, - "ENABLE_THIRD_PARTY_AUTH": true, - "MILESTONES_APP": true, - "ENABLE_PREREQUISITE_COURSES": true - }, - "LMS_ROOT_URL": "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}", - "CMS_ROOT_URL": "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}", - "CMS_BASE": "{{ CMS_HOST }}", - "LMS_BASE": "{{ LMS_HOST }}", - "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", - "CELERY_BROKER_TRANSPORT": "redis", - "CELERY_BROKER_HOSTNAME": "{{ REDIS_HOST }}:{{ REDIS_PORT }}", - "CELERY_BROKER_VHOST": "{{ OPENEDX_CELERY_REDIS_DB }}", - "CELERY_BROKER_USER": "{{ REDIS_USERNAME }}", - "CELERY_BROKER_PASSWORD": "{{ REDIS_PASSWORD }}", - "ALTERNATE_WORKER_QUEUES": "cms", - "ENABLE_COMPREHENSIVE_THEMING": true, - "COMPREHENSIVE_THEME_DIRS": ["/openedx/themes"], - "STATIC_ROOT_BASE": "/openedx/staticfiles", - "EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend", - "EMAIL_HOST": "{{ SMTP_HOST }}", - "EMAIL_PORT": {{ SMTP_PORT }}, - "EMAIL_USE_TLS": {{ "true" if SMTP_USE_TLS else "false" }}, - "ACE_ROUTING_KEY": "edx.lms.core.default", - "HTTPS": "{{ "on" if ENABLE_HTTPS else "off" }}", - "LANGUAGE_CODE": "{{ LANGUAGE_CODE }}", - "SESSION_COOKIE_DOMAIN": "{{ LMS_HOST }}", - {{ patch("lms-env", separator=",\n", suffix=",")|indent(2) }} - "CACHES": { - "default": { - "KEY_PREFIX": "default", - "VERSION": "1", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "general": { - "KEY_PREFIX": "general", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "mongo_metadata_inheritance": { - "KEY_PREFIX": "mongo_metadata_inheritance", - "TIMEOUT": 300, - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "staticfiles": { - "KEY_PREFIX": "staticfiles_lms", - "BACKEND": "django.core.cache.backends.locmem.LocMemCache", - "LOCATION": "staticfiles_lms" - }, - "configuration": { - "KEY_PREFIX": "configuration", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "celery": { - "KEY_PREFIX": "celery", - "TIMEOUT": "7200", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "course_structure_cache": { - "KEY_PREFIX": "course_structure", - "TIMEOUT": "7200", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - }, - "ora2-storage": { - "KEY_PREFIX": "ora2-storage", - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - } - }, -{% include "apps/openedx/config/partials/auth.json" %} -} diff --git a/tutor/templates/apps/openedx/config/lms.env.yml b/tutor/templates/apps/openedx/config/lms.env.yml new file mode 100644 index 0000000..53d320e --- /dev/null +++ b/tutor/templates/apps/openedx/config/lms.env.yml @@ -0,0 +1,86 @@ +SITE_NAME: "{{ LMS_HOST }}" +BOOK_URL: "" +LOG_DIR: "/openedx/data/logs" +LOGGING_ENV: "sandbox" +OAUTH_OIDC_ISSUER: "{{ JWT_COMMON_ISSUER }}" +PLATFORM_NAME: "{{ PLATFORM_NAME }}" +FEATURES: + {{ patch("common-env-features")|indent(2) }} + {{ patch("lms-env-features")|indent(2) }} + CERTIFICATES_HTML_VIEW: true + PREVIEW_LMS_BASE: "{{ PREVIEW_LMS_HOST }}" + ENABLE_CORS_HEADERS: true + ENABLE_COURSE_DISCOVERY: true + ENABLE_COURSEWARE_SEARCH: true + ENABLE_CSMH_EXTENDED: false + ENABLE_DASHBOARD_SEARCH: true + ENABLE_COMBINED_LOGIN_REGISTRATION: true + ENABLE_GRADE_DOWNLOADS: true + ENABLE_LEARNER_RECORDS: false + ENABLE_MOBILE_REST_API: true + ENABLE_OAUTH2_PROVIDER: true + ENABLE_PREREQUISITE_COURSES: true + ENABLE_THIRD_PARTY_AUTH: true + MILESTONES_APP: true + PERSISTENT_GRADES_ENABLED_FOR_ALL_TESTS: true +LMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}" +CMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}" +CMS_BASE: "{{ CMS_HOST }}" +LMS_BASE: "{{ LMS_HOST }}" +CONTACT_EMAIL: "{{ CONTACT_EMAIL }}" +CELERY_BROKER_TRANSPORT: "redis" +CELERY_BROKER_HOSTNAME: "{{ REDIS_HOST }}:{{ REDIS_PORT }}" +CELERY_BROKER_VHOST: "{{ OPENEDX_CELERY_REDIS_DB }}" +CELERY_BROKER_USER: "{{ REDIS_USERNAME }}" +CELERY_BROKER_PASSWORD: "{{ REDIS_PASSWORD }}" +ALTERNATE_WORKER_QUEUES: "cms" +ENABLE_COMPREHENSIVE_THEMING: true +COMPREHENSIVE_THEME_DIRS: ["/openedx/themes"] +STATIC_ROOT_BASE: "/openedx/staticfiles" +EMAIL_BACKEND: "django.core.mail.backends.smtp.EmailBackend" +EMAIL_HOST: "{{ SMTP_HOST }}" +EMAIL_PORT: {{ SMTP_PORT }} +EMAIL_USE_TLS: {{ "true" if SMTP_USE_TLS else "false" }} +ACE_ROUTING_KEY: "edx.lms.core.default" +HTTPS: "{{ "on" if ENABLE_HTTPS else "off" }}" +LANGUAGE_CODE: "{{ LANGUAGE_CODE }}" +SESSION_COOKIE_DOMAIN: "{{ LMS_HOST }}" +{{ patch("lms-env") }} +CACHES: + default: + KEY_PREFIX: "default" + VERSION: "1" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + general: + KEY_PREFIX: "general" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + mongo_metadata_inheritance: + KEY_PREFIX: "mongo_metadata_inheritance" + TIMEOUT: 300 + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + staticfiles: + KEY_PREFIX: "staticfiles_lms" + BACKEND: "django.core.cache.backends.locmem.LocMemCache" + LOCATION: "staticfiles_lms" + configuration: + KEY_PREFIX: "configuration" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + celery: + KEY_PREFIX: "celery" + TIMEOUT: "7200" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + course_structure_cache: + KEY_PREFIX: "course_structure" + TIMEOUT: "7200" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" + ora2-storage: + KEY_PREFIX: "ora2-storage" + BACKEND: "django_redis.cache.RedisCache" + LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" +{% include "apps/openedx/config/partials/auth.yml" %} diff --git a/tutor/templates/apps/openedx/config/partials/auth.json b/tutor/templates/apps/openedx/config/partials/auth.json deleted file mode 100644 index 66e9422..0000000 --- a/tutor/templates/apps/openedx/config/partials/auth.json +++ /dev/null @@ -1,26 +0,0 @@ - "SECRET_KEY": "{{ OPENEDX_SECRET_KEY }}", - "AWS_ACCESS_KEY_ID": "{{ OPENEDX_AWS_ACCESS_KEY }}", - "AWS_SECRET_ACCESS_KEY": "{{ OPENEDX_AWS_SECRET_ACCESS_KEY }}", - "CONTENTSTORE": null, - "DOC_STORE_CONFIG": null, - {{ patch("openedx-auth", separator=",\n", suffix=",")|indent(2) }} - "XQUEUE_INTERFACE": { - "django_auth": null, - "url": null - }, - "DATABASES": { - "default": { - "ENGINE": "django.db.backends.mysql", - "HOST": "{{ MYSQL_HOST }}", - "PORT": {{ MYSQL_PORT }}, - "NAME": "{{ OPENEDX_MYSQL_DATABASE }}", - "USER": "{{ OPENEDX_MYSQL_USERNAME }}", - "PASSWORD": "{{ OPENEDX_MYSQL_PASSWORD }}", - "ATOMIC_REQUESTS": true, - "OPTIONS": { - "init_command": "SET sql_mode='STRICT_TRANS_TABLES'" - } - } - }, - "EMAIL_HOST_USER": "{{ SMTP_USERNAME }}", - "EMAIL_HOST_PASSWORD": "{{ SMTP_PASSWORD }}" \ No newline at end of file diff --git a/tutor/templates/apps/openedx/config/partials/auth.yml b/tutor/templates/apps/openedx/config/partials/auth.yml new file mode 100644 index 0000000..2ec6448 --- /dev/null +++ b/tutor/templates/apps/openedx/config/partials/auth.yml @@ -0,0 +1,22 @@ +SECRET_KEY: "{{ OPENEDX_SECRET_KEY }}" +AWS_ACCESS_KEY_ID: "{{ OPENEDX_AWS_ACCESS_KEY }}" +AWS_SECRET_ACCESS_KEY: "{{ OPENEDX_AWS_SECRET_ACCESS_KEY }}" +CONTENTSTORE: null +DOC_STORE_CONFIG: null +{{ patch("openedx-auth") }} +XQUEUE_INTERFACE: + django_auth: null + url: null +DATABASES: + default: + ENGINE: "django.db.backends.mysql" + HOST: "{{ MYSQL_HOST }}" + PORT: {{ MYSQL_PORT }} + NAME: "{{ OPENEDX_MYSQL_DATABASE }}" + USER: "{{ OPENEDX_MYSQL_USERNAME }}" + PASSWORD: "{{ OPENEDX_MYSQL_PASSWORD }}" + ATOMIC_REQUESTS: true + OPTIONS: + init_command: "SET sql_mode='STRICT_TRANS_TABLES'" +EMAIL_HOST_USER: "{{ SMTP_USERNAME }}" +EMAIL_HOST_PASSWORD: "{{ SMTP_PASSWORD }}" diff --git a/tutor/templates/apps/openedx/settings/partials/common_lms.py b/tutor/templates/apps/openedx/settings/partials/common_lms.py index 2398a7e..522d6f1 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_lms.py +++ b/tutor/templates/apps/openedx/settings/partials/common_lms.py @@ -20,6 +20,10 @@ OAUTH_ENFORCE_SECURE = False # Email settings DEFAULT_EMAIL_LOGO_URL = LMS_ROOT_URL + "/theming/asset/images/logo.png" +BULK_EMAIL_SEND_USING_EDX_ACE = True + +# Make it possible to hide courses by default from the studio +SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING = False # Create folders if necessary for folder in [DATA_DIR, LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE, ORA2_FILEUPLOAD_ROOT]: diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 906ca70..d3db281 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -47,18 +47,9 @@ RUN git config --global user.email "tutor@overhang.io" \ {{ patch("openedx-dockerfile-git-patches-default") }} {%- else %} # Patch edx-platform -# Fix forum notification for questions -# https://github.com/openedx/edx-platform/pull/29611 -RUN git fetch --depth=2 https://github.com/open-craft/edx-platform/ 03731f19459e558f188c06aac5cc9ca1bbc675c2 && git cherry-pick 03731f19459e558f188c06aac5cc9ca1bbc675c2 -# SAML security fix -# https://github.com/overhangio/edx-platform/tree/overhangio/sec-fix-saml-vulnerability -RUN git fetch --depth=2 https://github.com/overhangio/edx-platform/ 3b985f207853e88090d68a81acd52866b71f5af7 && git cherry-pick 3b985f207853e88090d68a81acd52866b71f5af7 -# Rate limiting security fix -# https://github.com/overhangio/edx-platform/tree/overhangio/sec-rate-limiting -RUN git fetch --depth=2 https://github.com/overhangio/edx-platform/ b5723e416e628cac4fa84392ca13e1b72817674f && git cherry-pick b5723e416e628cac4fa84392ca13e1b72817674f -# Logout redirect security fix -# https://github.com/overhangio/edx-platform/tree/overhangio/sec-fix-logout-redirect-vulnerability -RUN git fetch --depth=2 https://github.com/overhangio/edx-platform/ 08d8504224e3a3e728a0f264749e1b585e21b871 && git cherry-pick 08d8504224e3a3e728a0f264749e1b585e21b871 +# Fix broken "Pages" view in Studio +# https://github.com/openedx/edx-platform/pull/30550 +RUN git fetch --depth=2 https://github.com/open-craft/edx-platform/ 3d54f284f82b61e693ad652d8d6e46a226fcb36d && git cherry-pick 3d54f284f82b61e693ad652d8d6e46a226fcb36d {%- endif %} {# Example: RUN git fetch --depth=2 https://github.com/openedx/edx-platform && git cherry-pick #} @@ -66,7 +57,11 @@ RUN git fetch --depth=2 https://github.com/overhangio/edx-platform/ 08d8504224e3 ###### Download extra locales to /openedx/locale/contrib/locale FROM minimal as locales -ARG OPENEDX_I18N_VERSION={{ OPENEDX_COMMON_VERSION }} +# TODO Due to a bug in the transifex generation process, we cannot pull the translation +# strings from nutmeg.1. We'll be able to pull them once they have been pushed to +# Transifex. +# ARG OPENEDX_I18N_VERSION={{ OPENEDX_COMMON_VERSION }} +ARG OPENEDX_I18N_VERSION=open-release/nutmeg.master RUN cd /tmp \ && curl -L -o openedx-i18n.tar.gz https://github.com/openedx/openedx-i18n/archive/$OPENEDX_I18N_VERSION.tar.gz \ && tar xzf /tmp/openedx-i18n.tar.gz \ @@ -88,15 +83,20 @@ COPY --from=code /openedx/edx-platform /openedx/edx-platform WORKDIR /openedx/edx-platform # Install the right version of pip/setuptools -RUN pip install setuptools==44.1.0 pip==20.0.2 wheel==0.34.2 +# https://pypi.org/project/setuptools/ +# https://pypi.org/project/pip/ +# https://pypi.org/project/wheel/ +RUN pip install setuptools==62.1.0 pip==22.0.4 wheel==0.37.1 # Install base requirements RUN pip install -r ./requirements/edx/base.txt # Install django-redis for using redis as a django cache -RUN pip install django-redis==4.12.1 +# https://pypi.org/project/django-redis/ +RUN pip install django-redis==5.2.0 # Install uwsgi +# https://pypi.org/project/uWSGI/ RUN pip install uwsgi==2.0.20 {{ patch("openedx-dockerfile-post-python-requirements") }} @@ -154,12 +154,12 @@ WORKDIR /openedx/edx-platform # Re-install local requirements, otherwise egg-info folders are missing RUN pip install -r requirements/edx/local.in -# Create folder that will store lms/cms.env.json files, as well as +# Create folder that will store lms/cms.env.yml files, as well as # the tutor-specific settings files. RUN mkdir -p /openedx/config ./lms/envs/tutor ./cms/envs/tutor COPY --chown=app:app revisions.yml /openedx/config/ -ENV LMS_CFG /openedx/config/lms.env.json -ENV STUDIO_CFG /openedx/config/cms.env.json +ENV LMS_CFG /openedx/config/lms.env.yml +ENV CMS_CFG /openedx/config/cms.env.yml ENV REVISION_CFG /openedx/config/revisions.yml COPY --chown=app:app settings/lms/*.py ./lms/envs/tutor/ COPY --chown=app:app settings/cms/*.py ./cms/envs/tutor/ diff --git a/tutor/templates/build/openedx/revisions.yml b/tutor/templates/build/openedx/revisions.yml index c76e09e..d75f161 100644 --- a/tutor/templates/build/openedx/revisions.yml +++ b/tutor/templates/build/openedx/revisions.yml @@ -1 +1 @@ -EDX_PLATFORM_REVISION: maple +EDX_PLATFORM_REVISION: nutmeg diff --git a/tutor/templates/config/defaults.yml b/tutor/templates/config/defaults.yml index 1628333..359d71b 100644 --- a/tutor/templates/config/defaults.yml +++ b/tutor/templates/config/defaults.yml @@ -48,7 +48,7 @@ OPENEDX_LMS_UWSGI_WORKERS: 2 OPENEDX_MYSQL_DATABASE: "openedx" OPENEDX_CSMH_MYSQL_DATABASE: "{{ OPENEDX_MYSQL_DATABASE }}_csmh" OPENEDX_MYSQL_USERNAME: "openedx" -OPENEDX_COMMON_VERSION: "open-release/maple.3" +OPENEDX_COMMON_VERSION: "open-release/nutmeg.1" OPENEDX_EXTRA_PIP_REQUIREMENTS: - "openedx-scorm-xblock<14.0.0,>=13.0.0" MYSQL_HOST: "mysql" diff --git a/tutor/templates/dev/docker-compose.yml b/tutor/templates/dev/docker-compose.yml index 00b048d..12e717a 100644 --- a/tutor/templates/dev/docker-compose.yml +++ b/tutor/templates/dev/docker-compose.yml @@ -49,13 +49,9 @@ services: lms-worker: <<: *openedx-service - # Note: we should get rid of this once celery is upgraded to 5.0.0+ after maple - # (same below in cms-worker) - tty: false cms-worker: <<: *openedx-service - tty: false # Additional service for watching theme changes watchthemes: diff --git a/tutor/templates/hooks/lms/init b/tutor/templates/hooks/lms/init index fa05a50..0276cd8 100644 --- a/tutor/templates/hooks/lms/init +++ b/tutor/templates/hooks/lms/init @@ -1,4 +1,5 @@ dockerize -wait tcp://{{ MYSQL_HOST }}:{{ MYSQL_PORT }} -timeout 20s +dockerize -wait tcp://{{ MONGODB_HOST }}:{{ MONGODB_PORT }} -timeout 20s echo "Loading settings $DJANGO_SETTINGS_MODULE" diff --git a/tutor/templates/k8s/deployments.yml b/tutor/templates/k8s/deployments.yml index 6f8098c..57e0fc8 100644 --- a/tutor/templates/k8s/deployments.yml +++ b/tutor/templates/k8s/deployments.yml @@ -131,7 +131,7 @@ spec: containers: - name: cms-worker image: {{ DOCKER_IMAGE_OPENEDX }} - args: ["celery", "worker", "--app=cms.celery", "--loglevel=info", "--hostname=edx.cms.core.default.%%h", "--maxtasksperchild", "100", "--exclude-queues=edx.lms.core.default"] + args: ["celery", "--app=cms.celery", "worker", "--loglevel=info", "--hostname=edx.cms.core.default.%%h", "--max-tasks-per-child", "100", "--exclude-queues=edx.lms.core.default"] env: - name: SERVICE_VARIANT value: cms @@ -231,7 +231,7 @@ spec: containers: - name: lms-worker image: {{ DOCKER_IMAGE_OPENEDX }} - args: ["celery", "worker", "--app=lms.celery", "--loglevel=info", "--hostname=edx.lms.core.default.%%h", "--maxtasksperchild=100", "--exclude-queues=edx.cms.core.default"] + args: ["celery", "--app=lms.celery", "worker", "--loglevel=info", "--hostname=edx.lms.core.default.%%h", "--max-tasks-per-child=100", "--exclude-queues=edx.cms.core.default"] env: - name: SERVICE_VARIANT value: lms diff --git a/tutor/templates/local/docker-compose.jobs.yml b/tutor/templates/local/docker-compose.jobs.yml index ed7f967..8b87f9f 100644 --- a/tutor/templates/local/docker-compose.jobs.yml +++ b/tutor/templates/local/docker-compose.jobs.yml @@ -14,7 +14,7 @@ services: - ../apps/openedx/settings/lms:/openedx/edx-platform/lms/envs/tutor:ro - ../apps/openedx/settings/cms:/openedx/edx-platform/cms/envs/tutor:ro - ../apps/openedx/config:/openedx/config:ro - depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }} + depends_on: {{ [("mysql", RUN_MYSQL), ("mongodb", RUN_MONGODB)]|list_if }} cms-job: image: {{ DOCKER_IMAGE_OPENEDX }} diff --git a/tutor/templates/local/docker-compose.yml b/tutor/templates/local/docker-compose.yml index 940d41f..c2834c2 100644 --- a/tutor/templates/local/docker-compose.yml +++ b/tutor/templates/local/docker-compose.yml @@ -170,7 +170,7 @@ services: environment: SERVICE_VARIANT: lms DJANGO_SETTINGS_MODULE: lms.envs.tutor.production - command: celery worker --app=lms.celery --loglevel=info --hostname=edx.lms.core.default.%%h --maxtasksperchild=100 --exclude-queues=edx.cms.core.default + command: celery --app=lms.celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --max-tasks-per-child=100 --exclude-queues=edx.cms.core.default restart: unless-stopped volumes: - ../apps/openedx/settings/lms:/openedx/edx-platform/lms/envs/tutor:ro @@ -188,7 +188,7 @@ services: environment: SERVICE_VARIANT: cms DJANGO_SETTINGS_MODULE: cms.envs.tutor.production - command: celery worker --app=cms.celery --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.lms.core.default + command: celery --app=cms.celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --max-tasks-per-child 100 --exclude-queues=edx.lms.core.default restart: unless-stopped volumes: - ../apps/openedx/settings/lms:/openedx/edx-platform/lms/envs/tutor:ro