6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 06:07:56 +00:00

Allow direct access to gunicorn process in production

This is not a security issue because ports 8000-8001 are not open to the
world; it should also drastically simplify the life of many people. See
for instance issues #30 and #34.

Also, we allow access to nginx on hostnames "localhost" and
"studio.localhost" for lms and cms, respectively. Again, this will
remove much of the confusion for many users.
This commit is contained in:
Régis Behmo 2018-06-08 17:21:08 -04:00
parent 8366376bd0
commit 5cb51e0334
6 changed files with 9 additions and 12 deletions

View File

@ -137,14 +137,6 @@ In addition to running Open edX in production, you can use the docker containers
(Note: containers are built on the Ginkgo release. If you are working on a different version of Open edX, you will have to rebuild the images with a different `EDX_PLATFORM_VERSION` argument. You may also want to change the `EDX_PLATFORM_REPOSITORY` argument to point to your own fork of edx-platform.)
First, configure your project such that the LMS and the CMS can be accessed locally:
make configure
...
Your website domain name for students (LMS) (default: "www.myopenedx.com"): localhost:8000
Your website domain name for teachers (CMS) (default: "studio.myopenedx.com"): localhost:8001
...
### Standard devstack
Define development settings (on the host):

View File

@ -1,6 +1,6 @@
server {
listen 80;
server_name £{CMS_HOST};
server_name studio.localhost £{CMS_HOST};
# Prevent invalid display courseware in IE 10+ with high privacy settings
add_header P3P 'CP="Open edX does not have a P3P policy."';

View File

@ -1,6 +1,6 @@
server {
listen 80;
server_name £{LMS_HOST} preview.£{LMS_HOST};
server_name localhost £{LMS_HOST} preview.£{LMS_HOST};
# Prevent invalid display courseware in IE 10+ with high privacy settings
add_header P3P 'CP="Open edX does not have a P3P policy."';

View File

@ -20,6 +20,9 @@ for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
ALLOWED_HOSTS = [
ENV_TOKENS.get('CMS_BASE'),
'127.0.0.1', 'localhost', 'studio.localhost',
'127.0.0.1:8000', 'localhost:8000',
'127.0.0.1:8001', 'localhost:8001',
]
DEFAULT_FROM_EMAIL = 'registration@' + ENV_TOKENS['LMS_BASE']

View File

@ -21,6 +21,8 @@ for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
ALLOWED_HOSTS = [
ENV_TOKENS.get('LMS_BASE'),
FEATURES['PREVIEW_LMS_BASE'],
'127.0.0.1', 'localhost',
'127.0.0.1:8000', 'localhost:8000',
]
DEFAULT_FROM_EMAIL = 'registration@' + ENV_TOKENS['LMS_BASE']

4
configure vendored
View File

@ -115,9 +115,9 @@ def main():
defaults = json.load(f)
configurator = Configurator(silent=args.silent, **defaults).add(
'LMS_HOST', "Your website domain name for students (LMS). Set 'localhost' for local testing.", 'www.myopenedx.com'
'LMS_HOST', "Your website domain name for students (LMS).", 'www.myopenedx.com'
).add(
'CMS_HOST', "Your website domain name for teachers (CMS). Set 'studio.localhost' for local testing.", 'studio.myopenedx.com'
'CMS_HOST', "Your website domain name for teachers (CMS).", 'studio.myopenedx.com'
).add(
'PLATFORM_NAME', "Platform name/title", "My Open edX"
).add(