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
edc67b68
Commit
edc67b68
authored
May 03, 2016
by
Sven Marnach
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2481 from open-craft/smarnach/selective-http-auth
Allow enabling HTTP basic auth for individual services.
parents
fcb4d2ff
c44bf596
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
56 additions
and
13 deletions
+56
-13
playbooks/roles/nginx/defaults/main.yml
+25
-0
playbooks/roles/nginx/tasks/main.yml
+1
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/basic-auth.j2
+0
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/certs.j2
+3
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+3
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
+3
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/kibana.j2
+3
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
+3
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+6
-2
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
+3
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2
+3
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xserver.j2
+3
-1
No files found.
playbooks/roles/nginx/defaults/main.yml
View file @
edc67b68
...
...
@@ -128,3 +128,28 @@ nginx_cfg:
NGINX_ROBOT_RULES
:
[
]
NGINX_EDXAPP_EMBARGO_CIDRS
:
[]
NGINX_P3P_MESSAGE
:
'
CP="Open
edX
does
not
have
a
P3P
policy."'
COMMON_ENABLE_BASIC_AUTH
:
False
CERTS_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
ECOMMERCE_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
EDXAPP_CMS_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
EDXAPP_LMS_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
EDXAPP_LMS_PREVIEW_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
KIBANA_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
PROGRAMS_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
XQUEUE_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
XSERVER_ENABLE_BASIC_AUTH
:
"
{{
COMMON_ENABLE_BASIC_AUTH
}}"
NGINX_CREATE_HTPASSWD_FILE
:
>
{{
CERTS_ENABLE_BASIC_AUTH|bool or
ECOMMERCE_ENABLE_BASIC_AUTH|bool or
EDXAPP_CMS_ENABLE_BASIC_AUTH|bool or
EDXAPP_LMS_ENABLE_BASIC_AUTH|bool or
EDXAPP_LMS_PREVIEW_ENABLE_BASIC_AUTH|bool or
KIBANA_ENABLE_BASIC_AUTH|bool or
PROGRAMS_ENABLE_BASIC_AUTH|bool or
XQUEUE_ENABLE_BASIC_AUTH|bool or
XSERVER_ENABLE_BASIC_AUTH|bool
}}
playbooks/roles/nginx/tasks/main.yml
View file @
edc67b68
...
...
@@ -227,7 +227,7 @@
password={{ item.password }}
state={{ item.state }}
path={{ nginx_htpasswd_file }}
when
:
COMMON_ENABLE_BASIC_AUTH
when
:
NGINX_CREATE_HTPASSWD_FILE
tags
:
-
install
-
install:configuration
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/basic-auth.j2
View file @
edc67b68
{% if COMMON_ENABLE_BASIC_AUTH %}
satisfy any;
allow 127.0.0.1;
...
...
@@ -14,4 +13,3 @@
index index.html
proxy_set_header X-Forwarded-Proto https;
{% endif %}
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/certs.j2
View file @
edc67b68
...
...
@@ -3,8 +3,9 @@ server {
location / {
root {{ CERTS_WEB_ROOT }};
{% include "basic-auth.j2" %}
{% if CERTS_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri $uri/valid.html =404;
}
}
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
edc67b68
...
...
@@ -101,7 +101,9 @@ error_page {{ k }} {{ v }};
}
location / {
{% include "basic-auth.j2" %}
{% if EDXAPP_CMS_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_cms_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
View file @
edc67b68
...
...
@@ -63,6 +63,9 @@ server {
}
location / {
{% if ECOMMERCE_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/kibana.j2
View file @
edc67b68
...
...
@@ -57,7 +57,9 @@ server {
error_log {{ nginx_log_dir }}/kibana.error.log error;
# Access restriction
{% include "basic-auth.j2" %}
{% if KIBANA_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
# Set image format types to expire in a very long time
location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
View file @
edc67b68
...
...
@@ -37,8 +37,9 @@ server {
}
location / {
{% include "basic-auth.j2" %}
{% if EDXAPP_LMS_PREVIEW_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms-preview_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
edc67b68
...
...
@@ -119,7 +119,9 @@ error_page {{ k }} {{ v }};
}
location / {
{% include "basic-auth.j2" %}
{% if EDXAPP_LMS_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
{% if NGINX_EDXAPP_EMBARGO_CIDRS -%}
if ( $embargo ) {
return 302 /embargo;
...
...
@@ -206,7 +208,9 @@ error_page {{ k }} {{ v }};
error_page 503 = /server/rate-limit.html;
{%- endif -%}
{%- include "basic-auth.j2" %}
{% if EDXAPP_LMS_ENABLE_BASIC_AUTH|bool %}
{%- include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
View file @
edc67b68
...
...
@@ -79,6 +79,9 @@ server {
}
location / {
{% if PROGRAMS_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2
View file @
edc67b68
...
...
@@ -8,7 +8,9 @@ server {
listen {{ XQUEUE_NGINX_PORT }} default_server;
location / {
{% include "basic-auth.j2" %}
{% if XQUEUE_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xserver.j2
View file @
edc67b68
...
...
@@ -18,7 +18,9 @@ server {
listen {{ XSERVER_NGINX_PORT }} default_server;
location / {
{% include "basic-auth.j2" %}
{% if XSERVER_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
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