Skip to content

Commit 5f5f5fe

Browse files
committed
feat: add tutor-mfe service integration
1 parent 7ed1172 commit 5f5f5fe

File tree

8 files changed

+25
-34
lines changed

8 files changed

+25
-34
lines changed

plugins/tutor-contrib-paragon/tutorparagon/patches/caddyfile-lms

Lines changed: 0 additions & 13 deletions
This file was deleted.

plugins/tutor-contrib-paragon/tutorparagon/patches/local-docker-compose-services

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if MFE_HOST_EXTRA_FILES %}
2+
# Paragon static files hosting
3+
handle_path /{{ PARAGON_STATIC_URL_PREFIX }}* {
4+
@mincss {
5+
# Match only minified CSS files
6+
path_regexp mincss \.min\.css$
7+
}
8+
handle @mincss {
9+
root * /paragon-statics
10+
file_server
11+
}
12+
}
13+
{% endif %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% if MFE_HOST_EXTRA_FILES %}
2+
- ../../{{ PARAGON_COMPILED_THEMES_PATH }}:/paragon-statics
3+
{% endif %}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% if MFE_HOST_EXTRA_FILES %}
12
{% set PROTOCOL = 'https' if ENABLE_HTTPS else 'http' %}
2-
{% set PARAGON_BASE_URL = PROTOCOL ~ "://" ~ "localhost" ~ ":" ~ PARAGON_STATIC_SERVER_PORT ~ "/" %}
3-
{% include "paragon/settings/mfe-config-lms-common-setting" %}
3+
{% set PARAGON_BASE_URL = PROTOCOL ~ "://" ~ "localhost" ~ ":" ~ 8002 ~ "/" ~ PARAGON_STATIC_URL_PREFIX%}
4+
{% include "paragon/settings/mfe-common-settings" %}
5+
{% endif %}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% if MFE_HOST_EXTRA_FILES %}
12
{% set PROTOCOL = 'https' if ENABLE_HTTPS else 'http' %}
2-
{% set PARAGON_BASE_URL = PROTOCOL ~ "://" ~ LMS_HOST ~ "/" ~ PARAGON_STATIC_URL_PREFIX %}
3-
{% include "paragon/settings/mfe-config-lms-common-setting" %}
3+
{% set PARAGON_BASE_URL = PROTOCOL ~ "://" ~ MFE_HOST ~ "/" ~ PARAGON_STATIC_URL_PREFIX %}
4+
{% include "paragon/settings/mfe-common-settings" %}
5+
{% endif %}

plugins/tutor-contrib-paragon/tutorparagon/plugin.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@
2929
# List of enabled themes to compile and serve
3030
# Only themes listed here will be processed, even if others exist in sources
3131
("PARAGON_ENABLED_THEMES", []),
32-
# Whether Tutor should expose the compiled themes to be served (e.g. via nginx, cady or static server)
33-
("PARAGON_SERVE_COMPILED_THEMES", True),
3432
# Paragon Builder Docker image
3533
# This image is used to compile themes and should be built with `tutor images build paragon-builder`
3634
("PARAGON_BUILDER_IMAGE", "paragon-builder:latest"),
37-
# Paragon static server configuration
38-
# This server serves the compiled themes
39-
("PARAGON_STATIC_SERVER_IMAGE", "caddy:alpine"),
40-
("PARAGON_STATIC_SERVER_PORT", 12400),
4135
("PARAGON_STATIC_URL_PREFIX", "static/paragon/"),
36+
("MFE_HOST_EXTRA_FILES", True), # Enable MFE host extra files
4237
]
4338
)
4439

plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/settings/mfe-config-lms-common-setting renamed to plugins/tutor-contrib-paragon/tutorparagon/templates/paragon/settings/mfe-common-settings

File renamed without changes.

0 commit comments

Comments
 (0)