Update to 2021-04-28 14:00

master
Daniel Berteaud 4 years ago
parent 1e56ae6776
commit 89404df9b2
  1. 1
      roles/jitsi_jibri/README.md
  2. 23
      roles/jitsi_jibri/defaults/main.yml
  3. BIN
      roles/jitsi_jibri/handlers/.main.yml.swp
  4. 5
      roles/jitsi_jibri/handlers/main.yml
  5. 5
      roles/jitsi_jibri/meta/main.yml
  6. 8
      roles/jitsi_jibri/tasks/cleanup.yml
  7. 9
      roles/jitsi_jibri/tasks/conf.yml
  8. 17
      roles/jitsi_jibri/tasks/directories.yml
  9. 43
      roles/jitsi_jibri/tasks/facts.yml
  10. 82
      roles/jitsi_jibri/tasks/install.yml
  11. 9
      roles/jitsi_jibri/tasks/main.yml
  12. 5
      roles/jitsi_jibri/tasks/services.yml
  13. 5
      roles/jitsi_jibri/tasks/user.yml
  14. 100
      roles/jitsi_jibri/templates/jibri.conf.j2
  15. 16
      roles/jitsi_jibri/templates/jitsi-jibri-icewm.service.j2
  16. 17
      roles/jitsi_jibri/templates/jitsi-jibri-xorg.service.j2
  17. 22
      roles/jitsi_jibri/templates/jitsi-jibri.service.j2
  18. 135
      roles/jitsi_jibri/templates/xorg-video-dummy.conf.j2

@ -0,0 +1 @@
In developpment, not usable yet

@ -0,0 +1,23 @@
---
jitsi_root_dir: /opt/jitsi
jitsi_jibri_user: jibri
jitsi_jibri_git_url: https://github.com/jitsi/jibri.git
# Should ansible manage upgrades or only initial install
jitsi_jibri_manage_upgrade: "{{ jitsi_manage_upgrade | default(True) }}"
jitsi_jibri_domain: "{{ jitsi_domain | default(inventory_hostname) }}"
jitsi_jibri_auth_domain: "{{ jitsi_auth_domain | default('auth.' ~ jitsi_domain) }}"
jitsi_jibri_internal_auth_domain: internal.{{ jitsi_jibri_auth_domain }}
# XMPP password to connect to
jitsi_jibri_xmpp_server: "{{ jitsi_xmpp_server | default(inventory_hostname) }}"
jitsi_jibri_xmpp_user: jibri
jitsi_jibri_xmpp_domain: recorder.{{ jitsi_jibri_auth_domain }}
# A random pass will be created if not defined
# jitsi_jibri_xmpp_pass: s3cr3t.
jitsi_jibri_recorder_xmpp_user: recorder
# jitsi_jibri_recorder_xmpp_pass: p@ssw0rd

@ -0,0 +1,5 @@
---
- name: restart jitsi-jibri
service: name=jitsi-jibri state=restarted

@ -0,0 +1,5 @@
---
dependencies:
- role: repo_rpmfusion # For ffmpeg
- role: repo_google_chrome # For, well, Google Chrome ;-)

@ -0,0 +1,8 @@
---
- name: Remove tmp and obsolete files
file: path={{ item }} state=absent
loop:
- "{{ jitsi_root_dir }}/tmp/chromedriver_linux64.zip"
- "{{ jitsi_root_dir }}/tmp/chromedriver"
tags: jitsi

@ -0,0 +1,9 @@
---
- name: Deploy configuration
template: src={{ item }}.j2 dest={{ jitsi_root_dir }}/etc/jibri/{{ item }}
loop:
- xorg-video-dummy.conf
- jibri.conf
notify: restart jitsi-jibri
tags: jitsi

@ -0,0 +1,17 @@
---
- name: Create directories
file: path={{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
loop:
- dir: "{{ jitsi_root_dir }}/src/jibri"
owner: "{{ jitsi_jibri_user }}"
- dir: "{{ jitsi_root_dir }}/jibri"
owner: "{{ jitsi_jibri_user }}"
mode: 700
- dir: "{{ jitsi_root_dir }}/etc/jibri"
group: "{{ jitsi_jibri_user }}"
mode: 750
- dir: "{{ jitsi_root_dir }}/data/recordings"
owner: "{{ jitsi_jibri_user }}"
mode: 700
tags: jitsi

@ -0,0 +1,43 @@
---
- name: Generate a random pass for jibri
block:
- import_tasks: ../includes/get_rand_pass.yml
vars:
- pass_file: "{{ jitsi_root_dir }}/meta/ansible_jibri_xmpp_pass"
- set_fact: jitsi_jibri_xmpp_pass={{ rand_pass }}
when: jitsi_jibri_xmpp_pass is not defined
tags: jitsi
- name: Generate a random pass for recorder
block:
- import_tasks: ../includes/get_rand_pass.yml
vars:
- pass_file: "{{ jitsi_root_dir }}/meta/ansible_jibri_recorder_xmpp_pass"
- set_fact: jitsi_jibri_recorder_xmpp_pass={{ rand_pass }}
when: jitsi_jibri_recorder_xmpp_pass is not defined
tags: jitsi
- name: Check if jibri is built
stat: path={{ jitsi_root_dir }}/jibri/jibri.jar
register: jitsi_jibri_jar
tags: jitsi
- name: Check latest version of ChromeDriver
uri:
url: https://chromedriver.storage.googleapis.com/LATEST_RELEASE
return_content: True
register: jitsi_jibri_chromedriver_latest_version
tags: jitsi
- name: Check if ChromeDriver is installed
stat: path=/usr/local/bin/chromedriver
register: jitsi_jibri_chromedriver_bin
tags: jitsi
- name: Detect ChromeDriver version
shell: chromedriver --version | perl -pe 's/ChromeDriver (\d+(\.\d+)+).*/$1/'
register: jitsi_jibri_chromedriver_current_version
when: jitsi_jibri_chromedriver_bin.stat.exists
changed_when: False
tags: jitsi

@ -0,0 +1,82 @@
---
- name: Install dependencies
yum:
name:
- java-1.8.0-openjdk
- git
- google-chrome-stable
- ffmpeg
- curl
- alsa-utils
- icewm
- xdotool
- xorg-x11-drv-void
- xorg-x11-drv-dummy
tags: jitsi
# If the repo changed since the last run, we rebuild and restart the bridge
- name: Clone jibri repo
git:
repo: "{{ jitsi_jibri_git_url }}"
dest: "{{ jitsi_root_dir }}/src/jibri"
force: True
become_user: "{{ jitsi_jibri_user }}"
register: jitsi_jibri_git
tags: jitsi
- name: Install or update ChromeDriver
block:
- name: Download ChromeDriver
get_url:
url: http://chromedriver.storage.googleapis.com/{{ jitsi_jibri_chromedriver_latest_version.content }}/chromedriver_linux64.zip
dest: "{{ jitsi_root_dir }}/tmp"
- name: Extract ChromeDriver
unarchive:
src: "{{ jitsi_root_dir }}/tmp/chromedriver_linux64.zip"
dest: "{{ jitsi_root_dir }}/tmp"
remote_src: True
- name: Move ChromeDriver bin
copy:
src: "{{ jitsi_root_dir }}/tmp/chromedirver"
dest: /usr/local/bin/chromedriver
mode: 755
remote_src: True
when: not jitsi_jibri_chromedriver_bin.stat.exists or jitsi_jibri_chromedriver_current_version.stdout != jitsi_jibri_chromedriver_latest_version.content
tags: jitsi
- name: Install or update jibri
block:
- name: Build jibri
command: /opt/maven/apache-maven/bin/mvn package -DskipTests -Dassembly.skipAssembly=false
args:
chdir: "{{ jitsi_root_dir }}/src/jibri"
become_user: "{{ jitsi_jibri_user }}"
- name: Move jibri to its final directory
copy:
src: "{{ jitsi_root_dir }}/src/jibri/target/jibri-8.0-SNAPSHOT-jar-with-dependencies.jar"
dest: "{{ jitsi_root_dir }}/jibri/jibri.jar"
remote_src: True
notify: restart jitsi-jibri
when: (jitsi_jibri_git.changed and jitsi_jibri_manage_upgrade) or not jitsi_jibri_jar.stat.exists
tags: jitsi
- name: Deploy systemd units
template: src=jitsi-{{ item }}.service.j2 dest=/etc/systemd/system/jitsi-{{ item }}.service
loop:
- jibri
- jibri-xorg
- jibri-icewm
register: jitsi_jibri_unit
notify: restart jitsi-jibri
tags: jitsi
- name: Reload systemd
systemd: daemon_reload=True
when: jitsi_jibri_unit.results | selectattr('changed','equalto',True) | list | length > 0
tags: jitsi

@ -0,0 +1,9 @@
---
- include: user.yml
- include: directories.yml
- include: facts.yml
- include: install.yml
- include: conf.yml
- include: services.yml
- include: cleanup.yml

@ -0,0 +1,5 @@
---
- name: Start and enable services
service: name=jitsi-jibri state=started enabled=True
tags: jitsi

@ -0,0 +1,5 @@
---
- name: Create jibri user account
user: name={{ jitsi_jibri_user }} home={{ jitsi_root_dir }}/jibri system=True
tags: jitsi

@ -0,0 +1,100 @@
jibri {
id = "{{ inventory_hostname }}"
single-use-mode = false
api {
http {
external-api-port = 2222
internal-api-port = 3333
}
xmpp {
// See example_xmpp_envs.conf for an example of what is expected here
environments = [
{
name = "prod environment"
xmpp-server-hosts = ["{{ jitsi_jibri_xmpp_server }}"]
xmpp-domain = "{{ jitsi_jibri_domain }}"
control-muc {
domain = "{{ jitsi_jibri_internal_auth_domain }}"
room-name = "JibriBrewery"
nickname = "{{ inventory_hostname }}"
}
control-login {
domain = "{{ jitsi_jibri_auth_domain }}"
username = "{{ jitsi_jibri_xmpp_user }}"
password = "{{ jitsi_jibri_xmpp_pass }}"
}
call-login {
domain = "{{ jitsi_jibri_xmpp_domain }}"
username = "{{ jitsi_jibri_recorder_xmpp_user }}"
password = "{{ jitsi_jibri_recorder_xmpp_pass }}"
}
strip-from-room-domain = "conference."
usage-timeout = 0
trust-all-xmpp-certs = false
}]
}
}
recording {
recordings-directory = "{{ jitsi_root_dir }}/data/recordings"
//finalize-script = "/path/to/finalize_recording.sh"
}
streaming {
rtmp-allow-list = [
".*"
]
}
chrome {
// The flags which will be passed to chromium when launching
flags = [
"--use-fake-ui-for-media-stream",
"--start-maximized",
"--kiosk",
"--enabled",
"--disable-infobars",
"--autoplay-policy=no-user-gesture-required"
]
}
stats {
enable-stats-d = true
}
webhook {
// A list of subscribers interested in receiving webhook events
subscribers = []
}
jwt-info {
// The path to a .pem file which will be used to sign JWT tokens used in webhook
// requests. If not set, no JWT will be added to webhook requests.
# signing-key-path = "/path/to/key.pem"
// The kid to use as part of the JWT
# kid = "key-id"
// The issuer of the JWT
# issuer = "issuer"
// The audience of the JWT
# audience = "audience"
// The TTL of each generated JWT. Can't be less than 10 minutes.
# ttl = 1 hour
}
call-status-checks {
// If all clients have their audio and video muted and if Jibri does not
// detect any data stream (audio or video) comming in, it will stop
// recording after NO_MEDIA_TIMEOUT expires.
no-media-timeout = 30 seconds
// If all clients have their audio and video muted, Jibri consideres this
// as an empty call and stops the recording after ALL_MUTED_TIMEOUT expires.
all-muted-timeout = 10 minutes
// When detecting if a call is empty, Jibri takes into consideration for how
// long the call has been empty already. If it has been empty for more than
// DEFAULT_CALL_EMPTY_TIMEOUT, it will consider it empty and stop the recording.
default-call-empty-timeout = 30 seconds
}
}

@ -0,0 +1,16 @@
[Unit]
Description=Jibri Window Manager
Requires=jitsi-jibri-xorg.service
After=jitsi-jibri-xorg.service
[Service]
User={{ jitsi_jibri_user }}
Group={{ jitsi_jibri_user }}
Environment=DISPLAY=:0
ExecStart=/usr/bin/icewm-session
Restart=on-failure
RestartPreventExitStatus=255
Type=simple
[Install]
WantedBy=jitsi-jibri.service

@ -0,0 +1,17 @@
[Unit]
Description=Jibri Xorg Process
After=network.target
[Service]
User={{ jitsi_jibri_user }}
Group={{ jitsi_jibri_user }}
Environment=DISPLAY=:0
ExecStart=/usr/bin/Xorg -nocursor -noreset +extension RANDR +extension RENDER -logfile /dev/stdout -config {{ jitsi_root_dir }}/jibri/xorg-video-dummy.conf :0
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=simple
[Install]
WantedBy=jitsi-jibri.service jitsi-jibri-icewm.service

@ -0,0 +1,22 @@
[Unit]
Description=Jitsi Broadcasting Infrastructure
After=network.target
[Service]
Type=simple
SuccessExitStatus=143
User={{ jitsi_jibri_user }}
Group={{ jitsi_jibri_user }}
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=full
ReadOnlyDirectories={{ jitsi_root_dir }}/etc {{ jitsi_root_dir }}/jibri
Restart=on-failure
StartLimitInterval=0
RestartSec=30
ExecStart=/bin/java -Dconfig.file="{{ jitsi_root_dir }}/etc/jibri/jibri.conf" -jar {{ jitsi_root_dir }}/jibri/jibri.jar
[Install]
WantedBy=multi-user.target

@ -0,0 +1,135 @@
# This xorg configuration file is meant to be used by xpra
# to start a dummy X11 server.
# For details, please see:
# https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
Option "AutoEnableDevices" "false"
Option "AutoAddDevices" "false"
EndSection
Section "InputDevice"
Identifier "dummy_mouse"
Option "CorePointer" "true"
Driver "void"
EndSection
Section "InputDevice"
Identifier "dummy_keyboard"
Option "CoreKeyboard" "true"
Driver "void"
EndSection
Section "Device"
Identifier "dummy_videocard"
Driver "dummy"
Option "ConstantDPI" "true"
#VideoRam 4096000
#VideoRam 256000
VideoRam 192000
EndSection
Section "Monitor"
Identifier "dummy_monitor"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
#This can be used to get a specific DPI, but only for the default resolution:
#DisplaySize 508 317
#NOTE: the highest modes will not work without increasing the VideoRam
# for the dummy video card.
Modeline "32768x32768" 15226.50 32768 35800 39488 46208 32768 32771 32781 32953
Modeline "32768x16384" 7516.25 32768 35544 39192 45616 16384 16387 16397 16478
Modeline "16384x8192" 2101.93 16384 16416 24400 24432 8192 8390 8403 8602
Modeline "8192x4096" 424.46 8192 8224 9832 9864 4096 4195 4202 4301
Modeline "5496x1200" 199.13 5496 5528 6280 6312 1200 1228 1233 1261
Modeline "5280x1080" 169.96 5280 5312 5952 5984 1080 1105 1110 1135
Modeline "5280x1200" 191.40 5280 5312 6032 6064 1200 1228 1233 1261
Modeline "5120x3200" 199.75 5120 5152 5904 5936 3200 3277 3283 3361
Modeline "4800x1200" 64.42 4800 4832 5072 5104 1200 1229 1231 1261
Modeline "3840x2880" 133.43 3840 3872 4376 4408 2880 2950 2955 3025
Modeline "3840x2560" 116.93 3840 3872 4312 4344 2560 2622 2627 2689
Modeline "3840x2048" 91.45 3840 3872 4216 4248 2048 2097 2101 2151
Modeline "3840x1080" 100.38 3840 3848 4216 4592 1080 1081 1084 1093
Modeline "3600x1200" 106.06 3600 3632 3984 4368 1200 1201 1204 1214
Modeline "3288x1080" 39.76 3288 3320 3464 3496 1080 1106 1108 1135
Modeline "2048x2048" 49.47 2048 2080 2264 2296 2048 2097 2101 2151
Modeline "2048x1536" 80.06 2048 2104 2312 2576 1536 1537 1540 1554
Modeline "2560x1600" 47.12 2560 2592 2768 2800 1600 1639 1642 1681
Modeline "2560x1440" 42.12 2560 2592 2752 2784 1440 1475 1478 1513
Modeline "1920x1440" 69.47 1920 1960 2152 2384 1440 1441 1444 1457
Modeline "1920x1200" 26.28 1920 1952 2048 2080 1200 1229 1231 1261
Modeline "1920x1080" 23.53 1920 1952 2040 2072 1080 1106 1108 1135
Modeline "1680x1050" 20.08 1680 1712 1784 1816 1050 1075 1077 1103
Modeline "1600x1200" 22.04 1600 1632 1712 1744 1200 1229 1231 1261
Modeline "1600x900" 33.92 1600 1632 1760 1792 900 921 924 946
Modeline "1440x900" 30.66 1440 1472 1584 1616 900 921 924 946
ModeLine "1366x768" 72.00 1366 1414 1446 1494 768 771 777 803
Modeline "1280x1024" 31.50 1280 1312 1424 1456 1024 1048 1052 1076
Modeline "1280x800" 24.15 1280 1312 1400 1432 800 819 822 841
Modeline "1280x768" 23.11 1280 1312 1392 1424 768 786 789 807
Modeline "1360x768" 24.49 1360 1392 1480 1512 768 786 789 807
Modeline "1024x768" 18.71 1024 1056 1120 1152 768 786 789 807
Modeline "768x1024" 19.50 768 800 872 904 1024 1048 1052 1076
#common resolutions for android devices (both orientations):
Modeline "800x1280" 25.89 800 832 928 960 1280 1310 1315 1345
Modeline "1280x800" 24.15 1280 1312 1400 1432 800 819 822 841
Modeline "720x1280" 30.22 720 752 864 896 1280 1309 1315 1345
Modeline "1280x720" 27.41 1280 1312 1416 1448 720 737 740 757
Modeline "768x1024" 24.93 768 800 888 920 1024 1047 1052 1076
Modeline "1024x768" 23.77 1024 1056 1144 1176 768 785 789 807
Modeline "600x1024" 19.90 600 632 704 736 1024 1047 1052 1076
Modeline "1024x600" 18.26 1024 1056 1120 1152 600 614 617 631
Modeline "536x960" 16.74 536 568 624 656 960 982 986 1009
Modeline "960x536" 15.23 960 992 1048 1080 536 548 551 563
Modeline "600x800" 15.17 600 632 688 720 800 818 822 841
Modeline "800x600" 14.50 800 832 880 912 600 614 617 631
Modeline "480x854" 13.34 480 512 560 592 854 873 877 897
Modeline "848x480" 12.09 848 880 920 952 480 491 493 505
Modeline "480x800" 12.43 480 512 552 584 800 818 822 841
Modeline "800x480" 11.46 800 832 872 904 480 491 493 505
#resolutions for android devices (both orientations)
#minus the status bar
#38px status bar (and width rounded up)
Modeline "800x1242" 25.03 800 832 920 952 1242 1271 1275 1305
Modeline "1280x762" 22.93 1280 1312 1392 1424 762 780 783 801
Modeline "720x1242" 29.20 720 752 856 888 1242 1271 1276 1305
Modeline "1280x682" 25.85 1280 1312 1408 1440 682 698 701 717
Modeline "768x986" 23.90 768 800 888 920 986 1009 1013 1036
Modeline "1024x730" 22.50 1024 1056 1136 1168 730 747 750 767
Modeline "600x986" 19.07 600 632 704 736 986 1009 1013 1036
Modeline "1024x562" 17.03 1024 1056 1120 1152 562 575 578 591
Modeline "536x922" 16.01 536 568 624 656 922 943 947 969
Modeline "960x498" 14.09 960 992 1040 1072 498 509 511 523
Modeline "600x762" 14.39 600 632 680 712 762 779 783 801
Modeline "800x562" 13.52 800 832 880 912 562 575 578 591
Modeline "480x810" 12.59 480 512 552 584 810 828 832 851
Modeline "848x442" 11.09 848 880 920 952 442 452 454 465
Modeline "480x762" 11.79 480 512 552 584 762 779 783 801
EndSection
Section "Screen"
Identifier "dummy_screen"
Device "dummy_videocard"
Monitor "dummy_monitor"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
#Modes "32768x32768" "32768x16384" "16384x8192" "8192x4096" "5120x3200" "3840x2880" "3840x2560" "3840x2048" "2048x2048" "2560x1600" "1920x1440" "1920x1200" "1920x1080" "1600x1200" "1680x1050" "1600x900" "1400x1050" "1440x900" "1280x1024" "1366x768" "1280x800" "1024x768" "1024x600" "800x600" "320x200"
Modes "5120x3200" "3840x2880" "3840x2560" "3840x2048" "2048x2048" "2560x1600" "1920x1440" "1920x1200" "1920x1080" "1600x1200" "1680x1050" "1600x900" "1400x1050" "1440x900" "1280x1024" "1366x768" "1280x800" "1024x768" "1024x600" "800x600" "320x200"
#Virtual 1280 720
Virtual 1920 1080
EndSubSection
EndSection
Section "ServerLayout"
Identifier "dummy_layout"
Screen "dummy_screen"
InputDevice "dummy_mouse"
InputDevice "dummy_keyboard"
EndSection
Loading…
Cancel
Save