diff options
Diffstat (limited to 'roles/media')
-rw-r--r-- | roles/media/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/media/tasks/main.yml | 3 | ||||
-rw-r--r-- | roles/media/templates/nginx-include | 11 |
3 files changed, 9 insertions, 7 deletions
diff --git a/roles/media/defaults/main.yml b/roles/media/defaults/main.yml index 3cdf81c..2ecd784 100644 --- a/roles/media/defaults/main.yml +++ b/roles/media/defaults/main.yml @@ -1,2 +1,2 @@ -media_protect_root: false media_server_name: media.emacsconf.org + diff --git a/roles/media/tasks/main.yml b/roles/media/tasks/main.yml index f49bcd2..6eb3ab6 100644 --- a/roles/media/tasks/main.yml +++ b/roles/media/tasks/main.yml @@ -1,6 +1,3 @@ -- name: Set media_protect_root - set_fact: - media_protect_root: not test_mode - name: Install package for setting htpasswd package: name: python3-passlib diff --git a/roles/media/templates/nginx-include b/roles/media/templates/nginx-include index 922bebb..03a7bfa 100644 --- a/roles/media/templates/nginx-include +++ b/roles/media/templates/nginx-include @@ -8,11 +8,16 @@ rewrite ^/{{ emacsconf_year }}/backstage/current/room/([^/]*)$ https://{{ media_ rewrite ^/{{ emacsconf_year }}/backstage/current/([^/]*)/pad/?$ https://{{ etherpad_server_name }}/{{ emacsconf_year }}-$1 redirect; rewrite ^/{{ emacsconf_year }}/backstage/current/([^/]*)/room/?$ https://{{ media_server_name }}/{{ emacsconf_year }}/backstage/assets/redirects/open/bbb-$1.html redirect; } - {% if media_protect_root %} + {% if media_protect_root|bool %} location /{{ emacsconf_year }} { - auth_basic "Restricted"; - auth_basic_user_file /etc/nginx/sites-available/{{ host_name }}-{{ emacsconf_year }}-htpasswd; + # TODO: Figure out how to make this properly controlled by the variable + # auth_basic "Restricted"; + # auth_basic_user_file /etc/nginx/sites-available/{{ host_name }}-{{ emacsconf_year }}-htpasswd; autoindex on; + } + {% else %} + location /{{ emacsconf_year }} { + autoindex on; } {% endif %} location /{{ emacsconf_year }}/{{ emacsconf_id }}.ics { |