Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 36 additions & 28 deletions drydock/patches/caddyfile
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 %}
17 changes: 10 additions & 7 deletions drydock/patches/caddyfile-cms
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{% 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 %}
17 changes: 10 additions & 7 deletions drydock/patches/caddyfile-lms
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{% 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 %}
2 changes: 1 addition & 1 deletion drydock/templates/drydock/k8s/ingress/cms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
{%- if DRYDOCK_AUTO_TLS and not DRYDOCK_CUSTOM_CERTS%}
cert-manager.io/issuer: letsencrypt
{%- endif %}
{%- if DRYDOCK_ENABLE_SCORM and DRYDOCK_BYPASS_CADDY and S3_STORAGE_BUCKET is defined %}
{%- if DRYDOCK_ENABLE_SCORM and DRYDOCK_BYPASS_CADDY and (S3_STORAGE_BUCKET is defined or MINIO_HOST is defined) %}
nginx.ingress.kubernetes.io/server-snippet: |
location /scorm-proxy {
proxy_http_version 1.1;
Expand Down
2 changes: 1 addition & 1 deletion drydock/templates/drydock/k8s/ingress/lms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
{%- if DRYDOCK_AUTO_TLS and not DRYDOCK_CUSTOM_CERTS %}
cert-manager.io/issuer: letsencrypt
{%- endif %}
{%- if DRYDOCK_ENABLE_SCORM and DRYDOCK_BYPASS_CADDY and S3_STORAGE_BUCKET is defined %}
{%- if DRYDOCK_ENABLE_SCORM and DRYDOCK_BYPASS_CADDY and (S3_STORAGE_BUCKET is defined or MINIO_HOST is defined) %}
nginx.ingress.kubernetes.io/server-snippet: |
location /scorm-proxy {
proxy_http_version 1.1;
Expand Down