h5p plugin for Tutor
Project description
This plugin integrates H5P interactive content into Open edX by installing the h5pxblock XBlock into the LMS.
Beyond the XBlock itself, the plugin handles the additional configuration required to make H5P work correctly in Kubernetes environments where S3 is the storage backend: it rewrites H5P media URLs to go through the LMS host instead of hitting the S3 bucket directly, avoiding CORS and CSRF embedding issues that arise when browser requests cross from the LMS domain to the S3 domain. Both path-style and virtual-hosted (bucket-style) S3 URL formats are supported.
How it works
When S3 storage is configured, the plugin applies two changes:
LMS Django settings — H5PXBLOCK_STORAGE is configured to use S3Boto3Storage with custom_domain set to LMS_HOST. This causes the XBlock to generate media URLs that point to the LMS host instead of the S3 bucket.
Caddy reverse proxy — A /h5pxblockmedia/* route is added to the LMS Caddy configuration. Requests that arrive at this path are rewritten and proxied transparently to the S3 backend. The rewrite logic depends on the configured URL style:
Virtual-hosted style (default) — the bucket name is used as a subdomain of the S3 host (e.g. mybucket.s3.us-east-1.amazonaws.com).
Path style — the bucket name is prepended as a path segment (e.g. s3.us-east-1.amazonaws.com/mybucket).
Requirements
Tutor >= 21.0 (Sumac)
For S3 storage: tutor-contrib-s3 must be installed and properly configured before enabling this plugin.
Installation
pip install tutor-contrib-h5p
Usage
Enable the plugin and apply the configuration:
tutor plugins enable h5p
Then rebuild the Open edX image and restart your environment:
tutor images build openedx
tutor local launch # or: tutor k8s start
Configuration
All settings can be changed with tutor config save --set H5P_<KEY>=<value>.
Setting |
Default |
Description |
|---|---|---|
H5P_BUCKET |
S3_STORAGE_BUCKET |
S3 bucket that stores H5P media files. Defaults to the value of S3_STORAGE_BUCKET set by tutor-contrib-s3. |
H5P_ENDPOINT |
(empty) |
Custom S3-compatible endpoint hostname (e.g. minio.example.com). When empty, the plugin falls back to S3_HOST / S3_PORT from tutor-contrib-s3 or constructs the standard AWS endpoint from S3_REGION. |
H5P_URL_STYLE |
virtual |
S3 URL style. Use virtual for bucket-as-subdomain (bucket.host/key) or path for bucket-as-path (host/bucket/key). |
H5P_USE_SSL |
true |
Whether to use HTTPS when proxying requests to S3. |
H5P_PATH |
(empty) |
Optional key prefix inside the bucket where H5P files are stored. |
S3 URL style examples
Given bucket mybucket, region us-east-1, and a media key h5pxblockmedia/course/file.h5p:
Virtual-hosted style (H5P_URL_STYLE=virtual, default):
Proxy target: https://mybucket.s3.us-east-1.amazonaws.com/h5pxblockmedia/course/file.h5p
Path style (H5P_URL_STYLE=path):
Proxy target: https://s3.us-east-1.amazonaws.com/mybucket/h5pxblockmedia/course/file.h5p
License
This software is licensed under the terms of the AGPLv3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tutor_contrib_h5p-21.0.0.tar.gz.
File metadata
- Download URL: tutor_contrib_h5p-21.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac2e226832f5734570c9d8b7a1050d49e0f7d289ed199b661b62679d034b5e4d
|
|
| MD5 |
8f341e656bddeafbc1d321febe29bfc3
|
|
| BLAKE2b-256 |
5b473022088e395f7abce40fce277c8f884f89283169b0c4daba623ae24c18af
|
Provenance
The following attestation bundles were made for tutor_contrib_h5p-21.0.0.tar.gz:
Publisher:
publish.yml on aulasneo/tutor-contrib-h5p
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tutor_contrib_h5p-21.0.0.tar.gz -
Subject digest:
ac2e226832f5734570c9d8b7a1050d49e0f7d289ed199b661b62679d034b5e4d - Sigstore transparency entry: 1394008852
- Sigstore integration time:
-
Permalink:
aulasneo/tutor-contrib-h5p@f553ceb99b753e7309033d8ac1eb9a0b0d797b69 -
Branch / Tag:
refs/tags/v21.0.0 - Owner: https://github.com/aulasneo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f553ceb99b753e7309033d8ac1eb9a0b0d797b69 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tutor_contrib_h5p-21.0.0-py3-none-any.whl.
File metadata
- Download URL: tutor_contrib_h5p-21.0.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c53ddc1f4d1c40b1757fa84dd8d85a7147e075b319f7118bfb9a0b04e54a9462
|
|
| MD5 |
dea5625940bf0327399280669c1f1251
|
|
| BLAKE2b-256 |
bda062299ad303e6843b19ab4dc2882f78d4c66e0a29ee72775fe629919c03eb
|
Provenance
The following attestation bundles were made for tutor_contrib_h5p-21.0.0-py3-none-any.whl:
Publisher:
publish.yml on aulasneo/tutor-contrib-h5p
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tutor_contrib_h5p-21.0.0-py3-none-any.whl -
Subject digest:
c53ddc1f4d1c40b1757fa84dd8d85a7147e075b319f7118bfb9a0b04e54a9462 - Sigstore transparency entry: 1394008859
- Sigstore integration time:
-
Permalink:
aulasneo/tutor-contrib-h5p@f553ceb99b753e7309033d8ac1eb9a0b0d797b69 -
Branch / Tag:
refs/tags/v21.0.0 - Owner: https://github.com/aulasneo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f553ceb99b753e7309033d8ac1eb9a0b0d797b69 -
Trigger Event:
push
-
Statement type: