Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
OpenEdx
configuration
Commits
872672aa
Commit
872672aa
authored
Nov 26, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #497 from edx/jarv/better-basic-auth
Make basic_auth a global nginx parameter
parents
c8914619
c63f18c2
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
36 additions
and
36 deletions
+36
-36
playbooks/edx-east/deploy_nginx_all_roles.yml
+18
-0
playbooks/roles/discern/defaults/main.yml
+0
-1
playbooks/roles/edxapp/defaults/main.yml
+0
-3
playbooks/roles/nginx/defaults/main.yml
+7
-7
playbooks/roles/nginx/tasks/main.yml
+8
-6
playbooks/roles/nginx/templates/basic-auth.j2
+3
-1
playbooks/roles/nginx/templates/cms.j2
+0
-2
playbooks/roles/nginx/templates/discern.j2
+0
-2
playbooks/roles/nginx/templates/lms-preview.j2
+0
-2
playbooks/roles/nginx/templates/lms.j2
+0
-3
playbooks/roles/nginx/templates/ora.j2
+0
-2
playbooks/roles/nginx/templates/xqueue.j2
+0
-2
playbooks/roles/nginx/templates/xserver.j2
+0
-2
playbooks/roles/ora/defaults/main.yml
+0
-1
playbooks/roles/xqueue/defaults/main.yml
+0
-1
playbooks/roles/xserver/defaults/main.yml
+0
-1
No files found.
playbooks/edx-east/deploy_nginx_all_roles.yml
0 → 100644
View file @
872672aa
-
name
:
Configure instance(s)
hosts
:
all
sudo
:
True
gather_facts
:
False
vars_files
:
-
roles/edxapp/defaults/main.yml
-
roles/ora/defaults/main.yml
-
roles/xqueue/defaults/main.yml
-
roles/xserver/defaults/main.yml
roles
:
-
common
-
role
:
nginx
nginx_sites
:
-
cms
-
lms
-
ora
-
xqueue
-
xserver
playbooks/roles/discern/defaults/main.yml
View file @
872672aa
DISCERN_NGINX_PORT
:
18070
DISCERN_NGINX_PORT
:
18070
DISCERN_BASIC_AUTH
:
False
DISCERN_MEMCACHE
:
[
'
localhost:11211'
]
DISCERN_MEMCACHE
:
[
'
localhost:11211'
]
DISCERN_AWS_ACCESS_KEY_ID
:
"
"
DISCERN_AWS_ACCESS_KEY_ID
:
"
"
DISCERN_AWS_SECRET_ACCESS_KEY
:
"
"
DISCERN_AWS_SECRET_ACCESS_KEY
:
"
"
...
...
playbooks/roles/edxapp/defaults/main.yml
View file @
872672aa
...
@@ -89,9 +89,6 @@ EDXAPP_LMS_NGINX_PORT: 18000
...
@@ -89,9 +89,6 @@ EDXAPP_LMS_NGINX_PORT: 18000
EDXAPP_LMS_PREVIEW_NGINX_PORT
:
18020
EDXAPP_LMS_PREVIEW_NGINX_PORT
:
18020
EDXAPP_CMS_NGINX_PORT
:
18010
EDXAPP_CMS_NGINX_PORT
:
18010
EDXAPP_LMS_BASIC_AUTH
:
False
EDXAPP_CMS_BASIC_AUTH
:
False
EDXAPP_LMS_PREVIEW_BASIC_AUTH
:
False
EDXAPP_LANG
:
'
en_US.UTF-8'
EDXAPP_LANG
:
'
en_US.UTF-8'
EDXAPP_TIME_ZONE
:
'
America/New_York'
EDXAPP_TIME_ZONE
:
'
America/New_York'
...
...
playbooks/roles/nginx/defaults/main.yml
View file @
872672aa
# Variables for nginx role
# Variables for nginx role
---
---
# Set global htaccess for nginx
NGINX_HTPASSWD_USER
:
!!null
NGINX_HTPASSWD_PASS
:
!!null
nginx_app_dir
:
"
{{
COMMON_APP_DIR
}}/nginx"
nginx_app_dir
:
"
{{
COMMON_APP_DIR
}}/nginx"
nginx_data_dir
:
"
{{
COMMON_DATA_DIR
}}/nginx"
nginx_data_dir
:
"
{{
COMMON_DATA_DIR
}}/nginx"
...
@@ -8,10 +11,11 @@ nginx_log_dir: "{{ COMMON_LOG_DIR }}/nginx"
...
@@ -8,10 +11,11 @@ nginx_log_dir: "{{ COMMON_LOG_DIR }}/nginx"
nginx_sites_available_dir
:
"
{{
nginx_app_dir
}}/sites-available"
nginx_sites_available_dir
:
"
{{
nginx_app_dir
}}/sites-available"
nginx_sites_enabled_dir
:
"
{{
nginx_app_dir
}}/sites-enabled"
nginx_sites_enabled_dir
:
"
{{
nginx_app_dir
}}/sites-enabled"
nginx_user
:
root
nginx_user
:
root
nginx_htpasswd_file
:
"
{{
nginx_app_dir
}}/nginx.htpasswd"
pkgs
:
nginx_debian_
pkgs
:
nginx
:
-
nginx
state
:
installed
-
python-passlib
nginx_xserver_gunicorn_hosts
:
nginx_xserver_gunicorn_hosts
:
-
127.0.0.1
-
127.0.0.1
...
@@ -36,7 +40,3 @@ nginx_cfg:
...
@@ -36,7 +40,3 @@ nginx_cfg:
# nginx configuration
# nginx configuration
version_html
:
"
{{
nginx_app_dir
}}/versions.html"
version_html
:
"
{{
nginx_app_dir
}}/versions.html"
version_json
:
"
{{
nginx_app_dir
}}/versions.json"
version_json
:
"
{{
nginx_app_dir
}}/versions.json"
# default htpasswd contents set to edx/edx
# this value can be overiden in vars/secure/<group>.yml
htpasswd
:
|
edx:$apr1$2gWcIvlc$Nu7b/KTwd5HoIDEkSPNUk/
playbooks/roles/nginx/tasks/main.yml
View file @
872672aa
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
-
"
{{
nginx_log_dir
}}"
-
"
{{
nginx_log_dir
}}"
notify
:
nginx | restart nginx
notify
:
nginx | restart nginx
-
name
:
nginx | Install nginx
-
name
:
nginx | Install nginx
packages
apt
:
pkg=
nginx state={{ pkgs.nginx.state }}
apt
:
pkg=
{{','.join(nginx_debian_pkgs)}} state=present
notify
:
nginx | restart nginx
notify
:
nginx | restart nginx
-
name
:
nginx | Server configuration file
-
name
:
nginx | Server configuration file
...
@@ -63,10 +63,12 @@
...
@@ -63,10 +63,12 @@
notify
:
nginx | reload nginx
notify
:
nginx | reload nginx
with_items
:
nginx_sites
with_items
:
nginx_sites
-
name
:
nginx | Write out default htpasswd file
-
name
:
nginx | Write out htpasswd file
copy
:
>
htpasswd
:
>
content={{ nginx_cfg.htpasswd }} dest={{ nginx_app_dir }}/nginx.htpasswd
name={{ NGINX_HTPASSWD_USER }}
owner=www-data group=www-data mode=0600
password={{ NGINX_HTPASSWD_PASS }}
path={{ nginx_htpasswd_file }}
when
:
NGINX_HTPASSWD_USER and NGINX_HTPASSWD_PASS
-
name
:
nginx | Create nginx log file location (just in case)
-
name
:
nginx | Create nginx log file location (just in case)
file
:
>
file
:
>
...
...
playbooks/roles/nginx/templates/basic-auth.j2
View file @
872672aa
{% if NGINX_HTPASSWD_USER and NGINX_HTPASSWD_PASS %}
auth_basic "Restricted";
auth_basic "Restricted";
auth_basic_user_file {{ nginx_
app_dir }}/nginx.htpasswd
;
auth_basic_user_file {{ nginx_
htpasswd_file }}
;
index index.html
index index.html
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Proto https;
{% endif %}
playbooks/roles/nginx/templates/cms.j2
View file @
872672aa
...
@@ -32,9 +32,7 @@ server {
...
@@ -32,9 +32,7 @@ server {
}
}
location / {
location / {
{% if EDXAPP_CMS_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_cms_app;
try_files $uri @proxy_to_cms_app;
}
}
...
...
playbooks/roles/nginx/templates/discern.j2
View file @
872672aa
...
@@ -20,9 +20,7 @@ server {
...
@@ -20,9 +20,7 @@ server {
}
}
location / {
location / {
{% if DISCERN_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
...
...
playbooks/roles/nginx/templates/lms-preview.j2
View file @
872672aa
...
@@ -30,9 +30,7 @@ server {
...
@@ -30,9 +30,7 @@ server {
location / {
location / {
{% if EDXAPP_LMS_PREVIEW_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms-preview_app;
try_files $uri @proxy_to_lms-preview_app;
}
}
...
...
playbooks/roles/nginx/templates/lms.j2
View file @
872672aa
...
@@ -31,10 +31,7 @@ server {
...
@@ -31,10 +31,7 @@ server {
}
}
location / {
location / {
{% if EDXAPP_LMS_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms_app;
try_files $uri @proxy_to_lms_app;
}
}
...
...
playbooks/roles/nginx/templates/ora.j2
View file @
872672aa
...
@@ -9,9 +9,7 @@ server {
...
@@ -9,9 +9,7 @@ server {
location / {
location / {
{% if ORA_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
try_files $uri @proxy_to_app;
}
}
...
...
playbooks/roles/nginx/templates/xqueue.j2
View file @
872672aa
...
@@ -8,9 +8,7 @@ server {
...
@@ -8,9 +8,7 @@ server {
listen {{ XQUEUE_NGINX_PORT }} default_server;
listen {{ XQUEUE_NGINX_PORT }} default_server;
location / {
location / {
{% if XQUEUE_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
try_files $uri @proxy_to_app;
}
}
...
...
playbooks/roles/nginx/templates/xserver.j2
View file @
872672aa
...
@@ -18,9 +18,7 @@ server {
...
@@ -18,9 +18,7 @@ server {
listen {{ XSERVER_NGINX_PORT }} default_server;
listen {{ XSERVER_NGINX_PORT }} default_server;
location / {
location / {
{% if XSERVER_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
try_files $uri @proxy_to_app;
}
}
...
...
playbooks/roles/ora/defaults/main.yml
View file @
872672aa
# vars for the ORA role
# vars for the ORA role
---
---
ORA_NGINX_PORT
:
18060
ORA_NGINX_PORT
:
18060
ORA_BASIC_AUTH
:
False
ora_app_dir
:
"
{{
COMMON_APP_DIR
}}/ora"
ora_app_dir
:
"
{{
COMMON_APP_DIR
}}/ora"
ora_code_dir
:
"
{{
ora_app_dir
}}/ora"
ora_code_dir
:
"
{{
ora_app_dir
}}/ora"
...
...
playbooks/roles/xqueue/defaults/main.yml
View file @
872672aa
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
# when the role is included
# when the role is included
---
---
XQUEUE_NGINX_PORT
:
18040
XQUEUE_NGINX_PORT
:
18040
XQUEUE_BASIC_AUTH
:
False
xqueue_app_dir
:
"
{{
COMMON_APP_DIR
}}/xqueue"
xqueue_app_dir
:
"
{{
COMMON_APP_DIR
}}/xqueue"
xqueue_code_dir
:
"
{{
xqueue_app_dir
}}/xqueue"
xqueue_code_dir
:
"
{{
xqueue_app_dir
}}/xqueue"
...
...
playbooks/roles/xserver/defaults/main.yml
View file @
872672aa
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
---
---
XSERVER_NGINX_PORT
:
18050
XSERVER_NGINX_PORT
:
18050
XSERVER_BASIC_AUTH
:
False
XSERVER_RUN_URL
:
'
'
XSERVER_RUN_URL
:
'
'
XSERVER_LOGGING_ENV
:
'
sandbox'
XSERVER_LOGGING_ENV
:
'
sandbox'
...
...
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