Skip to content

Commit 45836b1

Browse files
depr!: remove preview site configurations (#1248)
closes #1231 The preview page has been migrated to the Learning MFE as of openedx/openedx-platform#36460 This is why we dont need to have a separate domain for the preview site anymore nor the configuration setting for the preview page in core.
1 parent dbe2cfe commit 45836b1

File tree

11 files changed

+3
-27
lines changed

11 files changed

+3
-27
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- 💥[Deprecation] Remove preview page configuration as the page has been migrated to the learning MFE. (by @Danyal-Faheem)

docs/configuration.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ When ``ENABLE_HTTPS`` is ``true``, the whole Open edX platform will be reconfigu
292292
The following DNS records must exist and point to your server::
293293

294294
LMS_HOST (e.g: myopenedx.com)
295-
PREVIEW_LMS_HOST (e.g: preview.myopenedx.com)
296295
CMS_HOST (e.g: studio.myopenedx.com)
297296

298297
Thus, **this feature will (probably) not work in development** because the DNS records will (probably) not point to your development machine.

docs/tutorials/proxy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ With these changes, Tutor will no longer listen to ports 80 and 443 on the host.
2020

2121
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:
2222

23-
- 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.
23+
- 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.
2424
- If SSL/TLS is enabled:
2525
- Perform SSL/TLS termination using your own certificates.
2626
- Forward http traffic to https.

tutor/commands/jobs_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ def assign_theme(name, domain):
177177
"{{ LMS_HOST }}:8000",
178178
"{{ CMS_HOST }}",
179179
"{{ CMS_HOST }}:8001",
180-
"{{ PREVIEW_LMS_HOST }}",
181-
"{{ PREVIEW_LMS_HOST }}:8000",
182180
]
183181
for domain_name in domain_names:
184182
python_command += f"assign_theme('{theme_name}', '{domain_name}')\n"

tutor/config.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -342,19 +342,3 @@ def _update_enabled_plugins_on_unload(_plugin: str, _root: str, config: Config)
342342
Note that this action must be performed after the plugin has been unloaded, hence the low priority.
343343
"""
344344
save_enabled_plugins(config)
345-
346-
347-
@hooks.Actions.CONFIG_LOADED.add()
348-
def _check_preview_lms_host(config: Config) -> None:
349-
"""
350-
This will check if the PREVIEW_LMS_HOST is a subdomain of LMS_HOST.
351-
if not, prints a warning to notify the user.
352-
"""
353-
354-
lms_host = get_typed(config, "LMS_HOST", str, "")
355-
preview_lms_host = get_typed(config, "PREVIEW_LMS_HOST", str, "")
356-
if not preview_lms_host.endswith("." + lms_host):
357-
fmt.echo_alert(
358-
f'Warning: PREVIEW_LMS_HOST="{preview_lms_host}" is not a subdomain of LMS_HOST="{lms_host}". '
359-
"This configuration is not typically recommended and may lead to unexpected behavior."
360-
)

tutor/templates/apps/caddy/Caddyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{{ patch("caddyfile-proxy")|indent(4) }}
4242
}
4343

44-
{{ LMS_HOST }}{$default_site_port}, {{ PREVIEW_LMS_HOST }}{$default_site_port} {
44+
{{ LMS_HOST }}{$default_site_port} {
4545
@favicon_matcher {
4646
path_regexp ^/favicon.ico$
4747
}

tutor/templates/apps/openedx/config/cms.env.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ FEATURES:
88
{{ patch("common-env-features")|indent(2) }}
99
{{ patch("cms-env-features")|indent(2) }}
1010
CERTIFICATES_HTML_VIEW: true
11-
PREVIEW_LMS_BASE: "{{ PREVIEW_LMS_HOST }}"
1211
ENABLE_CSMH_EXTENDED: false
1312
ENABLE_LEARNER_RECORDS: false
1413
ENABLE_LIBRARY_INDEX: true

tutor/templates/apps/openedx/config/lms.env.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ FEATURES:
88
{{ patch("common-env-features")|indent(2) }}
99
{{ patch("lms-env-features")|indent(2) }}
1010
CERTIFICATES_HTML_VIEW: true
11-
PREVIEW_LMS_BASE: "{{ PREVIEW_LMS_HOST }}"
1211
ENABLE_CSMH_EXTENDED: false
1312
ENABLE_COMBINED_LOGIN_REGISTRATION: true
1413
ENABLE_GRADE_DOWNLOADS: true

tutor/templates/apps/openedx/settings/cms/development.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
SOCIAL_AUTH_EDX_OAUTH2_KEY = "{{ CMS_OAUTH2_KEY_SSO_DEV }}"
1717
SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT = LMS_ROOT_URL
1818

19-
FEATURES["PREVIEW_LMS_BASE"] = "{{ PREVIEW_LMS_HOST }}:8000"
20-
2119
# Setup correct webpack configuration file for development
2220
WEBPACK_CONFIG_PATH = "webpack.dev.config.js"
2321

tutor/templates/apps/openedx/settings/lms/production.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
ALLOWED_HOSTS = [
88
ENV_TOKENS.get("LMS_BASE"),
9-
FEATURES["PREVIEW_LMS_BASE"],
109
"lms",
1110
]
1211
CORS_ORIGIN_WHITELIST.append("{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}")

0 commit comments

Comments
 (0)