Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: S3_HOST for alternative S3-compatible services #120

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

jfavellar90
Copy link
Member

When enabling SCORM features, a set of patches are applied on caddy/ingress objects so the LMS/CMS services are used as proxies to serve SCORM resources. The backend for such proxies is the storage system used in an installation, generally MinIO, AWS S3, or an S3-compatible storage system.

When using tutor-contrib-s3, we hardcode the backend URL for SCORM to {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com. However, you can use this plugin with other S3-compatible systems, not only AWS, thus we need to provide flexibility to replace the s3.amazonaws.com domain with the custom storage system domain.

This PR aims to provide such flexibility and set the backend URL for SCORM to {{ S3_STORAGE_BUCKET }}.{{ S3_HOST|default('s3.amazonaws.com', true) }}. This will use the S3_HOST variable as the domain if it is non-empty. Otherwise, it will fall back to S3 default domain (s3.amazonaws.com)

@jfavellar90 jfavellar90 requested a review from a team as a code owner July 5, 2024 21:21
@jfavellar90 jfavellar90 requested review from Ian2012 and Henrrypg July 5, 2024 21:21
Copy link
Contributor

@Henrrypg Henrrypg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jfavellar90 jfavellar90 merged commit 08d2ef3 into main Jul 5, 2024
4 checks passed
@jfavellar90 jfavellar90 deleted the Jhony/s3_host_fix branch July 5, 2024 21:50
This was referenced Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants