Skip to content

Commit

Permalink
squash: reponse to PR review _only minor issues resolved_
Browse files Browse the repository at this point in the history
  • Loading branch information
ghassanmas committed Nov 22, 2022
1 parent 3f985ed commit 2bff31b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 23 deletions.
37 changes: 37 additions & 0 deletions tutormfe/patches/openedx-lms-development-settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,40 @@ CORS_ORIGIN_WHITELIST.append("http://{{ MFE_HOST }}:{{ app["port"] }}")
LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}:{{ app["port"] }}")
CSRF_TRUSTED_ORIGINS.append("{{ MFE_HOST }}:{{ app["port"] }}")
{% endfor %}

# Start of Dynamic config API settings

ENABLE_MFE_CONFIG_API = True

MFE_CONFIG = {
"BASE_URL": "{{ MFE_HOST }}",
"CREDENTIALS_BASE_URL": "/csrf/api/v1/token",
"DISCOVERY_API_BASE_UR": "{% if DISCOVERY_HOST is defined %}{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ DISCOVERY_HOST }}{% endif %}",
"ENABLE_NEW_RELIC": False,
"FAVICON_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/favicon.ico",
"LANGUAGE_PREFERENCE_COOKIE_NAME": "openedx-language-preference",
"LMS_BASE_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}",
"LOGIN_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/login",
"LOGO_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/theming/asset/images/logo.png",
"LOGO_TRADEMARK_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/theming/asset/images/logo.png",
"LOGOUT_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/logout",
"MARKETING_SITE_BASE_URL": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}",
"REFRESH_ACCESS_TOKEN_ENDPOINT": "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}/login_refresh",
"SITE_NAME": "{{ PLATFORM_NAME }}",
"STUDIO_BASE_URL": "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}",
"USER_INFO_COOKIE_NAME": "user-info"
}


MFE_CONFIG_OVERRIDES = {
{% for app in iter_values_named(suffix="MFE_APP") %}
"{{ app['name'] }}": {
{%- for key, value in app.get("env", {}).get("development", {}).items() %}

"{{ key }}": "{{ value }}",

{%- endfor %}
},
{% endfor %}
}
# Ends Dynamic config API settings
8 changes: 4 additions & 4 deletions tutormfe/patches/openedx-lms-production-settings
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ LOGIN_REDIRECT_WHITELIST.append("{{ MFE_HOST }}")
CORS_ORIGIN_WHITELIST.append("{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}")
CSRF_TRUSTED_ORIGINS.append("{{ MFE_HOST }}")

# Starts of Dynamic config API settings
ALLOWED_HOSTS.append("{{ MFE_HOST }}")

ENABLE_MFE_CONFIG_API = True
# Start of Dynamic config API settings

ALLOWED_HOSTS.append("{{ MFE_HOST }}")
ENABLE_MFE_CONFIG_API = True

MFE_CONFIG = {
"BASE_URL": "{{ MFE_HOST }}",
Expand All @@ -43,7 +43,7 @@ MFE_CONFIG = {

MFE_CONFIG_OVERRIDES = {
{% for app in iter_values_named(suffix="MFE_APP") %}
"{{app.get('name')}}": {
"{{ app['name'] }}": {
{%- for key, value in app.get("env", {}).get("production", {}).items() %}

"{{ key }}": "{{ value }}",
Expand Down
18 changes: 0 additions & 18 deletions tutormfe/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,16 @@
"name": "account",
"repository": "https://github.com/edx/frontend-app-account",
"port": 1997,
"env": {
"production": {
"COACHING_ENABLED": "",
"ENABLE_DEMOGRAPHICS_COLLECTION": "",
"APP_ID":"account",
},
},
},
"GRADEBOOK_MFE_APP": {
"name": "gradebook",
"repository": "https://github.com/edx/frontend-app-gradebook",
"port": 1994,
"env":{
"production":{
"APP_ID": "gradebook",
},
},
},
"LEARNING_MFE_APP": {
"name": "learning",
"repository": "https://github.com/edx/frontend-app-learning",
"port": 2000,
"env":{
"production":{
"APP_ID": "learning",
},
},
},
"PROFILE_MFE_APP": {
"name": "profile",
Expand All @@ -52,7 +35,6 @@
"env": {
"production": {
"ENABLE_LEARNER_RECORD_MFE": "true",
"APP_ID": "profile",
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion tutormfe/templates/mfe/build/mfe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ COPY --from={{ app["name"] }}-src /openedx/app /openedx/app
COPY --from={{ app["name"] }}-i18n /openedx/app/src/i18n/messages /openedx/app/src/i18n/messages
ENV PUBLIC_PATH='/{{ app["name"] }}/'
EXPOSE {{ app['port'] }}
ENV APP_ID={{ app["name"] }}

COPY ./env/production /openedx/env/production
{%- set overrides = app.get("env", {}).get("production", {}) %}
Expand All @@ -78,7 +79,7 @@ RUN echo "setting development overrides..." \
CMD ["/bin/bash", "-c", "set -a && \
source /openedx/env/production && \
source /openedx/env/development && \
npm run start --- --config ./webpack.dev-tutor.config.js"]
APP_ID={{ app["name"] }} npm run start --- --config ./webpack.dev-tutor.config.js"]
{% endfor %}

# Production images are last to accelerate dev image building
Expand Down

0 comments on commit 2bff31b

Please sign in to comment.