Skip to content

Commit

Permalink
fix: S3_HOST for alternative S3-compatible services (#122)
Browse files Browse the repository at this point in the history
* fix: when using SCORM, S3_HOST must be used for alternative S3-compatible services
  • Loading branch information
jfavellar90 committed Jul 5, 2024
1 parent c2729dc commit 399728a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions drydock/patches/caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
}
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
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }} {
header_up Host {{ S3_STORAGE_BUCKET }}.{{ S3_HOST or '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
Expand Up @@ -14,8 +14,8 @@ route @scorm_matcher {
}
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
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }} {
header_up Host {{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }}
}
}
{% endif %}
4 changes: 2 additions & 2 deletions drydock/patches/caddyfile-lms
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ route @scorm_matcher {
}
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
reverse_proxy https://{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }} {
header_up Host {{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }}
}
}
{% endif %}
4 changes: 2 additions & 2 deletions drydock/templates/drydock/k8s/ingress/cms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Authorization '';
proxy_set_header Host {% if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com{%- endif %};
proxy_set_header Host {% if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }}{%- endif %};
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
Expand All @@ -24,7 +24,7 @@ metadata:
proxy_intercept_errors on;
add_header Cache-Control max-age=31536000;
rewrite /scorm-proxy(.*) $1 break;
proxy_pass https://{%- if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com{%- endif %};
proxy_pass https://{%- if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }}{%- endif %};
}
{%- endif %}
spec:
Expand Down
4 changes: 2 additions & 2 deletions drydock/templates/drydock/k8s/ingress/lms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Authorization '';
proxy_set_header Host {% if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com{%- endif %};
proxy_set_header Host {% if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }}{%- endif %};
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
Expand All @@ -24,7 +24,7 @@ metadata:
proxy_intercept_errors on;
add_header Cache-Control max-age=31536000;
rewrite /scorm-proxy(.*) $1 break;
proxy_pass https://{%- if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.s3.amazonaws.com{%- endif %};
proxy_pass https://{%- if MINIO_HOST is defined %}{{ MINIO_HOST }}{% else %}{{ S3_STORAGE_BUCKET }}.{{ S3_HOST or 's3.amazonaws.com' }}{%- endif %};
}
{%- endif %}
spec:
Expand Down

0 comments on commit 399728a

Please sign in to comment.