-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* allow MFEs to be hosted on either the LMS or the CMS Before all the MFEs that were hosted by path were hosted in the LMS domain. For certain MFEs (course-authoring) the CMS domain is more appropriate. * point the MFEs URLs to either the LMS or the CMS * handle special cases in the $LMS_HOST/account route. The `/account/password` endpoint is used in the 'forgot password' flow, for that reason we must forward those requests to the LMS. The `/account/settings` is more specific to the multitenant use case. Some sites may be configured to use the legacy pages but the current configuration would send every subpath of `/account/` to the MFE, we make an exception for the legacy URL.
- Loading branch information
1 parent
6811d69
commit 2dbce5e
Showing
8 changed files
with
108 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,12 @@ for MFEs. | |
| Olive | `>=15.0, <16` | `edunext/[email protected]` | 15.x.x | | ||
| Palm | `>=16.0, <17` | `edunext/[email protected]` | 16.x.x | | ||
| Quince | `>=17.0, <18` | `openedx/[email protected]` | 17.x.x | | ||
| Redwood | `>=18.0, <19` | `tutor-mfe>17` | 18.x.x | | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install git+https://github.com/edunext/[email protected] | ||
pip install git+https://github.com/edunext/[email protected] | ||
pip install git+https://github.com/edunext/[email protected] | ||
``` | ||
|
||
## Plugin Configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "17.0.0" | ||
__version__ = "18.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{%- if MFE_EXTENSIONS_BY_PATH %} | ||
reverse_proxy /api/mfe_config/v1* lms:8000 { | ||
header_up Host {{ LMS_HOST }} | ||
} | ||
{%- for app_name in iter_mfes_per_service("cms") %} | ||
@mfe_{{ app_name }} { | ||
path /{{ app_name }} /{{ app_name }}/* | ||
} | ||
handle @mfe_{{ app_name }} { | ||
redir /{{ app_name }} /{{ app_name }}/ | ||
reverse_proxy mfe:8002 { | ||
header_up Host {host} | ||
} | ||
} | ||
{%- endfor %} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
{%- if MFE_EXTENSIONS_BY_PATH %} | ||
{% for app_name, app in iter_mfes() %} | ||
route /{{app_name}}/* { | ||
{%- for app_name in iter_mfes_per_service("lms") %} | ||
@mfe_{{ app_name }} { | ||
path /{{ app_name }} /{{ app_name }}/* | ||
} | ||
handle @mfe_{{ app_name }} { | ||
redir /{{ app_name }} /{{ app_name }}/ | ||
{%- if app_name == "account" %} | ||
handle /account/settings { | ||
reverse_proxy lms:8000 | ||
} | ||
handle /account/password { | ||
reverse_proxy lms:8000 | ||
} | ||
{%- endif %} | ||
reverse_proxy mfe:8002 { | ||
header_up Host {host} | ||
} | ||
} | ||
{% endfor %} | ||
{%- endfor %} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{%- if MFE_EXTENSIONS_BY_PATH %} | ||
{%- if get_mfe("course-authoring") %} | ||
COURSE_AUTHORING_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}/course-authoring" | ||
{%- endif %} | ||
{%- endif %} |
56 changes: 43 additions & 13 deletions
56
tutormfe_extensions/patches/openedx-lms-production-settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
{% if MFE_EXTENSIONS_BY_PATH %} | ||
LEARNING_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/learning" | ||
MFE_CONFIG["LEARNING_BASE_URL"] = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/learning" | ||
|
||
{%- if get_mfe("authn") %} | ||
AUTHN_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/authn" | ||
AUTHN_MICROFRONTEND_DOMAIN = "{{ LMS_HOST }}/authn" | ||
{%- endif %} | ||
|
||
{% if get_mfe("account") %} | ||
ACCOUNT_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/account/" | ||
MFE_CONFIG["ACCOUNT_SETTINGS_URL"] = ACCOUNT_MICROFRONTEND_URL | ||
{%- endif %} | ||
|
||
{% if get_mfe("discussions") %} | ||
DISCUSSIONS_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/discussions" | ||
MFE_CONFIG["DISCUSSIONS_MFE_BASE_URL"] = DISCUSSIONS_MICROFRONTEND_URL | ||
{% endif %} | ||
|
||
{% if get_mfe("gradebook") %} | ||
WRITABLE_GRADEBOOK_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/gradebook" | ||
{% endif %} | ||
|
||
{% if get_mfe("learner-dashboard") %} | ||
LEARNER_HOME_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/learner-dashboard/" | ||
{% endif %} | ||
|
||
{% if get_mfe("ora-grading") %} | ||
ORA_GRADING_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/ora-grading" | ||
{% endif %} | ||
|
||
{% if get_mfe("profile") %} | ||
PROFILE_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/profile/u/" | ||
MFE_CONFIG["ACCOUNT_PROFILE_URL"] = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/profile" | ||
{% endif %} | ||
|
||
{% if get_mfe("communications") %} | ||
COMMUNICATIONS_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/communications" | ||
{% endif %} | ||
|
||
{% if get_mfe("course-authoring") %} | ||
MFE_CONFIG["COURSE_AUTHORING_MICROFRONTEND_URL"] = "{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ LMS_HOST }}/course-authoring" | ||
{% endif %} | ||
|
||
CORS_ORIGIN_WHITELIST.append("{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ CMS_HOST }}") | ||
{% endif %} | ||
MFE_CONFIG["PARAGON_THEME_URLS"] = { | ||
"core": { | ||
"url": "https://cdn.jsdelivr.net/combine/npm/@edx/[email protected]/styles/css/themes/light/utility-classes.min.css,npm/@edx/[email protected]/dist/core.min.css" | ||
}, | ||
"defaults": { | ||
"light": "light" | ||
}, | ||
"variants": { | ||
"light": { | ||
"url": "https://css-varsify.s3.amazonaws.com/public/a9959998-0bab-4447-ada5-6819866195f3.css" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters