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
f525b17b
Commit
f525b17b
authored
Feb 01, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8 cleanup
parent
8b012989
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
cms/envs/aws.py
+5
-4
lms/envs/aws.py
+13
-9
No files found.
cms/envs/aws.py
View file @
f525b17b
...
@@ -20,7 +20,7 @@ CONFIG_PREFIX = ""
...
@@ -20,7 +20,7 @@ CONFIG_PREFIX = ""
if
SERVICE_VARIANT
:
if
SERVICE_VARIANT
:
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
###############
################
ALWAYS THE SAME ################################
############### ALWAYS THE SAME ################################
DEBUG
=
False
DEBUG
=
False
TEMPLATE_DEBUG
=
False
TEMPLATE_DEBUG
=
False
...
@@ -28,7 +28,7 @@ EMAIL_BACKEND = 'django_ses.SESBackend'
...
@@ -28,7 +28,7 @@ EMAIL_BACKEND = 'django_ses.SESBackend'
SESSION_ENGINE
=
'django.contrib.sessions.backends.cache'
SESSION_ENGINE
=
'django.contrib.sessions.backends.cache'
DEFAULT_FILE_STORAGE
=
'storages.backends.s3boto.S3BotoStorage'
DEFAULT_FILE_STORAGE
=
'storages.backends.s3boto.S3BotoStorage'
#############
##############
NON-SECURE ENV CONFIG ##############################
############# NON-SECURE ENV CONFIG ##############################
# Things like server locations, ports, etc.
# Things like server locations, ports, etc.
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
ENV_TOKENS
=
json
.
load
(
env_file
)
ENV_TOKENS
=
json
.
load
(
env_file
)
...
@@ -49,13 +49,14 @@ for feature, value in ENV_TOKENS.get('MITX_FEATURES', {}).items():
...
@@ -49,13 +49,14 @@ for feature, value in ENV_TOKENS.get('MITX_FEATURES', {}).items():
LOGGING
=
get_logger_config
(
LOG_DIR
,
LOGGING
=
get_logger_config
(
LOG_DIR
,
logging_env
=
ENV_TOKENS
[
'LOGGING_ENV'
],
logging_env
=
ENV_TOKENS
[
'LOGGING_ENV'
],
syslog_addr
=
(
ENV_TOKENS
[
'SYSLOG_SERVER'
],
514
),
syslog_addr
=
(
ENV_TOKENS
[
'SYSLOG_SERVER'
],
514
),
debug
=
False
)
debug
=
False
,
service_variant
=
SERVICE_VARIANT
)
with
open
(
ENV_ROOT
/
"repos.json"
)
as
repos_file
:
with
open
(
ENV_ROOT
/
"repos.json"
)
as
repos_file
:
REPOS
=
json
.
load
(
repos_file
)
REPOS
=
json
.
load
(
repos_file
)
################
##############
SECURE AUTH ITEMS ###############################
################ SECURE AUTH ITEMS ###############################
# Secret things: passwords, access keys, etc.
# Secret things: passwords, access keys, etc.
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
AUTH_TOKENS
=
json
.
load
(
auth_file
)
AUTH_TOKENS
=
json
.
load
(
auth_file
)
...
...
lms/envs/aws.py
View file @
f525b17b
...
@@ -26,7 +26,7 @@ if SERVICE_VARIANT:
...
@@ -26,7 +26,7 @@ if SERVICE_VARIANT:
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
###################
############
ALWAYS THE SAME ################################
################### ALWAYS THE SAME ################################
DEBUG
=
False
DEBUG
=
False
TEMPLATE_DEBUG
=
False
TEMPLATE_DEBUG
=
False
...
@@ -40,11 +40,12 @@ MITX_FEATURES['ENABLE_DISCUSSION_SERVICE'] = True
...
@@ -40,11 +40,12 @@ MITX_FEATURES['ENABLE_DISCUSSION_SERVICE'] = True
# IMPORTANT: With this enabled, the server must always be behind a proxy that
# IMPORTANT: With this enabled, the server must always be behind a proxy that
# strips the header HTTP_X_FORWARDED_PROTO from client requests. Otherwise,
# strips the header HTTP_X_FORWARDED_PROTO from client requests. Otherwise,
# a user can fool our server into thinking it was an https connection.
# a user can fool our server into thinking it was an https connection.
# See https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
# See
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
# for other warnings.
# for other warnings.
SECURE_PROXY_SSL_HEADER
=
(
'HTTP_X_FORWARDED_PROTO'
,
'https'
)
SECURE_PROXY_SSL_HEADER
=
(
'HTTP_X_FORWARDED_PROTO'
,
'https'
)
#################
##########
NON-SECURE ENV CONFIG ##############################
################# NON-SECURE ENV CONFIG ##############################
# Things like server locations, ports, etc.
# Things like server locations, ports, etc.
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
...
@@ -70,16 +71,17 @@ LOGGING = get_logger_config(LOG_DIR,
...
@@ -70,16 +71,17 @@ LOGGING = get_logger_config(LOG_DIR,
logging_env
=
ENV_TOKENS
[
'LOGGING_ENV'
],
logging_env
=
ENV_TOKENS
[
'LOGGING_ENV'
],
syslog_addr
=
(
ENV_TOKENS
[
'SYSLOG_SERVER'
],
514
),
syslog_addr
=
(
ENV_TOKENS
[
'SYSLOG_SERVER'
],
514
),
local_loglevel
=
local_loglevel
,
local_loglevel
=
local_loglevel
,
debug
=
False
)
debug
=
False
,
service_variant
=
SERVICE_VARIANT
)
COURSE_LISTINGS
=
ENV_TOKENS
.
get
(
'COURSE_LISTINGS'
,
{})
COURSE_LISTINGS
=
ENV_TOKENS
.
get
(
'COURSE_LISTINGS'
,
{})
SUBDOMAIN_BRANDING
=
ENV_TOKENS
.
get
(
'SUBDOMAIN_BRANDING'
,
{})
SUBDOMAIN_BRANDING
=
ENV_TOKENS
.
get
(
'SUBDOMAIN_BRANDING'
,
{})
VIRTUAL_UNIVERSITIES
=
ENV_TOKENS
.
get
(
'VIRTUAL_UNIVERSITIES'
,
[])
VIRTUAL_UNIVERSITIES
=
ENV_TOKENS
.
get
(
'VIRTUAL_UNIVERSITIES'
,
[])
COMMENTS_SERVICE_URL
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_URL"
,
''
)
COMMENTS_SERVICE_URL
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_URL"
,
''
)
COMMENTS_SERVICE_KEY
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_KEY"
,
''
)
COMMENTS_SERVICE_KEY
=
ENV_TOKENS
.
get
(
"COMMENTS_SERVICE_KEY"
,
''
)
CERT_QUEUE
=
ENV_TOKENS
.
get
(
"CERT_QUEUE"
,
'test-pull'
)
CERT_QUEUE
=
ENV_TOKENS
.
get
(
"CERT_QUEUE"
,
'test-pull'
)
############################## SECURE AUTH ITEMS ###############
################
############################## SECURE AUTH ITEMS ###############
# Secret things: passwords, access keys, etc.
# Secret things: passwords, access keys, etc.
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
with
open
(
ENV_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
AUTH_TOKENS
=
json
.
load
(
auth_file
)
AUTH_TOKENS
=
json
.
load
(
auth_file
)
...
@@ -99,8 +101,10 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE']
...
@@ -99,8 +101,10 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE']
MODULESTORE
=
AUTH_TOKENS
.
get
(
'MODULESTORE'
,
MODULESTORE
)
MODULESTORE
=
AUTH_TOKENS
.
get
(
'MODULESTORE'
,
MODULESTORE
)
CONTENTSTORE
=
AUTH_TOKENS
.
get
(
'CONTENTSTORE'
,
CONTENTSTORE
)
CONTENTSTORE
=
AUTH_TOKENS
.
get
(
'CONTENTSTORE'
,
CONTENTSTORE
)
STAFF_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'STAFF_GRADING_INTERFACE'
,
STAFF_GRADING_INTERFACE
)
STAFF_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'STAFF_GRADING_INTERFACE'
,
PEER_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'PEER_GRADING_INTERFACE'
,
PEER_GRADING_INTERFACE
)
STAFF_GRADING_INTERFACE
)
PEER_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'PEER_GRADING_INTERFACE'
,
PEER_GRADING_INTERFACE
)
PEARSON_TEST_USER
=
"pearsontest"
PEARSON_TEST_USER
=
"pearsontest"
PEARSON_TEST_PASSWORD
=
AUTH_TOKENS
.
get
(
"PEARSON_TEST_PASSWORD"
)
PEARSON_TEST_PASSWORD
=
AUTH_TOKENS
.
get
(
"PEARSON_TEST_PASSWORD"
)
...
...
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