-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: verify minio host is defined on scorm proxy (#96)
* fix: verify minio host is defined on scorm proxy * chore: refactor scorm template (cherry picked from commit 503ab92)
- Loading branch information
Showing
3 changed files
with
56 additions
and
40 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 |
---|---|---|
@@ -1,35 +1,43 @@ | ||
{% if DRYDOCK_ENABLE_MULTITENANCY -%} | ||
{$default_site_port} { | ||
@favicon_matcher { | ||
path_regexp ^/favicon.ico$ | ||
} | ||
rewrite @favicon_matcher /theming/asset/images/favicon.ico | ||
@favicon_matcher { | ||
path_regexp ^/favicon.ico$ | ||
} | ||
rewrite @favicon_matcher /theming/asset/images/favicon.ico | ||
|
||
{{ patch("caddyfile-mfe-by-path") }} | ||
{{ patch("caddyfile-mfe-by-path") }} | ||
|
||
# Limit profile image upload size | ||
request_body /api/profile_images/*/*/upload { | ||
max_size 1MB | ||
} | ||
request_body { | ||
max_size 4MB | ||
} | ||
import proxy "lms:8000" | ||
{% if DRYDOCK_ENABLE_SCORM and (MINIO_HOST is defined or S3_STORAGE_BUCKET is defined) -%} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
uri /scorm-proxy/* strip_prefix /scorm-proxy | ||
{% if MINIO_HOST is defined %} | ||
reverse_proxy minio:9000 { | ||
header_up Host {{ MINIO_HOST }} | ||
{% elif S3_STORAGE_BUCKET is defined %} | ||
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com { | ||
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com | ||
{% endif %} | ||
# Limit profile image upload size | ||
request_body /api/profile_images/*/*/upload { | ||
max_size 1MB | ||
} | ||
request_body { | ||
max_size 4MB | ||
} | ||
import proxy "lms:8000" | ||
|
||
{% if DRYDOCK_ENABLE_SCORM and MINIO_HOST is defined %} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
uri /scorm-proxy/* strip_prefix /scorm-proxy | ||
reverse_proxy minio:9000 { | ||
header_up Host {{ MINIO_HOST }} | ||
} | ||
} | ||
{% elif DRYDOCK_ENABLE_SCORM and S3_STORAGE_BUCKET is defined %} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
uri /scorm-proxy/* strip_prefix /scorm-proxy | ||
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com { | ||
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com | ||
} | ||
} | ||
{% endif %} | ||
|
||
} | ||
{% endif %} | ||
} | ||
|
||
{% 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,17 +1,21 @@ | ||
{% if DRYDOCK_ENABLE_SCORM and (MINIO_HOST is defined or S3_STORAGE_BUCKET is defined) -%} | ||
{% if DRYDOCK_ENABLE_SCORM and MINIO_HOST is defined %} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
{% if MINIO_HOST is defined %} | ||
uri replace /scorm-proxy/ /{{ MINIO_BUCKET_NAME }}/ | ||
reverse_proxy minio:9000 { | ||
header_up Host {{ MINIO_HOST }} | ||
{% elif S3_STORAGE_BUCKET is defined %} | ||
header_up Host {{ MINIO_HOST }} | ||
} | ||
} | ||
{% elif DRYDOCK_ENABLE_SCORM and S3_STORAGE_BUCKET is defined %} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
uri /scorm-proxy/* strip_prefix /scorm-proxy | ||
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com { | ||
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com | ||
{% endif %} | ||
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com | ||
} | ||
} | ||
{% 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,17 +1,21 @@ | ||
{% if DRYDOCK_ENABLE_SCORM and (MINIO_HOST is defined or S3_STORAGE_BUCKET is defined) -%} | ||
{% if DRYDOCK_ENABLE_SCORM and MINIO_HOST is defined %} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
{% if MINIO_HOST is defined %} | ||
uri replace /scorm-proxy/ /{{ MINIO_BUCKET_NAME }}/ | ||
reverse_proxy minio:9000 { | ||
header_up Host {{ MINIO_HOST }} | ||
{% elif S3_STORAGE_BUCKET is defined %} | ||
header_up Host {{ MINIO_HOST }} | ||
} | ||
} | ||
{% elif DRYDOCK_ENABLE_SCORM and S3_STORAGE_BUCKET is defined %} | ||
@scorm_matcher { | ||
path /scorm-proxy/* | ||
} | ||
route @scorm_matcher { | ||
uri /scorm-proxy/* strip_prefix /scorm-proxy | ||
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com { | ||
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com | ||
{% endif %} | ||
header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com | ||
} | ||
} | ||
{% endif %} |