summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-08 12:00:47 -0500
committerSacha Chua <sacha@sachachua.com>2022-11-08 12:00:47 -0500
commitc2d647a3cb3a6d456684bcdce327954214352959 (patch)
tree4fe8bf78b9ef868453bb974758856b2c19c20830 /roles
parent5bf4ab50e13a9be2923ddebe69525b40df8ab3bc (diff)
downloademacsconf-ansible-c2d647a3cb3a6d456684bcdce327954214352959.tar.xz
emacsconf-ansible-c2d647a3cb3a6d456684bcdce327954214352959.zip
Update edit and publish configs, tweak OBS, add Mumble client
Diffstat (limited to 'roles')
-rw-r--r--roles/edit/defaults/main.yml1
-rw-r--r--roles/edit/templates/emacsconf-edit.el21
-rw-r--r--roles/obs/defaults/main.yml2
-rw-r--r--roles/obs/tasks/main.yml7
-rw-r--r--roles/obs/tasks/obs-setup.yml4
-rw-r--r--roles/obs/tasks/track.yml26
-rw-r--r--roles/obs/tasks/user.yml1
-rw-r--r--roles/obs/templates/Mumble.conf78
-rw-r--r--roles/obs/templates/bashrc4
-rw-r--r--roles/obs/templates/emacsconf-stream-config.el2
-rwxr-xr-xroles/obs/templates/mpv-track24
-rw-r--r--roles/obs/templates/mpv.conf4
-rwxr-xr-xroles/obs/templates/pulse6
-rw-r--r--roles/obs/templates/scenes.json4
-rwxr-xr-xroles/obs/templates/xstartup-track1
-rw-r--r--roles/prerec/tasks/main.yml1
-rwxr-xr-xroles/prerec/templates/publish-backstage-index.sh3
-rwxr-xr-xroles/prerec/templates/update-task-status.sh2
-rwxr-xr-xroles/prerec/templates/upload.sh2
-rw-r--r--roles/publish/tasks/emacs.yml7
-rw-r--r--roles/publish/tasks/main.yml31
-rw-r--r--roles/publish/templates/emacsconf-config.el22
-rw-r--r--roles/stream/templates/icecast.xml6
-rwxr-xr-xroles/stream/templates/lowres.sh2
24 files changed, 210 insertions, 51 deletions
diff --git a/roles/edit/defaults/main.yml b/roles/edit/defaults/main.yml
index d57c511..f4e36f0 100644
--- a/roles/edit/defaults/main.yml
+++ b/roles/edit/defaults/main.yml
@@ -8,3 +8,4 @@ emacsconf_edit_packages:
- hydra
- orderless
- projectile
+ - erc
diff --git a/roles/edit/templates/emacsconf-edit.el b/roles/edit/templates/emacsconf-edit.el
index e187c69..b659121 100644
--- a/roles/edit/templates/emacsconf-edit.el
+++ b/roles/edit/templates/emacsconf-edit.el
@@ -64,8 +64,25 @@
("u" emacsconf-upload-dired "upload"))
(global-set-key (kbd "C-c e") #'hydra-emacsconf/body)
+(setq erc-nick "{{ erc_user }}")
+(setq erc-password "{{ erc_password }}")
+(setq erc-server "{{ erc_server }}")
+(setq erc-port "{{ erc_port }}")
+(setq erc-autojoin-channels-alist '((".*"
+ {% for channel in erc_channels %}
+ "#{{ channel }}"
+ {% endfor %}
+ {% for track in emacsconf_tracks %}
+ "#{{ track.channel }}"
+ {% endfor %})))
+
+(defun emacsconf-erc-connect ()
+ (interactive)
+ (erc-tls :server "{{ erc_server }}" :nick erc-nick :password erc-password :port erc-port))
+
(require 'ox-md)
-(server-start)
+(unless (and (boundp 'server-clients) server-clients) (server-start))
(find-file "{{ emacsconf_private_dir }}/conf.org")
-
+(emacsconf-add-org-after-todo-state-change-hook)
+(emacsconf-erc-connect)
diff --git a/roles/obs/defaults/main.yml b/roles/obs/defaults/main.yml
index 4038fa9..6eb9451 100644
--- a/roles/obs/defaults/main.yml
+++ b/roles/obs/defaults/main.yml
@@ -3,3 +3,5 @@ ff_vcustom: rt cpu-used=5 threads=2 error-resilient=1 crf=30 g=120 minrate=1.5M
ff_vbitrate: 1500
ff_vgopsize: 120
obs_profile_path: /home/{{ emacsconf_user }}/.config/obs-studio/basic/profiles
+emacsconf_asset_dir: /data/{{ emacsconf_id }}/assets
+mumble_server: mumble.emacsconf.org
diff --git a/roles/obs/tasks/main.yml b/roles/obs/tasks/main.yml
index 8c1e059..ab94878 100644
--- a/roles/obs/tasks/main.yml
+++ b/roles/obs/tasks/main.yml
@@ -19,6 +19,7 @@
- alsa-utils
- dbus-x11
- obs-studio
+ - mumble
- xserver-xorg-dev
- xdotool
update_cache: yes
@@ -67,10 +68,6 @@
file:
owner: "{{ emacsconf_user }}"
group: "{{ emacsconf_group }}"
- path: "{{ item }}"
+ path: "{{ emacsconf_asset_dir }}"
state: directory
mode: 0775
- loop:
- - /data/{{ emacsconf_id }}/stream
- - /data/{{ emacsconf_id }}/overlays
-
diff --git a/roles/obs/tasks/obs-setup.yml b/roles/obs/tasks/obs-setup.yml
index 911f609..acd3c1c 100644
--- a/roles/obs/tasks/obs-setup.yml
+++ b/roles/obs/tasks/obs-setup.yml
@@ -49,15 +49,13 @@
mode: 0664
- name: Create text files for OBS sources
copy:
- content: "Initializing..."
+ content: ""
owner: "{{ emacsconf_user }}"
group: "{{ emacsconf_group }}"
dest: "~{{ emacsconf_user }}/{{ filename }}.txt"
mode: 0664
loop:
- news
- - url
- - bottom
loop_control:
loop_var: filename
- name: Create OBS scripts for tracks
diff --git a/roles/obs/tasks/track.yml b/roles/obs/tasks/track.yml
index 14533df..fe49116 100644
--- a/roles/obs/tasks/track.yml
+++ b/roles/obs/tasks/track.yml
@@ -1,5 +1,5 @@
- name: Set vars
- tags: obs-scene, obs-profile, mpv, wip
+ tags: obs-scene, obs-profile, mpv, wip, mumble
set_fact:
old_emacsconf_user: "{{ emacsconf_user }}"
old_emacsconf_home: "{{ emacsconf_home }}"
@@ -79,11 +79,33 @@
dest: "~{{ emacsconf_user }}/.config/i3/config"
owner: "{{ emacsconf_user }}"
group: "{{ emacsconf_group }}"
+ - name: Set up Mumble configuration directory
+ tags: mumble
+ file:
+ path: "~{{ emacsconf_user }}/.config/Mumble"
+ state: directory
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ - name: Debug mumble
+ debug:
+ var: mumble_certificates['dev']
+ - name: Set up mumble
+ tags: mumble
+ template:
+ src: Mumble.conf
+ dest: "~{{ emacsconf_user }}/.config/Mumble/Mumble.conf"
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
- name: Set up Emacs configuration
tags: wip
include: emacs.yml
+ - name: Set up symbolic links
+ file:
+ src: "/data/{{ emacsconf_id }}/assets/stream"
+ dest: "~{{ emacsconf_user }}/stream"
+ state: link
- name: Reset vars
- tags: obs-scene, obs-profile, mpv, wip
+ tags: obs-scene, obs-profile, mpv, wip, mumble
set_fact:
old_emacsconf_user: "{{ emacsconf_user }}"
old_emacsconf_home: "{{ emacsconf_home }}"
diff --git a/roles/obs/tasks/user.yml b/roles/obs/tasks/user.yml
index fae7d9f..00e68a8 100644
--- a/roles/obs/tasks/user.yml
+++ b/roles/obs/tasks/user.yml
@@ -11,6 +11,7 @@
file:
path: "/home/{{ emacsconf_user }}/.ssh"
owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
state: directory
mode: 700
- name: Set up SSH key access
diff --git a/roles/obs/templates/Mumble.conf b/roles/obs/templates/Mumble.conf
new file mode 100644
index 0000000..06449d4
--- /dev/null
+++ b/roles/obs/templates/Mumble.conf
@@ -0,0 +1,78 @@
+[General]
+lastupdate=2
+
+[audio]
+echomulti=false
+input=PulseAudio
+output=PulseAudio
+outputdelay=4
+positional=false
+transmit=2
+vadmax=@Variant(\0\0\0\x87?z\xe1\xf6)
+vadmin=@Variant(\0\0\0\x87?L\xcd\x9a)
+whisperfriends=true
+
+[messages]
+10\log=1
+12\log=1
+14\log=1
+15\log=1
+17\log=1
+18\log=1
+19\log=1
+2\log=1
+20\log=1
+21\log=1
+22\log=1
+23\log=1
+25\log=1
+26\log=1
+27\log=1
+28\log=1
+29\log=1
+5\log=1
+6\log=1
+9\log=1
+size=29
+
+[messagesounds]
+size=29
+
+{% if mumble_certificates[item.id] is defined %}
+[net]
+certificate="{{ mumble_certificates[item.id] }}"
+{% endif %}
+
+[overlay]
+blacklist=@Invalid()
+blacklistexclude=@Invalid()
+launchers=@Invalid()
+launchersexclude=@Invalid()
+paths=@Invalid()
+pathsexclude=@Invalid()
+version=1.3.4
+whitelist=@Invalid()
+whitelistexclude=@Invalid()
+
+[pulseaudio]
+output={{ item.id }}-qa
+
+[shortcuts]
+1\data=@Invalid()
+1\index=1
+1\keys=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0`)
+1\suppress=false
+size=1
+
+[tts]
+enable=false
+
+[ui]
+ConfigGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0n\0\0\0\x31\0\0\x4\x86\0\0\x2\x61\0\0\0p\0\0\0\x31\0\0\x4\x84\0\0\x2_\0\0\0\0\0\0\0\0\x5\0\0\0\0p\0\0\0\x31\0\0\x4\x84\0\0\x2_)
+connect\geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x1W\0\0\0\x91\0\0\x3\x98\0\0\x2\0\0\0\x1Y\0\0\0\x91\0\0\x3\x96\0\0\x1\xfe\0\0\0\0\0\0\0\0\x5\0\0\0\x1Y\0\0\0\x91\0\0\x3\x96\0\0\x1\xfe)
+connect\header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2&\0\0\0\x3\x1\x1\0\0\0\0\0\0\x1\0\0\0\x2\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x3\0\0\x1m\0\0\0\x1\0\0\0\x1\0\0\0X\0\0\0\x1\0\0\0\x3\0\0\0\x61\0\0\0\x1\0\0\0\x3\0\0\x3\xe8\0\0\0\0\x64)
+geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\x12\0\0\x4\xff\0\0\x2\xcf\0\0\0\x2\0\0\0\x12\0\0\x4\xfd\0\0\x2\xcd\0\0\0\0\0\0\0\0\x5\0\0\0\0\x2\0\0\0\x12\0\0\x4\xfd\0\0\x2\xcd)
+header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x3\xf2\0\0\0\x1\x1\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x1\0\0\x3\xf2\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\0\0\0\x64)
+server={{ mumble_server }}
+state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\0\0\0\x1\0\0\0\x2~\xfc\x2\0\0\0\x2\xfb\0\0\0\f\0q\0\x64\0w\0L\0o\0g\x1\0\0\0>\0\0\x2\x61\0\0\0z\0\xff\xff\xff\xfb\0\0\0\xe\0q\0\x64\0w\0\x43\0h\0\x61\0t\x1\0\0\x2\xa3\0\0\0\x19\0\0\0\x19\0\0\0\x19\0\0\x3\xf8\0\0\x2~\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x1a\0q\0t\0I\0\x63\0o\0n\0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
+usage=false
diff --git a/roles/obs/templates/bashrc b/roles/obs/templates/bashrc
index 3677017..4d65cbd 100644
--- a/roles/obs/templates/bashrc
+++ b/roles/obs/templates/bashrc
@@ -112,5 +112,9 @@ if ! shopt -oq posix; then
fi
fi
+alias play=track-mpv
+alias qa-louder="pactl set-sink-volume {{ item.id }}-qa +5% "
+alias qa-quieter="pactl set-sink-volume {{ item.id }}-qa -5% "
+alias qa-vol="pactl set-sink-volume {{ item.id }}-qa "
export PATH=$PATH:$HOME/bin
export DISPLAY=${DISPLAY:-:{{ item.vnc_id }}}
diff --git a/roles/obs/templates/emacsconf-stream-config.el b/roles/obs/templates/emacsconf-stream-config.el
index 8770d60..a1a048b 100644
--- a/roles/obs/templates/emacsconf-stream-config.el
+++ b/roles/obs/templates/emacsconf-stream-config.el
@@ -3,7 +3,7 @@
;; Configuration
(vertico-mode)
(fset 'yes-or-no-p 'y-or-n-p)
-(modus-themes-load-vivendi)
+(modus-themes-load-operandi)
(org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (shell . t)))
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
(setq completion-styles '(orderless))
diff --git a/roles/obs/templates/mpv-track b/roles/obs/templates/mpv-track
index ee359f1..b6d6d67 100755
--- a/roles/obs/templates/mpv-track
+++ b/roles/obs/templates/mpv-track
@@ -2,4 +2,26 @@
# Run MPV with the output set to the right sink and with an IPC socket
# {{ ansible_managed }}
-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 $* &
+# Update the overlay
+FILE=$1
+if [[ ! -f $FILE ]]; then
+ FILE="/data/emacsconf/assets/stream/emacsconf-2022-$FILE*.webm"
+fi
+shift
+SLUG=$(echo "$FILE" | perl -ne 'if (/^emacsconf-[0-9]*-(.*?)--/) { print $1; } else { print; }')
+if [[ -f /data/emacsconf/assets/overlays/$SLUG-other.png ]]; then
+ echo "Found other overlay for $SLUG, copying"
+ cp /data/emacsconf/assets/overlays/$SLUG-other.png ~/other.png
+else
+ echo "Could not find /data/emacsconf/assets/overlays/$SLUG-other.png, please override ~/other.png manually"
+ cp /data/emacsconf/assets/overlays/blank-other.png ~/other.png
+fi
+if [[ -f /data/emacsconf/assets/overlays/$SLUG-video.png ]]; then
+ echo "Found video overlay for $SLUG, copying"
+ cp /data/emacsconf/assets/overlays/$SLUG-video.png ~/video.png
+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
+# 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/mpv.conf b/roles/obs/templates/mpv.conf
index dce6481..6c90a6b 100644
--- a/roles/obs/templates/mpv.conf
+++ b/roles/obs/templates/mpv.conf
@@ -1,6 +1,8 @@
# {{ ansible_managed }}
# Requires mpv >= 0.34.0
+input-ipc-server={{ emacsconf_home }}/mpv-socket-{{ emacsconf_id }}-{{ item.id }}
+audio-device=pulse/{{ item.id }}-vid
# Comment out the next line if you don't want this profile loaded by default.
profile={{ emacsconf_id }}-talks
# Then you can load it with `--profile={{ emacsconf_id }}-talks`
@@ -14,7 +16,7 @@ video-align-y=-1
sub-use-margins=yes
sub-scale-by-window=yes
sub-pos=103
-sub-margin-x=105
+sub-margin-x=110
sub-margin-y=60
sub-align-x=left
# Style
diff --git a/roles/obs/templates/pulse b/roles/obs/templates/pulse
index cba7fc0..7035cfe 100755
--- a/roles/obs/templates/pulse
+++ b/roles/obs/templates/pulse
@@ -135,8 +135,6 @@ load-module module-filter-apply
#set-default-sink output
#set-default-source input
-{% for track in emacsconf_tracks %}
-load-module module-null-sink sink_name={{ track.id }}-vid sink_properties=device.description={{ track.id }}-vid
-load-module module-null-sink sink_name={{ track.id }}-qa sink_properties=device.description={{ track.id }}-qa
-{% endfor %}
+load-module module-null-sink sink_name={{ item.id }}-vid sink_properties=device.description={{ item.id }}-vid
+load-module module-null-sink sink_name={{ item.id }}-qa sink_properties=device.description={{ item.id }}-qa
load-module module-stream-restore restore_device=false
diff --git a/roles/obs/templates/scenes.json b/roles/obs/templates/scenes.json
index 6d8e7ad..5790efd 100644
--- a/roles/obs/templates/scenes.json
+++ b/roles/obs/templates/scenes.json
@@ -120,7 +120,7 @@
"push-to-talk": false,
"push-to-talk-delay": 0,
"settings": {
- "file": "/home/{{ emacsconf_id }}-{{ item.id }}/other.svg"
+ "file": "/home/{{ emacsconf_id }}-{{ item.id }}/other.png"
},
"sync": 0,
"versioned_id": "image_source",
@@ -145,7 +145,7 @@
"push-to-talk": false,
"push-to-talk-delay": 0,
"settings": {
- "file": "/home/{{ emacsconf_id }}-{{ item.id }}/video.svg"
+ "file": "/home/{{ emacsconf_id }}-{{ item.id }}/video.png"
},
"sync": 0,
"versioned_id": "image_source",
diff --git a/roles/obs/templates/xstartup-track b/roles/obs/templates/xstartup-track
index b80caac..b8d90cd 100755
--- a/roles/obs/templates/xstartup-track
+++ b/roles/obs/templates/xstartup-track
@@ -7,6 +7,7 @@ pulseaudio --start
pacmd set-default-sink {{ item.id }}-qa
firefox file:///data/emacsconf/{{ emacsconf_year }}/index-{{ item.id }}.html &
$HOME/bin/track-obs &
+mumble mumble://{{ emacsconf_id }}-{{ item.id }}@{{ mumble_server }}/{{ item.mumble_channel }} &
termit &
# $HOME/{{ item.id }}-obs &
# $HOME/{{ item.id }}-mpv $HOME/logo.png &
diff --git a/roles/prerec/tasks/main.yml b/roles/prerec/tasks/main.yml
index 5241531..c635693 100644
--- a/roles/prerec/tasks/main.yml
+++ b/roles/prerec/tasks/main.yml
@@ -26,3 +26,4 @@
- process-prerec.sh
- update-task-status.sh
- upload.sh
+ - publish-backstage-index.sh
diff --git a/roles/prerec/templates/publish-backstage-index.sh b/roles/prerec/templates/publish-backstage-index.sh
new file mode 100755
index 0000000..96b27e7
--- /dev/null
+++ b/roles/prerec/templates/publish-backstage-index.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+# {{ ansible_managed }}
+emacsclient -a emacs --eval "(emacsconf-publish-backstage-index)"
diff --git a/roles/prerec/templates/update-task-status.sh b/roles/prerec/templates/update-task-status.sh
index 18b7c1b..c9ac142 100755
--- a/roles/prerec/templates/update-task-status.sh
+++ b/roles/prerec/templates/update-task-status.sh
@@ -5,6 +5,6 @@ FROM_STATUS="$2"
TO_STATUS="$3"
cd ~/emacsconf-2022-private
git pull
-emacsclient --eval "(progn (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\") (emacsconf-with-talk-heading \"$SLUG\" (emacsconf-cache-video-data (emacsconf-get-talk-info-for-subtree)) (save-buffer)))"
+emacsclient -a emacs --eval "(progn (emacsconf-update-talk-status \"$SLUG\" \"$FROM_STATUS\" \"$TO_STATUS\") (emacsconf-with-talk-heading \"$SLUG\" (emacsconf-cache-video-data (emacsconf-get-talk-info-for-subtree)) (save-buffer)))"
git commit -m "Update task status for $SLUG" conf.org
git push
diff --git a/roles/prerec/templates/upload.sh b/roles/prerec/templates/upload.sh
index f723d29..f3dc9c5 100755
--- a/roles/prerec/templates/upload.sh
+++ b/roles/prerec/templates/upload.sh
@@ -2,5 +2,5 @@
# {{ ansible_managed }}
scp $* orga@media.emacsconf.org:~/backstage
-emacsclient --eval "(emacsconf-publish-backstage-index)"
+/data/emacsconf/{{ emacsconf_year }}/scripts/publish-backstage-index.sh
rsync -avze ssh orga@media.emacsconf.org:~/backstage/ /data/emacsconf/cache/
diff --git a/roles/publish/tasks/emacs.yml b/roles/publish/tasks/emacs.yml
index 8d75979..3944876 100644
--- a/roles/publish/tasks/emacs.yml
+++ b/roles/publish/tasks/emacs.yml
@@ -11,6 +11,11 @@
- automake
- texinfo
state: present
+- name: Install building dependencies
+ apt:
+ name:
+ - emacs
+ state: build-dep
- name: Create directory
file:
path: "{{ emacs_build_parent }}"
@@ -22,7 +27,7 @@
dest: "{{ emacs_build_parent }}"
creates: "{{ emacs_build_dir }}"
- name: Configure
- command: ./configure --with-x-toolkit=no
+ command: ./configure
args:
chdir: "{{ emacs_build_dir }}"
creates: '{{ emacs_build_dir }}/Makefile'
diff --git a/roles/publish/tasks/main.yml b/roles/publish/tasks/main.yml
index 128b0fa..c09cae2 100644
--- a/roles/publish/tasks/main.yml
+++ b/roles/publish/tasks/main.yml
@@ -54,28 +54,30 @@
owner: "{{ emacsconf_user }}"
group: "{{ emacsconf_group }}"
create: yes
-- name: Set up compile-media
- become_user: "{{ emacsconf_user }}"
- git:
- repo: https://github.com/sachac/compile-media.git
- dest: "~{{ emacsconf_user }}/compile-media"
- name: Set up or update repositories
become_user: "{{ emacsconf_user }}"
- tags: publish
+ tags: publish, wip
block:
+ - name: Set up compile-media
+ git:
+ repo: https://github.com/sachac/compile-media.git
+ dest: "~{{ emacsconf_user }}/compile-media"
+ - name: Set up subed
+ git:
+ repo: https://github.com/sachac/subed.git
+ dest: "~{{ emacsconf_user }}/subed"
- name: Check out wiki repository
ansible.builtin.git:
- repo: anon@git.emacsconf.org:/emacsconf-wiki
+ repo: anon@git.emacsconf.org:emacsconf-wiki
dest: "{{ emacsconf_edit_wiki_dir }}"
- ssh_opts: "-i ~/.ssh/id_rsa_anon_git_emacsconf -u anon"
- key_file: "~{{ emacsconf_user }}/.ssh/id_rsa_anon_git_emacsconf"
+ ssh_opts: "-i /home/{{ emacsconf_user }}/.ssh/id_rsa_anon_git_emacsconf"
register: wiki_clone
failed_when:
- wiki_clone.failed
- not 'Local modifications exist in repository' in wiki_clone.msg
- not 'Failed to checkout branch' in wiki_clone.msg
- - name: Configure git to use
- shell: git config core.sshCommand "ssh -i ~{{ emacsconf_user }}/.ssh/id_rsa_anon_git_emacsconf -F /dev/null"
+ - name: Set up key
+ shell: git config core.sshCommand "ssh -i ~/.ssh/id_rsa_anon_git_emacsconf -F /dev/null"
args:
chdir: "{{ emacsconf_edit_wiki_dir }}"
- name: Check out emacsconf-el
@@ -103,6 +105,7 @@
file:
path: "{{ item }}"
owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
recurse: true
loop:
- "{{ emacs_config_dir }}"
@@ -119,8 +122,8 @@
tags: publish-talk
command: emacs -l "{{ emacs_config_dir }}/emacsconf-config.el" --batch --exec '(emacsconf-with-talk-heading "{{ slug }}" (emacsconf-update-talk))'
when: slug is defined
- - name: Commit the wiki and push
- shell: cd {{ emacsconf_edit_wiki_dir }}; git commit -m 'Update from ansible' -a; git push
+ # - name: Commit the wiki and push
+ # shell: cd {{ emacsconf_edit_wiki_dir }}; git commit -m 'Update from ansible' -a; git push
- name: Publish the backstage index
- command: emacs -l "{{ emacs_config_dir }}/emacsconf-config.el" --batch --exec '(emacsconf-publish-backstage-index)'
+ command: emacsclient -c -nw --exec '(emacsconf-publish-backstage-index)' -a emacs
when: (publish|d("")) == "backstage"
diff --git a/roles/publish/templates/emacsconf-config.el b/roles/publish/templates/emacsconf-config.el
index 36ca8a2..fbd9ae7 100644
--- a/roles/publish/templates/emacsconf-config.el
+++ b/roles/publish/templates/emacsconf-config.el
@@ -20,27 +20,31 @@
(setq emacsconf-backstage-dir "/ssh:orga@media.emacsconf.org:/var/www/media.emacsconf.org/2022/backstage")
(setq emacsconf-upload-dir "/ssh:orga@media.emacsconf.org:/srv/upload")
+
{% if ansible_host == "res.emacsconf.org" %}
-(setq emacsconf-res-dir (format "/ssh:orga@res.emacsconf.org:/data/emacsconf/%s" emacsconf-year))
+(setq emacsconf-res-dir "/data/{{ emacsconf_id }}/{{ emacsconf_year}}")
(setq emacsconf-cache-dir "/data/{{ emacsconf_id }}/cache")
(setq emacsconf-stream-host "localhost")
+(setq emacsconf-stream-overlay-dir "/data/emacsconf/overlays")
+(setq emacsconf-stream-asset-dir "/data/emacsconf/assets")
{% else %}
-(setq emacsconf-res-dir "/data/{{ emacsconf_id }}/{{ emacsconf_year}}")
+(setq emacsconf-res-dir (format "/ssh:orga@res.emacsconf.org:/data/emacsconf/%s" emacsconf-year))
{% endif %}
+
(add-to-list 'load-path "~/compile-media")
+(add-to-list 'load-path "~/subed/subed")
(require 'compile-media)
(require 'emacsconf)
(require 'emacsconf-publish)
(require 'emacsconf-schedule)
(require 'emacsconf-erc)
(require 'emacsconf-stream)
-
+(require 'subed)
+(require 'subed-vtt)
+(require 'subed-common)
(setq emacsconf-tracks
'((:name "General" :color "peachpuff" :id "gen" :channel "emacsconf-gen"
- :tramp "/ssh:gen:")
+ :tramp "/ssh:emacsconf-gen@res.emacsconf.org#46668:")
(:name "Development" :color "skyblue" :id "dev" :channel "emacsconf-dev"
- :tramp "/ssh:dev:")))
-(setq emacsconf-stream-overlay-dir
- (expand-file-name "overlays" (file-name-directory emacsconf-org-file)))
-(setq emacsconf-stream-asset-dir
- (expand-file-name "assets" (file-name-directory emacsconf-org-file)))
+ :tramp "/ssh:emacsconf-dev@res.emacsconf.org#46668:")))
+
diff --git a/roles/stream/templates/icecast.xml b/roles/stream/templates/icecast.xml
index f9c3916..cf6ec41 100644
--- a/roles/stream/templates/icecast.xml
+++ b/roles/stream/templates/icecast.xml
@@ -189,7 +189,7 @@
-->
{% for track in emacsconf_tracks %}
<mount type="normal">
- <mount-name>/emacsconf/{{ 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 %}
@@ -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/lowres.sh b/roles/stream/templates/lowres.sh
index 1f74215..502fcb3 100755
--- a/roles/stream/templates/lowres.sh
+++ b/roles/stream/templates/lowres.sh
@@ -2,5 +2,5 @@
# {{ ansible_managed }}
sleep 10
for i in 1 2 3 4 5; do
- ffmpeg -loglevel 24 -f webm -reconnect_at_eof 1 -reconnect_streamed 1 -re -i "http://localhost:{{ icecast_port }}/{{ emacsconf_id }}/{{ item.id }}.webm" -vf scale="{{ icecast_lowres_scale }}" -f webm -c:a copy -b:v 500k -maxrate 1M -bufsize 1M -content_type video/webm -c:v libvpx "icecast://{{ icecast_emacsconf_user }}:{{ icecast_emacsconf_password }}@localhost:{{ icecast_port }}/{{ emacsconf_id }}/{{ item.id }}-480p.webm" >> {{ icecast_restream_dir }}/{{ emacsconf_id }}-lowres-{{ item.id }}.log || sleep 5
+ ffmpeg -loglevel 24 -f webm -reconnect_at_eof 1 -reconnect_streamed 1 -re -i "http://localhost:{{ icecast_port }}/{{ item.id }}.webm" -vf scale="{{ icecast_lowres_scale }}" -f webm -c:a copy -b:v 500k -maxrate 1M -bufsize 1M -content_type video/webm -c:v libvpx "icecast://{{ icecast_emacsconf_user }}:{{ icecast_emacsconf_password }}@localhost:{{ icecast_port }}/{{ item.id }}-480p.webm" >> {{ icecast_restream_dir }}/{{ emacsconf_id }}-lowres-{{ item.id }}.log || sleep 5
done