6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-13 14:43:03 +00:00
tutor/plugins/minio/tutorminio/plugin.py
Régis Behmo 931dac2e68 Add pre-init hook
The 0003 migration from the certificates app of the LMS requires that
the S3-like platform is correctly setup during initialisation. To solve
this issue, we introduce a pre-init hook that is run prior to the LMS
migrations.
2019-07-05 14:19:23 +08:00

41 lines
1.1 KiB
Python

import os
from glob import glob
HERE = os.path.abspath(os.path.dirname(__file__))
config = {
"set": {
"OPENEDX_AWS_ACCESS_KEY": "openedx",
"OPENEDX_AWS_SECRET_ACCESS_KEY": "{{ 24|random_string }}",
},
"defaults": {
"BUCKET_NAME": "openedx",
"FILE_UPLOAD_BUCKET_NAME": "openedxuploads",
"COURSE_IMPORT_EXPORT_BUCKET": "openedxcourseimportexport",
"HOST": "minio.{{ LMS_HOST }}",
"DOCKER_REGISTRY": "{{ DOCKER_REGISTRY }}",
"DOCKER_IMAGE_CLIENT": "minio/mc:RELEASE.2019-05-23T01-33-27Z",
"DOCKER_IMAGE_SERVER": "minio/minio:RELEASE.2019-05-23T00-29-34Z",
},
}
templates = os.path.join(HERE, "templates")
hooks = {
"pre-init": ["minio-client"],
"remote-image": {
"minio-server": "{{ MINIO_DOCKER_IMAGE_SERVER }}",
"minio-client": "{{ MINIO_DOCKER_IMAGE_CLIENT }}",
},
}
def patches():
all_patches = {}
for path in glob(os.path.join(HERE, "patches", "*")):
with open(path) as patch_file:
name = os.path.basename(path)
content = patch_file.read()
all_patches[name] = content
return all_patches