diff --git a/changelog.d/20250521_185646_danyal.faheem_remove_preview.md b/changelog.d/20250521_185646_danyal.faheem_remove_preview.md new file mode 100644 index 0000000000..786ba5b1fc --- /dev/null +++ b/changelog.d/20250521_185646_danyal.faheem_remove_preview.md @@ -0,0 +1 @@ +- 💥[Deprecation] Remove preview page configuration as the page has been migrated to the learning MFE. (by @Danyal-Faheem) \ No newline at end of file diff --git a/docs/configuration.rst b/docs/configuration.rst index b2593069a4..d0e8650be2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -292,7 +292,6 @@ When ``ENABLE_HTTPS`` is ``true``, the whole Open edX platform will be reconfigu The following DNS records must exist and point to your server:: LMS_HOST (e.g: myopenedx.com) - PREVIEW_LMS_HOST (e.g: preview.myopenedx.com) CMS_HOST (e.g: studio.myopenedx.com) Thus, **this feature will (probably) not work in development** because the DNS records will (probably) not point to your development machine. diff --git a/docs/tutorials/proxy.rst b/docs/tutorials/proxy.rst index 94e961f0f7..a4581299b5 100644 --- a/docs/tutorials/proxy.rst +++ b/docs/tutorials/proxy.rst @@ -20,7 +20,7 @@ With these changes, Tutor will no longer listen to ports 80 and 443 on the host. It is then your responsibility to configure the web proxy on the host. There are too many use cases and proxy vendors, so Tutor does not provide configuration files that will work for everyone. You should configure your web proxy to: -- Capture traffic for the following hostnames: LMS_HOST, PREVIEW_LMS_HOST, CMS_HOST, as well as any additional host exposed by your plugins (MFE_HOST, CREDENTIALS_HOST, etc.). See each plugin documentation for more information. +- Capture traffic for the following hostnames: LMS_HOST, CMS_HOST, as well as any additional host exposed by your plugins (MFE_HOST, CREDENTIALS_HOST, etc.). See each plugin documentation for more information. - If SSL/TLS is enabled: - Perform SSL/TLS termination using your own certificates. - Forward http traffic to https. diff --git a/tutor/commands/jobs_utils.py b/tutor/commands/jobs_utils.py index efbd0b2b68..c385912ddc 100644 --- a/tutor/commands/jobs_utils.py +++ b/tutor/commands/jobs_utils.py @@ -177,8 +177,6 @@ def assign_theme(name, domain): "{{ LMS_HOST }}:8000", "{{ CMS_HOST }}", "{{ CMS_HOST }}:8001", - "{{ PREVIEW_LMS_HOST }}", - "{{ PREVIEW_LMS_HOST }}:8000", ] for domain_name in domain_names: python_command += f"assign_theme('{theme_name}', '{domain_name}')\n" diff --git a/tutor/config.py b/tutor/config.py index 03a7f85f97..af88ad719b 100644 --- a/tutor/config.py +++ b/tutor/config.py @@ -342,19 +342,3 @@ def _update_enabled_plugins_on_unload(_plugin: str, _root: str, config: Config) Note that this action must be performed after the plugin has been unloaded, hence the low priority. """ save_enabled_plugins(config) - - -@hooks.Actions.CONFIG_LOADED.add() -def _check_preview_lms_host(config: Config) -> None: - """ - This will check if the PREVIEW_LMS_HOST is a subdomain of LMS_HOST. - if not, prints a warning to notify the user. - """ - - lms_host = get_typed(config, "LMS_HOST", str, "") - preview_lms_host = get_typed(config, "PREVIEW_LMS_HOST", str, "") - if not preview_lms_host.endswith("." + lms_host): - fmt.echo_alert( - f'Warning: PREVIEW_LMS_HOST="{preview_lms_host}" is not a subdomain of LMS_HOST="{lms_host}". ' - "This configuration is not typically recommended and may lead to unexpected behavior." - ) diff --git a/tutor/templates/apps/caddy/Caddyfile b/tutor/templates/apps/caddy/Caddyfile index 77eb152ec4..ad94a97f48 100644 --- a/tutor/templates/apps/caddy/Caddyfile +++ b/tutor/templates/apps/caddy/Caddyfile @@ -41,7 +41,7 @@ {{ patch("caddyfile-proxy")|indent(4) }} } -{{ LMS_HOST }}{$default_site_port}, {{ PREVIEW_LMS_HOST }}{$default_site_port} { +{{ LMS_HOST }}{$default_site_port} { @favicon_matcher { path_regexp ^/favicon.ico$ } diff --git a/tutor/templates/apps/openedx/config/cms.env.yml b/tutor/templates/apps/openedx/config/cms.env.yml index 8eb7b462d8..17ba857d54 100644 --- a/tutor/templates/apps/openedx/config/cms.env.yml +++ b/tutor/templates/apps/openedx/config/cms.env.yml @@ -8,7 +8,6 @@ FEATURES: {{ patch("common-env-features")|indent(2) }} {{ patch("cms-env-features")|indent(2) }} CERTIFICATES_HTML_VIEW: true - PREVIEW_LMS_BASE: "{{ PREVIEW_LMS_HOST }}" ENABLE_CSMH_EXTENDED: false ENABLE_LEARNER_RECORDS: false ENABLE_LIBRARY_INDEX: true diff --git a/tutor/templates/apps/openedx/config/lms.env.yml b/tutor/templates/apps/openedx/config/lms.env.yml index bc9927f23c..44fe04d7b9 100644 --- a/tutor/templates/apps/openedx/config/lms.env.yml +++ b/tutor/templates/apps/openedx/config/lms.env.yml @@ -8,7 +8,6 @@ FEATURES: {{ patch("common-env-features")|indent(2) }} {{ patch("lms-env-features")|indent(2) }} CERTIFICATES_HTML_VIEW: true - PREVIEW_LMS_BASE: "{{ PREVIEW_LMS_HOST }}" ENABLE_CSMH_EXTENDED: false ENABLE_COMBINED_LOGIN_REGISTRATION: true ENABLE_GRADE_DOWNLOADS: true diff --git a/tutor/templates/apps/openedx/settings/cms/development.py b/tutor/templates/apps/openedx/settings/cms/development.py index ee4c3b3b5b..ef413a9a21 100644 --- a/tutor/templates/apps/openedx/settings/cms/development.py +++ b/tutor/templates/apps/openedx/settings/cms/development.py @@ -16,8 +16,6 @@ SOCIAL_AUTH_EDX_OAUTH2_KEY = "{{ CMS_OAUTH2_KEY_SSO_DEV }}" SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT = LMS_ROOT_URL -FEATURES["PREVIEW_LMS_BASE"] = "{{ PREVIEW_LMS_HOST }}:8000" - # Setup correct webpack configuration file for development WEBPACK_CONFIG_PATH = "webpack.dev.config.js" diff --git a/tutor/templates/apps/openedx/settings/lms/production.py b/tutor/templates/apps/openedx/settings/lms/production.py index 6c2793b3bc..c9e62fe094 100644 --- a/tutor/templates/apps/openedx/settings/lms/production.py +++ b/tutor/templates/apps/openedx/settings/lms/production.py @@ -6,7 +6,6 @@ ALLOWED_HOSTS = [ ENV_TOKENS.get("LMS_BASE"), - FEATURES["PREVIEW_LMS_BASE"], "lms", ] CORS_ORIGIN_WHITELIST.append("{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}") diff --git a/tutor/templates/config/defaults.yml b/tutor/templates/config/defaults.yml index 6186cb8724..9d843b72f7 100644 --- a/tutor/templates/config/defaults.yml +++ b/tutor/templates/config/defaults.yml @@ -68,7 +68,6 @@ MYSQL_PORT: 3306 MYSQL_ROOT_USERNAME: "root" NPM_REGISTRY: "https://registry.npmjs.org/" PLATFORM_NAME: "My Open edX" -PREVIEW_LMS_HOST: "preview.{{ LMS_HOST }}" REDIS_HOST: "redis" REDIS_PORT: 6379 REDIS_USERNAME: ""