Skip to content

Commit

Permalink
feat: add new private bucket for openedx-learning
Browse files Browse the repository at this point in the history
- add a new bucket to handle private media for openedx-learning.
- add changelog entry.
  • Loading branch information
Muhammad Faraz Maqsood authored and Muhammad Faraz Maqsood committed Nov 15, 2024
1 parent cf729fb commit 0e1370e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Feature] Add a new bucket to handle private media for openedx-learning. (by @Faraz32123)
4 changes: 4 additions & 0 deletions tutorminio/patches/openedx-common-settings
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ VIDEO_IMAGE_SETTINGS["STORAGE_KWARGS"]["location"] = VIDEO_IMAGE_SETTINGS["STORA
VIDEO_TRANSCRIPTS_SETTINGS["STORAGE_KWARGS"]["location"] = VIDEO_TRANSCRIPTS_SETTINGS["STORAGE_KWARGS"]["location"].lstrip("/")
GRADES_DOWNLOAD["STORAGE_KWARGS"] = {"location": GRADES_DOWNLOAD["STORAGE_KWARGS"]["location"].lstrip("/")}
GRADES_DOWNLOAD["STORAGE_KWARGS"]["bucket_name"] = "{{ MINIO_GRADES_BUCKET_NAME }}"
OPENEDX_LEARNING["MEDIA"]["BACKEND"] = DEFAULT_FILE_STORAGE
OPENEDX_LEARNING["MEDIA"]["OPTIONS"] = {
'bucket_name': "{{ MINIO_OPENEDX_LEARNING_BUCKET_NAME }}",
}

# Ora2 setting
ORA2_FILEUPLOAD_BACKEND = "s3"
Expand Down
1 change: 1 addition & 0 deletions tutorminio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"VIDEO_UPLOAD_BUCKET_NAME": "openedxvideos",
"HOST": "files.{{ LMS_HOST }}",
"CONSOLE_HOST": "minio.{{ LMS_HOST }}",
"OPENEDX_LEARNING_BUCKET_NAME": "openedxlearning",
"GRADES_BUCKET_NAME": "openedxgrades",
"QUERYSTRING_AUTH": True,
# https://hub.docker.com/r/minio/minio/tags
Expand Down
2 changes: 1 addition & 1 deletion tutorminio/templates/minio/tasks/minio/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mc config host add minio http://minio:9000 {{ OPENEDX_AWS_ACCESS_KEY }} {{ OPENEDX_AWS_SECRET_ACCESS_KEY }} --api s3v4
mc mb --ignore-existing minio/{{ MINIO_BUCKET_NAME }} minio/{{ MINIO_FILE_UPLOAD_BUCKET_NAME }} minio/{{ MINIO_VIDEO_UPLOAD_BUCKET_NAME }} minio/{{ MINIO_GRADES_BUCKET_NAME }}
mc mb --ignore-existing minio/{{ MINIO_BUCKET_NAME }} minio/{{ MINIO_FILE_UPLOAD_BUCKET_NAME }} minio/{{ MINIO_VIDEO_UPLOAD_BUCKET_NAME }} minio/{{ MINIO_GRADES_BUCKET_NAME }} minio/{{ MINIO_OPENEDX_LEARNING_BUCKET_NAME }}

{% if MINIO_GATEWAY != "azure" %}
# Make common file upload bucket public (e.g: for forum image upload)
Expand Down

0 comments on commit 0e1370e

Please sign in to comment.