diff options
Diffstat (limited to '')
-rw-r--r-- | roles/stream/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/stream/tasks/main.yml | 2 | ||||
-rw-r--r-- | roles/stream/templates/emacsconf.nginx.conf | 19 | ||||
-rw-r--r-- | roles/stream/templates/icecast.xml | 8 | ||||
-rwxr-xr-x | roles/stream/templates/on-connect | 1 | ||||
-rwxr-xr-x | roles/stream/templates/on-disconnect | 1 |
6 files changed, 23 insertions, 10 deletions
diff --git a/roles/stream/defaults/main.yml b/roles/stream/defaults/main.yml index f013dba..aa06ef3 100644 --- a/roles/stream/defaults/main.yml +++ b/roles/stream/defaults/main.yml @@ -4,4 +4,4 @@ icecast_lowres_scale: "854:480" icecast_user: icecast2 icecast_group: icecast icecast_restream_dir: /etc/icecast2/restream -icecast_save_dump: false + diff --git a/roles/stream/tasks/main.yml b/roles/stream/tasks/main.yml index b2bbc69..9c35f69 100644 --- a/roles/stream/tasks/main.yml +++ b/roles/stream/tasks/main.yml @@ -28,13 +28,13 @@ dest: /etc/init.d/emacsconf mode: 0755 - name: Set up nginx config + tags: wip, stream-nginx become: true template: src: emacsconf.nginx.conf dest: /etc/nginx/emacsconf.nginx.conf mode: 0644 - name: Include emacsconf in nginx config - tags: wip become: true lineinfile: line: include /etc/nginx/emacsconf.nginx.conf; diff --git a/roles/stream/templates/emacsconf.nginx.conf b/roles/stream/templates/emacsconf.nginx.conf index f814f31..277c833 100644 --- a/roles/stream/templates/emacsconf.nginx.conf +++ b/roles/stream/templates/emacsconf.nginx.conf @@ -1,5 +1,20 @@ -location /emacsconf/ { - proxy_pass http://localhost:{{ icecast_port }}; +location ~ ^/((gen|dev)(-480p)?.webm)$ { + proxy_pass http://127.0.0.1:{{ icecast_port }}/$1; + proxy_http_version 1.1; + proxy_buffering off; + proxy_request_buffering off; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Real-IP $remote_addr; +} + +location ~ ^/emacsconf/(.*)$ { + proxy_pass http://127.0.0.1:{{ icecast_port }}/$1; proxy_http_version 1.1; proxy_buffering off; proxy_request_buffering off; diff --git a/roles/stream/templates/icecast.xml b/roles/stream/templates/icecast.xml index 37e1a0a..d97a515 100644 --- a/roles/stream/templates/icecast.xml +++ b/roles/stream/templates/icecast.xml @@ -189,10 +189,10 @@ --> {% for track in emacsconf_tracks %} <mount type="normal"> - <mount-name>/{{ emacsconf_id }}/{{ track.id }}.webm</mount-name> + <mount-name>/{{ track.id }}.webm</mount-name> <username>{{ icecast_emacsconf_user }}</username> <password>{{ icecast_emacsconf_password }}</password> - {% if icecast_save_dump %}<dump-file>/data/{{ emacsconf_id }}-{{ emacsconf_year }}-{{ track.id }}_%Y-%m-%d_%H-%M-%S.webm</dump-file>{% endif %} + {% if not test_mode %}<dump-file>/data/{{ emacsconf_id }}-{{ emacsconf_year }}-{{ track.id }}_%Y-%m-%d_%H-%M-%S.webm</dump-file>{% endif %} <stream-name>{{ emacsconf_name }} {{ emacsconf_year }} - {{ track.name }} track</stream-name> <stream-description>The livestream for the {{ track.name }} track of {{ emacsconf_name }} {{ emacsconf_year }}</stream-description> <stream-url>{{ track.watch }}</stream-url> @@ -202,7 +202,7 @@ <on-disconnect>/usr/local/bin/{{ emacsconf_id }}-lowres-{{ track.id }}-on-disconnect</on-disconnect> </mount> <mount type="normal"> - <mount-name>/{{ emacsconf_id }}/{{ track.id }}-host.webm</mount-name> + <mount-name>/{{ track.id }}-host.webm</mount-name> <username>{{ icecast_emacsconf_user }}</username> <password>{{ icecast_emacsconf_password }}</password> <stream-name>EmacsConf {{ emacsconf_year }} - {{ track.name }} track</stream-name> @@ -213,7 +213,7 @@ <hidden>1</hidden> </mount> <mount type="normal"> - <mount-name>/{{ emacsconf_id }}/{{ track.id }}-480p.webm</mount-name> + <mount-name>/{{ track.id }}-480p.webm</mount-name> <username>{{ icecast_emacsconf_user }}</username> <password>{{ icecast_emacsconf_password }}</password> <stream-name>{{ emacsconf_name }} {{ emacsconf_year }} - {{ track.name }} track (480p)</stream-name> diff --git a/roles/stream/templates/on-connect b/roles/stream/templates/on-connect index 0f613bf..cd9deb6 100755 --- a/roles/stream/templates/on-connect +++ b/roles/stream/templates/on-connect @@ -2,7 +2,6 @@ set -e PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" PIDFILE="{{ icecast_restream_dir }}/{{ emacsconf_id }}-lowres-{{ item.id }}.pid" -echo $(date) " on connect {{ item.id }} $*" >> {{ icecast_restream_dir }}/restream.log . /lib/lsb/init-functions diff --git a/roles/stream/templates/on-disconnect b/roles/stream/templates/on-disconnect index 5847356..15ae31b 100755 --- a/roles/stream/templates/on-disconnect +++ b/roles/stream/templates/on-disconnect @@ -2,7 +2,6 @@ set -e PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" PIDFILE="{{ icecast_restream_dir }}/{{ emacsconf_id }}-lowres-{{ item.id }}.pid" -echo $(date) " on disconnect {{ item.id }} $*" >> {{ icecast_restream_dir }}/restream.log . /lib/lsb/init-functions |