From 07d8698dde10d57e58c464f0472b244ec78b8254 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sat, 26 Nov 2022 18:55:10 -0500 Subject: remove extra /emacsconf/ from mounts --- group_vars/all.yml | 1 + roles/media/tasks/main.yml | 3 +++ roles/obs/tasks/track.yml | 1 - roles/obs/templates/emacsconf-stream-config.el | 6 +++++- roles/obs/templates/mpv-track | 11 ++++++++++- roles/obs/templates/profile.ini | 2 +- roles/pad-proxy/templates/etherpad.nginx.conf | 20 ++++++++------------ roles/prerec/templates/update-task-status.sh | 2 +- roles/publish/defaults/main.yml | 1 + roles/publish/templates/emacsconf-config.el | 6 +----- roles/stream/defaults/main.yml | 2 +- roles/stream/tasks/main.yml | 2 +- roles/stream/templates/emacsconf.nginx.conf | 19 +++++++++++++++++-- roles/stream/templates/icecast.xml | 8 ++++---- roles/stream/templates/on-connect | 1 - roles/stream/templates/on-disconnect | 1 - 16 files changed, 54 insertions(+), 32 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index b308c8b..cd9c38e 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -36,3 +36,4 @@ emacsconf_private_dir: ~{{ emacsconf_user }}/emacsconf-2022-private emacsconf_caption_dir: /data/emacsconf/{{ emacsconf_year }} emacsconf_timezone: US/Eastern etherpad_server_name: pad.emacsconf.org +test_mode: yes diff --git a/roles/media/tasks/main.yml b/roles/media/tasks/main.yml index 6eb3ab6..f49bcd2 100644 --- a/roles/media/tasks/main.yml +++ b/roles/media/tasks/main.yml @@ -1,3 +1,6 @@ +- 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/obs/tasks/track.yml b/roles/obs/tasks/track.yml index da44bac..8b138ae 100644 --- a/roles/obs/tasks/track.yml +++ b/roles/obs/tasks/track.yml @@ -54,7 +54,6 @@ owner: "{{ emacsconf_user }}" group: "{{ emacsconf_group }}" mode: 0775 - loop: "{{ emacsconf_tracks }}" - name: Copy logo copy: src: logo.png diff --git a/roles/obs/templates/emacsconf-stream-config.el b/roles/obs/templates/emacsconf-stream-config.el index a1a048b..610d16e 100644 --- a/roles/obs/templates/emacsconf-stream-config.el +++ b/roles/obs/templates/emacsconf-stream-config.el @@ -10,4 +10,8 @@ (setq completion-category-defaults nil) (setq completion-category-overrides '((file (styles orderless)))) - +(setq emacsconf-track "{{ item.name }}") +(autoload 'text-property-search-forward "text-property-search") +(add-to-list 'load-path "~/emacsconf-el") +(require 'emacsconf) +(require 'emacsconf-stream) diff --git a/roles/obs/templates/mpv-track b/roles/obs/templates/mpv-track index 77d73bd..db3ea62 100755 --- a/roles/obs/templates/mpv-track +++ b/roles/obs/templates/mpv-track @@ -10,7 +10,9 @@ fi # Update the overlay FILE=$1 if [[ ! -f $FILE ]]; then - FILE="/data/emacsconf/assets/stream/emacsconf-2022-$FILE*.webm" + LIST=(/data/emacsconf/assets/stream/emacsconf-2022-$FILE*.webm) + FILE="${LIST[0]}" + BY_SLUG=1 fi shift SLUG=$(echo "$FILE" | perl -ne 'if (/^emacsconf-[0-9]*-(.*?)--/) { print $1; } else { print; }') @@ -28,5 +30,12 @@ else echo "Could not find /data/emacsconf/assets/overlays/$SLUG-video.png, override ~/video.png manually" cp /data/emacsconf/assets/overlays/blank-video.png ~/video.png fi +if [[ "x$BY_SLUG" == "x1" ]] && [[ -f /data/emacsconf/assets/intros/$SLUG.webm ]]; then + INTRO=/data/emacsconf/assets/intros/$SLUG.webm + echo "Found intro $INTRO" +else + echo "Could not find /data/emacsconf/assets/intros/$SLUG.webm" +fi + # Play the video DISPLAY="${DISPLAY:-:{{ item.vnc_id }}}" mpv --input-ipc-server={{ emacsconf_home }}/mpv-socket-{{ emacsconf_id }}-{{ item.id }} --audio-device=pulse/{{ item.id }}-vid --profile={{ emacsconf_id }}-talks $FILE $* & diff --git a/roles/obs/templates/profile.ini b/roles/obs/templates/profile.ini index ba09dec..d00e3af 100644 --- a/roles/obs/templates/profile.ini +++ b/roles/obs/templates/profile.ini @@ -35,7 +35,7 @@ FFAudioTrack=1 FFAudioMixes=1 Pre22.1Settings=true FLVTrack=1 -FFURL=icecast://{{ icecast_emacsconf_user }}:{{ icecast_emacsconf_password }}@{{ icecast_hostname }}:{{ icecast_port }}/{{ emacsconf_id }}/{{ item.id }}.webm +FFURL=icecast://{{ icecast_emacsconf_user }}:{{ icecast_emacsconf_password }}@{{ icecast_hostname }}:{{ icecast_port }}/{{ item.id }}.webm FFExtension=webm FFMCustom={{ ff_mcustom }} FFVBitrate={{ ff_vbitrate }} diff --git a/roles/pad-proxy/templates/etherpad.nginx.conf b/roles/pad-proxy/templates/etherpad.nginx.conf index 95838be..3131178 100644 --- a/roles/pad-proxy/templates/etherpad.nginx.conf +++ b/roles/pad-proxy/templates/etherpad.nginx.conf @@ -11,14 +11,13 @@ server { include snippets/well-known-acme-challenge.conf; location / { return 302 https://$server_name$request_uri; - } - } - server { - listen 443 ssl http2; - listen [::]:443 ssl http2; - server_name {{ etherpad_server_name }}; - include {{ etherpad_tls }}; - + } +} +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name {{ etherpad_server_name }}; + include {{ etherpad_tls }}; {% endif %} access_log /var/log/nginx/{{ etherpad_server_name }}.access.log; location ~ ^/(locales/|locales.json|admin/|static/|pluginfw/|javascripts/|socket.io/|ep/|minified/|api/|ro/|error/|jserror/|favicon.ico|robots.txt) { @@ -45,15 +44,12 @@ server { rewrite /(.*) https://etherpad.wikimedia.org/p/emacsconf-$1 redirect; } {% else %} - location ~ ^/$ { - proxy_buffering off; - proxy_pass http://etherpad_upstream; - } location ~ ^/pad-lister($|\/.*) { proxy_buffering off; proxy_pass http://etherpad_upstream; } location / { + rewrite ^/?$ https://pad.emacsconf.org/2022 redirect; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/roles/prerec/templates/update-task-status.sh b/roles/prerec/templates/update-task-status.sh index e8f0ff8..b3f59d2 100755 --- a/roles/prerec/templates/update-task-status.sh +++ b/roles/prerec/templates/update-task-status.sh @@ -14,7 +14,7 @@ cd {{ emacsconf_private_dir }} echo "Pulling conf.org..." git pull echo "Updating status..." -emacsclient -a emacs --eval "(emacsconf-with-todo-hooks (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\"))" +emacsclient --eval "(emacsconf-with-todo-hooks (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\"))" -a emacs echo "Committing and pushing in the background" git commit -m "Update task status for $SLUG from $FROM_STATUS to $TO_STATUS" conf.org git push & diff --git a/roles/publish/defaults/main.yml b/roles/publish/defaults/main.yml index 6416e25..52ec596 100644 --- a/roles/publish/defaults/main.yml +++ b/roles/publish/defaults/main.yml @@ -3,3 +3,4 @@ emacsconf_publishing_phase: schedule emacs_version: 28.2 emacs_build_parent: /usr/src/emacs emacs_build_dir: "{{ emacs_build_parent }}/emacs-{{ emacs_version }}" +emacsconf_wiki_branch: master diff --git a/roles/publish/templates/emacsconf-config.el b/roles/publish/templates/emacsconf-config.el index fbd9ae7..366255c 100644 --- a/roles/publish/templates/emacsconf-config.el +++ b/roles/publish/templates/emacsconf-config.el @@ -42,9 +42,5 @@ (require 'subed) (require 'subed-vtt) (require 'subed-common) -(setq emacsconf-tracks - '((:name "General" :color "peachpuff" :id "gen" :channel "emacsconf-gen" - :tramp "/ssh:emacsconf-gen@res.emacsconf.org#46668:") - (:name "Development" :color "skyblue" :id "dev" :channel "emacsconf-dev" - :tramp "/ssh:emacsconf-dev@res.emacsconf.org#46668:"))) + 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 %} - /{{ emacsconf_id }}/{{ track.id }}.webm + /{{ track.id }}.webm {{ icecast_emacsconf_user }} {{ icecast_emacsconf_password }} - {% if icecast_save_dump %}/data/{{ emacsconf_id }}-{{ emacsconf_year }}-{{ track.id }}_%Y-%m-%d_%H-%M-%S.webm{% endif %} + {% if not test_mode %}/data/{{ emacsconf_id }}-{{ emacsconf_year }}-{{ track.id }}_%Y-%m-%d_%H-%M-%S.webm{% endif %} {{ emacsconf_name }} {{ emacsconf_year }} - {{ track.name }} track The livestream for the {{ track.name }} track of {{ emacsconf_name }} {{ emacsconf_year }} {{ track.watch }} @@ -202,7 +202,7 @@ /usr/local/bin/{{ emacsconf_id }}-lowres-{{ track.id }}-on-disconnect - /{{ emacsconf_id }}/{{ track.id }}-host.webm + /{{ track.id }}-host.webm {{ icecast_emacsconf_user }} {{ icecast_emacsconf_password }} EmacsConf {{ emacsconf_year }} - {{ track.name }} track @@ -213,7 +213,7 @@ 1 - /{{ emacsconf_id }}/{{ track.id }}-480p.webm + /{{ track.id }}-480p.webm {{ icecast_emacsconf_user }} {{ icecast_emacsconf_password }} {{ emacsconf_name }} {{ emacsconf_year }} - {{ track.name }} track (480p) 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 -- cgit v1.2.3