From 13410d897f63bff5edff649b8d882304aab0f4bd Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Tue, 29 Oct 2024 15:58:52 +0500 Subject: [PATCH] fix: add PROFILE_IMAGE_BACKEND settings for k8s - Add PROFILE_IMAGE_BACKEND settings in tutor-minio using patch named `openedx-lms-production-settings` so that profile images persist in k8s deployment of openedx and profile images can work now for both local(will use minio storage if minio plugin is enabled) and dev environment. - In case of dev environment, backend expects the valid S3 `base_url` key in the PROFILE_IMAGE_BACKEND settings. It will be using openedx `DEFAULT_FILE_STORAGE`. --- changelog.d/20241010_170607_faraz.maqsood.md | 1 + tutorminio/patches/openedx-lms-production-settings | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 changelog.d/20241010_170607_faraz.maqsood.md create mode 100644 tutorminio/patches/openedx-lms-production-settings diff --git a/changelog.d/20241010_170607_faraz.maqsood.md b/changelog.d/20241010_170607_faraz.maqsood.md new file mode 100644 index 0000000..8ebdb22 --- /dev/null +++ b/changelog.d/20241010_170607_faraz.maqsood.md @@ -0,0 +1 @@ +- [BugFix] Add PROFILE_IMAGE_BACKEND settings in minio using patch named `openedx-lms-production-settings` so that profile images persist in k8s deployment of openedx and profile images can work for both local and dev environment. (by @Faraz32123) diff --git a/tutorminio/patches/openedx-lms-production-settings b/tutorminio/patches/openedx-lms-production-settings new file mode 100644 index 0000000..c1e71d1 --- /dev/null +++ b/tutorminio/patches/openedx-lms-production-settings @@ -0,0 +1,9 @@ +# LMS-specific media storage +PROFILE_IMAGE_BACKEND = { + "class": DEFAULT_FILE_STORAGE, + "options": { + "bucket_name": "{{ MINIO_BUCKET_NAME }}", # Ensure this is set correctly + "querystring_auth": False, + "location": "profile_images/", # Set a valid location if needed + }, +}