Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0e90ee5f
Commit
0e90ee5f
authored
Feb 02, 2017
by
Jillian Vogel
Committed by
GitHub
Feb 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14015 from open-craft/haikuginger/add-swift-settings-to-cms
Add swift settings to CMS
parents
1912176c
9d5db5ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-0
cms/envs/aws.py
+3
-0
cms/envs/common.py
+4
-0
cms/envs/openstack.py
+24
-0
lms/envs/openstack.py
+2
-0
No files found.
cms/envs/aws.py
View file @
0e90ee5f
...
...
@@ -265,6 +265,9 @@ if FEATURES.get('AUTH_USE_CAS'):
CAS_ATTRIBUTE_CALLBACK
[
'function'
]
)
# Specific setting for the File Upload Service to store media in a bucket.
FILE_UPLOAD_STORAGE_BUCKET_NAME
=
ENV_TOKENS
.
get
(
'FILE_UPLOAD_STORAGE_BUCKET_NAME'
,
FILE_UPLOAD_STORAGE_BUCKET_NAME
)
FILE_UPLOAD_STORAGE_PREFIX
=
ENV_TOKENS
.
get
(
'FILE_UPLOAD_STORAGE_PREFIX'
,
FILE_UPLOAD_STORAGE_PREFIX
)
################ SECURE AUTH ITEMS ###############################
# Secret things: passwords, access keys, etc.
...
...
cms/envs/common.py
View file @
0e90ee5f
...
...
@@ -84,6 +84,10 @@ from lms.envs.common import (
# django-debug-toolbar
DEBUG_TOOLBAR_PATCH_SETTINGS
,
BLOCK_STRUCTURES_SETTINGS
,
# File upload defaults
FILE_UPLOAD_STORAGE_BUCKET_NAME
,
FILE_UPLOAD_STORAGE_PREFIX
,
)
from
path
import
Path
as
path
from
warnings
import
simplefilter
...
...
cms/envs/openstack.py
View file @
0e90ee5f
...
...
@@ -2,4 +2,28 @@
Settings for OpenStack deployments.
"""
# We import the aws settings because that's currently where the base settings are stored for all deployments.
# TODO - fix this when aws.py is split/renamed.
from
.aws
import
*
# pylint: disable=wildcard-import, unused-wildcard-import
SWIFT_AUTH_URL
=
AUTH_TOKENS
.
get
(
'SWIFT_AUTH_URL'
)
SWIFT_AUTH_VERSION
=
AUTH_TOKENS
.
get
(
'SWIFT_AUTH_VERSION'
,
1
)
SWIFT_USERNAME
=
AUTH_TOKENS
.
get
(
'SWIFT_USERNAME'
)
SWIFT_KEY
=
AUTH_TOKENS
.
get
(
'SWIFT_KEY'
)
SWIFT_TENANT_NAME
=
AUTH_TOKENS
.
get
(
'SWIFT_TENANT_NAME'
)
SWIFT_TENANT_ID
=
AUTH_TOKENS
.
get
(
'SWIFT_TENANT_ID'
)
SWIFT_CONTAINER_NAME
=
FILE_UPLOAD_STORAGE_BUCKET_NAME
SWIFT_NAME_PREFIX
=
FILE_UPLOAD_STORAGE_PREFIX
SWIFT_USE_TEMP_URLS
=
AUTH_TOKENS
.
get
(
'SWIFT_USE_TEMP_URLS'
,
False
)
SWIFT_TEMP_URL_KEY
=
AUTH_TOKENS
.
get
(
'SWIFT_TEMP_URL_KEY'
)
SWIFT_TEMP_URL_DURATION
=
AUTH_TOKENS
.
get
(
'SWIFT_TEMP_URL_DURATION'
,
1800
)
# seconds
if
AUTH_TOKENS
.
get
(
'SWIFT_REGION_NAME'
):
SWIFT_EXTRA_OPTIONS
=
{
'region_name'
:
AUTH_TOKENS
[
'SWIFT_REGION_NAME'
]}
if
AUTH_TOKENS
.
get
(
'DEFAULT_FILE_STORAGE'
):
DEFAULT_FILE_STORAGE
=
AUTH_TOKENS
.
get
(
'DEFAULT_FILE_STORAGE'
)
elif
SWIFT_AUTH_URL
and
SWIFT_USERNAME
and
SWIFT_KEY
:
DEFAULT_FILE_STORAGE
=
'swift.storage.SwiftStorage'
else
:
DEFAULT_FILE_STORAGE
=
'django.core.files.storage.FileSystemStorage'
lms/envs/openstack.py
View file @
0e90ee5f
...
...
@@ -2,6 +2,8 @@
Settings for OpenStack deployments.
"""
# We import the aws settings because that's currently where the base settings are stored for all deployments.
# TODO - fix this when aws.py is split/renamed.
from
.aws
import
*
# pylint: disable=wildcard-import, unused-wildcard-import
SWIFT_AUTH_URL
=
AUTH_TOKENS
.
get
(
'SWIFT_AUTH_URL'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment