Skip to content

Commit

Permalink
fix: enable scorm proxy if s3 plugin is installed (#92)
Browse files Browse the repository at this point in the history
docs: add documentation for ingress lm extra hosts
  • Loading branch information
Ian2012 authored Apr 26, 2024
1 parent d0eb742 commit c1ee060
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The following configuration options are available:
- `DRYDOCK_FLOWER`: Whether to deploy a flower deployment for celery. Defaults to `false`.
- `DRYDOCK_INGRESS`: Whether to deploy an ingress for the LMS and CMS. Defaults to `false`.
- `DRYDOCK_INGRESS_EXTRA_HOSTS`: A list of extra hosts to add to the ingress. Defaults to `[]`.
- `DRYDOCK_INGRESS_LMS_EXTRA_HOSTS`: A list of extra hosts to add to the LMS ingress. Defaults to `[]`.
- `DRYDOCK_CUSTOM_CERTS`: A dictionary of custom certificates to use with cert-manager. Defaults to `{}`.
- `DRYDOCK_NEWRELIC_LICENSE_KEY`: The New Relic license key. Defaults to `""`.
- `DRYDOCK_DEBUG`: Whether to deploy debug resources. Defaults to `false`.
Expand Down
4 changes: 2 additions & 2 deletions drydock/patches/caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ request_body {
max_size 4MB
}
import proxy "lms:8000"
{% if DRYDOCK_ENABLE_SCORM -%}
{% if DRYDOCK_ENABLE_SCORM and (MINIO_HOST is defined or S3_STORAGE_BUCKET is defined) -%}
@scorm_matcher {
path /scorm-proxy/*
}
Expand All @@ -24,7 +24,7 @@ route @scorm_matcher {
{% if MINIO_HOST is defined %}
reverse_proxy minio:9000 {
header_up Host {{ MINIO_HOST }}
{% else %}
{% 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 %}
Expand Down
4 changes: 2 additions & 2 deletions drydock/patches/caddyfile-cms
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if DRYDOCK_ENABLE_SCORM -%}
{% if DRYDOCK_ENABLE_SCORM and (MINIO_HOST is defined or S3_STORAGE_BUCKET is defined) -%}
@scorm_matcher {
path /scorm-proxy/*
}
Expand All @@ -7,7 +7,7 @@ route @scorm_matcher {
uri replace /scorm-proxy/ /{{ MINIO_BUCKET_NAME }}/
reverse_proxy minio:9000 {
header_up Host {{ MINIO_HOST }}
{% else %}
{% elif S3_STORAGE_BUCKET is defined %}
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
Expand Down
4 changes: 2 additions & 2 deletions drydock/patches/caddyfile-lms
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if DRYDOCK_ENABLE_SCORM -%}
{% if DRYDOCK_ENABLE_SCORM and (MINIO_HOST is defined or S3_STORAGE_BUCKET is defined) -%}
@scorm_matcher {
path /scorm-proxy/*
}
Expand All @@ -7,7 +7,7 @@ route @scorm_matcher {
uri replace /scorm-proxy/ /{{ MINIO_BUCKET_NAME }}/
reverse_proxy minio:9000 {
header_up Host {{ MINIO_HOST }}
{% else %}
{% elif S3_STORAGE_BUCKET is defined %}
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
Expand Down
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 %}
{%- if DRYDOCK_ENABLE_SCORM and DRYDOCK_BYPASS_CADDY and S3_STORAGE_BUCKET 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 %}
{%- if DRYDOCK_ENABLE_SCORM and DRYDOCK_BYPASS_CADDY and S3_STORAGE_BUCKET is defined %}
nginx.ingress.kubernetes.io/server-snippet: |
location /scorm-proxy {
proxy_http_version 1.1;
Expand Down

0 comments on commit c1ee060

Please sign in to comment.