fix: S3_HOST for alternative S3-compatible services #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thes3.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 theS3_HOST
variable as the domain if it is non-empty. Otherwise, it will fall back to S3 default domain (s3.amazonaws.com
)