summaryrefslogtreecommitdiffstats
path: root/roles/media
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--roles/media/tasks/main.yml59
-rw-r--r--roles/media/templates/nginx-include19
-rw-r--r--roles/media/templates/nginx-site-config23
3 files changed, 95 insertions, 6 deletions
diff --git a/roles/media/tasks/main.yml b/roles/media/tasks/main.yml
index 8cd854d..94f10a3 100644
--- a/roles/media/tasks/main.yml
+++ b/roles/media/tasks/main.yml
@@ -11,6 +11,10 @@
file:
path: /var/www/{{ media_server_name }}/{{ emacsconf_year }}/backstage
state: directory
+- name: Ensure current directory exists
+ file:
+ path: /var/www/{{ media_server_name }}/{{ emacsconf_year }}/current
+ state: directory
- name: Create group
group:
name: "{{ emacsconf_group }}"
@@ -45,11 +49,21 @@
template:
src: nginx-include
dest: /etc/nginx/sites-available/{{ media_server_name }}-{{ emacsconf_year }}-include
+- name: Create 404 page
+ template:
+ src: 404.html
+ dest: /var/www/{{ media_server_name }}/404.html
+
- name: Create main configuration if needed
template:
src: nginx-site-config
dest: /etc/nginx/sites-available/{{ media_server_name }}
force: no
+- name: Make sure 404 line is in main config
+ lineinfile:
+ line: error_page 404 403 /404.html;
+ dest: /etc/nginx/sites-available/{{ media_server_name }}
+ insertafter: "listen 443 ssl http2;"
- name: Make sure main configuration is enabled
file:
src: /etc/nginx/sites-available/{{ media_server_name }}
@@ -68,3 +82,48 @@
service:
name: nginx
state: reloaded
+- name: Symlink the current year's backstage directory
+ file:
+ src: /var/www/{{ media_server_name }}/{{ emacsconf_year }}/backstage
+ dest: "~{{ emacsconf_user }}/backstage"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ state: link
+- name: Symlink the current year's directory
+ file:
+ src: /var/www/{{ media_server_name }}/{{ emacsconf_year }}
+ dest: "~{{ emacsconf_user }}/{{ emacsconf_year }}"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ state: link
+- name: Symlink the current year's directory as current
+ file:
+ src: /var/www/{{ media_server_name }}/{{ emacsconf_year }}
+ dest: "~{{ emacsconf_user }}/current"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ state: link
+- name: Create the bin directory
+ tags: media-scripts
+ file:
+ state: directory
+ path: "~{{ emacsconf_user }}/bin"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+- name: Add the bin directory to the path
+ tags: media-scripts
+ lineinfile:
+ dest: "~{{ emacsconf_user }}/.bashrc"
+ state: present
+ line: "export PATH=$PATH:~/bin"
+- name: Create batch scripts
+ tags: media-scripts
+ template:
+ src: "{{ item }}"
+ dest: "~{{ emacsconf_user }}/bin/{{ item }}"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ mode: 0755
+ loop:
+ - bbb-open
+ - bbb-before
diff --git a/roles/media/templates/nginx-include b/roles/media/templates/nginx-include
index f80ed76..4d1eabe 100644
--- a/roles/media/templates/nginx-include
+++ b/roles/media/templates/nginx-include
@@ -12,15 +12,30 @@ location /{{ emacsconf_year }}/backstage {
expires off;
etag off;
}
+ location ~* \.vtt$ {
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
+ }
+
location /{{ emacsconf_year }}/{{ emacsconf_id }}.ics {
- auth_basic off;
- }
+ auth_basic off;
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
+}
location /{{ emacsconf_year }}/schedules/ {
auth_basic off;
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
}
{% for track in emacsconf_tracks %}
location /{{ emacsconf_year }}/{{ emacsconf_id }}-{{ track.id }}.ics {
auth_basic off;
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
}
{% endfor %}
{% if media_protect_root %}
diff --git a/roles/media/templates/nginx-site-config b/roles/media/templates/nginx-site-config
index 4dbdaaa..f6a83b1 100644
--- a/roles/media/templates/nginx-site-config
+++ b/roles/media/templates/nginx-site-config
@@ -1,5 +1,20 @@
server {
- listen 80;
- server_name {{ media_server_name }};
- root /var/www/{{ media_server_name }};
-} \ No newline at end of file
+ listen 80;
+ server_name {{ media_server_name }};
+ root /var/www/{{ media_server_name }};
+ error_page 404 403 /404.html;
+ location / {
+ add_header Cache-Control "no-store, no-cache, must-revalidate";
+ add_header Pragma "no-cache";
+ expires 0;
+ }
+ types {
+ text/plain org;
+ }
+
+ location ~* \.vtt$ {
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
+ }
+}