Skip to content

Verawood#38

Open
BetoFandino wants to merge 6 commits into
mainfrom
verawood
Open

Verawood#38
BetoFandino wants to merge 6 commits into
mainfrom
verawood

Conversation

@BetoFandino
Copy link
Copy Markdown

@BetoFandino BetoFandino commented May 19, 2026

Description

Extends MFE_EXTENSIONS_BY_PATH support for tutor-mfe verawood release and new frontend-site apps (e.g. instructor-dashboard).

Problem

On verawood, instructor-dashboard is a frontend app (is_frontend_app_enabled), not a legacy entry in MFE_APPS. With BY_PATH enabled:

  • LMS redirected correctly to {LMS_HOST}/instructor-dashboard/..., but Caddy had no route for that path → 404.

Importan Changes

plugin.py

Extend iter_mfes_per_service() to yield enabled frontend apps from get_frontend_apps() / is_frontend_app_enabled(), in addition to legacy MFE_APPS.

caddyfile-frontend-site-assets (new) + caddyfile-lms

Proxy hashed webpack assets at the LMS root to mfe:8002 when BY_PATH is on and frontend apps exist.
Matcher covers runtime, app, numeric chunks, cssLayerOrder, and {app}-main bundles (e.g. instructor-dashboard-main..js). Beacause Frontend-site assets are served from /openedx/dist/site at / on the MFE container; on apps. that works on the same host, but on the LMS only /instructor-dashboard/* was proxied, causing blank pages / “unexpected error”.

Relevant links

@BetoFandino BetoFandino requested a review from MoisesGSalas May 19, 2026 03:12
Comment on lines +1 to +12
{%- if MFE_EXTENSIONS_BY_PATH and get_frontend_apps() %}
# Frontend-site bundles (e.g. runtime.*.js) are served from /openedx/dist/site at the
# MFE root. When hosting by path on the LMS domain, proxy those asset paths to mfe.
@mfe_frontend_site_assets {
path_regexp assets ^/(runtime|app|cssLayerOrder|[0-9]+|[a-z0-9-]+-main)\.[a-f0-9]+\.(js|css)$
}
handle @mfe_frontend_site_assets {
reverse_proxy mfe:8002 {
header_up Host {host}
}
}
{%- endif %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would need to test it first, but at first glance I have some doubts about this configuration.

Correct me if I’m wrong, but after reviewing this issue overhangio/tutor-mfe#285

I don’t see anything that would require changing the behavior of the main Caddy to serve those assets. My understanding is that, even though the files are now served from /openedx/dist/site, they should still follow the same logic as before, so the request should continue reaching the MFE Caddyfile (mfe:8002), and that Caddyfile should handle looking for the files in the corresponding path.

Did you try mfe-extension without this change? If so, what error do you get?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In legacy MFEs those assets live under /{app}/ and /instructor-dashboard/* → mfe:8002 is enough.

For frontend-site apps, webpack still emits root-level bundles (/runtime..js, /instructor-dashboard-main..js). I tested without this patch: HTML under /instructor-dashboard/ works, but /runtime.*.js returns 404 from the LMS (never hits mfe:8002). That matches a blank instructor dashboard. This patch only proxies those root asset paths to mfe:8002 when BY_PATH + frontend apps are enabled.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants