AWS settings for XBlocks to have filesystem-like storage
Upgrades to latest pyfs to support auth not through environment variables
This commit is contained in:
@@ -213,6 +213,16 @@ if FEATURES.get('AUTH_USE_CAS'):
|
||||
with open(CONFIG_ROOT / CONFIG_PREFIX + "auth.json") as auth_file:
|
||||
AUTH_TOKENS = json.load(auth_file)
|
||||
|
||||
############### XBlock filesystem field config ##########
|
||||
if 'XBLOCK-FS-STORAGE-BUCKET' in ENV_TOKENS:
|
||||
DJFS = {
|
||||
'type' : 's3fs',
|
||||
'bucket' : ENV_TOKENS.get('XBLOCK-FS-STORAGE-BUCKET', None),
|
||||
'prefix' : ENV_TOKENS.get('XBLOCK-FS-STORAGE-PREFIX', '/xblock-storage/')
|
||||
}
|
||||
DJFS['aws_access_key_id'] = AUTH_TOKENS.get('AWS_ACCESS_KEY_ID', None)
|
||||
DJFS['aws_secret_access_key'] = AUTH_TOKENS.get('AWS_SECRET_ACCESS_KEY', None)
|
||||
|
||||
EMAIL_HOST_USER = AUTH_TOKENS.get('EMAIL_HOST_USER', EMAIL_HOST_USER)
|
||||
EMAIL_HOST_PASSWORD = AUTH_TOKENS.get('EMAIL_HOST_PASSWORD', EMAIL_HOST_PASSWORD)
|
||||
|
||||
|
||||
@@ -298,6 +298,16 @@ VIDEO_CDN_URL = ENV_TOKENS.get('VIDEO_CDN_URL', {})
|
||||
with open(CONFIG_ROOT / CONFIG_PREFIX + "auth.json") as auth_file:
|
||||
AUTH_TOKENS = json.load(auth_file)
|
||||
|
||||
############### XBlock filesystem field config ##########
|
||||
if 'XBLOCK-FS-STORAGE-BUCKET' in ENV_TOKENS:
|
||||
DJFS = {
|
||||
'type' : 's3fs',
|
||||
'bucket' : ENV_TOKENS.get('XBLOCK-FS-STORAGE-BUCKET', None),
|
||||
'prefix' : ENV_TOKENS.get('XBLOCK-FS-STORAGE-PREFIX', '/xblock-storage/')
|
||||
}
|
||||
DJFS['aws_access_key_id'] = AUTH_TOKENS.get('AWS_ACCESS_KEY_ID', None)
|
||||
DJFS['aws_secret_access_key'] = AUTH_TOKENS.get('AWS_SECRET_ACCESS_KEY', None)
|
||||
|
||||
############### Module Store Items ##########
|
||||
HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS = ENV_TOKENS.get('HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS', {})
|
||||
|
||||
|
||||
@@ -139,4 +139,4 @@ git+https://github.com/mitocw/django-cas.git
|
||||
# edX packages
|
||||
edx-submissions==0.0.7
|
||||
|
||||
-e git+https://github.com/pmitros/django-pyfs.git@514607d78535fd80bfd23184cd292ee5799b500d#egg=djpyfs
|
||||
-e git+https://github.com/pmitros/django-pyfs.git@36f64c0f1f458ce7b9ecb2347667b202d13a8317#egg=djpyfs
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
-e git+https://github.com/pmitros/DoneXBlock.git@1ce0ac14d9f3df3083b951262ec82e84b58d16d1#egg=done-xblock
|
||||
-e git+https://github.com/pmitros/AudioXBlock.git@1fbf19cc21613aead62799469e1593adb037fdd9#egg=audio-xblock
|
||||
-e git+https://github.com/pmitros/AnimationXBlock.git@d2b551bb8f49a138088e10298576102164145b87#egg=animation-xblock
|
||||
-e git+https://github.com/pmitros/ProfileXBlock.git@1ede6341c96c7d4a8e5942e7085e859de762f128#egg=profile-xblock
|
||||
-e git+https://github.com/pmitros/ProfileXBlock.git@4aeaa24aa2bc7d9cb2d2bb60d6f05def3b856be0#egg=profile-xblock
|
||||
|
||||
# This XBlock shows a list of recommendations.
|
||||
# It is an R&D prototype, intended for roll-out one location in one course.
|
||||
|
||||
Reference in New Issue
Block a user