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
edx
configuration
Commits
ff670ea8
Commit
ff670ea8
authored
Nov 05, 2015
by
Fred Smith
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2322 from open-craft/smarnach/selective-http-auth
Allow enabling HTTP basic auth for individual services.
parents
1b238e30
369ed74e
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
50 additions
and
6 deletions
+50
-6
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
+2
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+2
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ecommerce.j2
+3
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/kibana.j2
+2
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
+2
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+4
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ora.j2
+2
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
+3
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2
+2
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xserver.j2
+2
-0
No files found.
playbooks/roles/nginx/defaults/main.yml
View file @
ff670ea8
...
...
@@ -113,3 +113,28 @@ nginx_cfg:
NGINX_ROBOT_RULES
:
[
]
NGINX_EDXAPP_EMBARGO_CIDRS
:
[]
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
}}"
ORA_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 or
ECOMMERCE_ENABLE_BASIC_AUTH or
EDXAPP_CMS_ENABLE_BASIC_AUTH or
EDXAPP_LMS_ENABLE_BASIC_AUTH or
EDXAPP_LMS_PREVIEW_ENABLE_BASIC_AUTH or
KIBANA_ENABLE_BASIC_AUTH or
ORA_ENABLE_BASIC_AUTH or
PROGRAMS_ENABLE_BASIC_AUTH or
XQUEUE_ENABLE_BASIC_AUTH or
XSERVER_ENABLE_BASIC_AUTH
}}
playbooks/roles/nginx/tasks/main.yml
View file @
ff670ea8
...
...
@@ -135,7 +135,7 @@
name={{ COMMON_HTPASSWD_USER }}
password={{ COMMON_HTPASSWD_PASS }}
path={{ nginx_htpasswd_file }}
when
:
COMMON_ENABLE_BASIC_AUTH
when
:
NGINX_CREATE_HTPASSWD_FILE
-
name
:
Create nginx log file location (just in case)
file
:
>
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/basic-auth.j2
View file @
ff670ea8
{% if COMMON_ENABLE_BASIC_AUTH %}
satisfy any;
allow 127.0.0.1;
...
...
@@ -17,4 +16,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 @
ff670ea8
...
...
@@ -3,8 +3,9 @@ server {
location / {
root {{ CERTS_WEB_ROOT }};
{% if CERTS_ENABLE_BASIC_AUTH %}
{% 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 @
ff670ea8
...
...
@@ -74,7 +74,9 @@ error_page {{ k }} {{ v }};
}
location / {
{% if EDXAPP_CMS_ENABLE_BASIC_AUTH %}
{% 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 @
ff670ea8
...
...
@@ -38,6 +38,9 @@ server {
}
location / {
{% if ECOMMERCE_ENABLE_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/kibana.j2
View file @
ff670ea8
...
...
@@ -31,7 +31,9 @@ server {
error_log {{ nginx_log_dir }}/kibana.error.log error;
# Access restriction
{% if KIBANA_ENABLE_BASIC_AUTH %}
{% 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 @
ff670ea8
...
...
@@ -37,8 +37,9 @@ server {
}
location / {
{% if EDXAPP_LMS_PREVIEW_ENABLE_BASIC_AUTH %}
{% 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 @
ff670ea8
...
...
@@ -93,7 +93,9 @@ error_page {{ k }} {{ v }};
}
location / {
{% if EDXAPP_LMS_ENABLE_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
{% if NGINX_EDXAPP_EMBARGO_CIDRS -%}
if ( $embargo ) {
rewrite ^ /embargo;
...
...
@@ -167,7 +169,9 @@ error_page {{ k }} {{ v }};
error_page 503 = /server/rate-limit.html;
{%- endif -%}
{% if EDXAPP_LMS_ENABLE_BASIC_AUTH %}
{%- include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/ora.j2
View file @
ff670ea8
...
...
@@ -8,8 +8,9 @@ server {
listen {{ ORA_NGINX_PORT }} default_server;
location / {
{% if ORA_ENABLE_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/programs.j2
View file @
ff670ea8
...
...
@@ -38,6 +38,9 @@ server {
}
location / {
{% if PROGRAMS_ENABLE_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2
View file @
ff670ea8
...
...
@@ -8,7 +8,9 @@ server {
listen {{ XQUEUE_NGINX_PORT }} default_server;
location / {
{% if XQUEUE_ENABLE_BASIC_AUTH %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_app;
}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xserver.j2
View file @
ff670ea8
...
...
@@ -18,7 +18,9 @@ server {
listen {{ XSERVER_NGINX_PORT }} default_server;
location / {
{% if XSERVER_ENABLE_BASIC_AUTH %}
{% 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