Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
pcm.amix {
type dmix
ipc_key 219345
slave.pcm "hw:Loopback,0,0"
}
pcm.asnoop {
type dsnoop
ipc_key 219346
slave.pcm "hw:Loopback_1,1,0"
}
pcm.aduplex {
type asym
playback.pcm "amix"
capture.pcm "asnoop"
}
pcm.bmix {
type dmix
ipc_key 219347
slave.pcm "hw:Loopback_1,0,0"
}
pcm.bsnoop {
type dsnoop
ipc_key 219348
slave.pcm "hw:Loopback,1,0"
}
pcm.bduplex {
type asym
playback.pcm "bmix"
capture.pcm "bsnoop"
}
pcm.pjsua {
type plug
slave.pcm "bduplex"
}
pcm.!default {
type plug
slave.pcm "aduplex"
}

View File

@@ -0,0 +1,3 @@
#!/bin/bash -e
find {{ jitsi_root_dir }}/data/recordings -maxdepth 1 -type d -mtime +30 -exec rm -rf "{}" \;

View File

@@ -0,0 +1,83 @@
#!/usr/bin/perl -w
use strict;
use warnings;
use JSON;
use YAML::Tiny;
use Getopt::Long;
use Email::MIME;
use Email::Sender::Simple qw(sendmail);
use File::Basename;
use utf8;
my $conf = {};
my $opt = {
config => '{{ jitsi_root_dir }}/etc/jibri/finalize.yml'
};
GetOptions(
"config=s" => \$opt->{config}
);
sub send_mail {
my ($subject, $dest, $body) = @_;
my $mail = Email::MIME->create(
header_str => [
From => $conf->{from},
To => $dest,
Subject => $subject
],
attributes => {
charset => 'utf-8',
encoding => 'base64'
},
body_str => $body
);
sendmail($mail);
}
# Read config file
if (-e $opt->{config}){
my $yaml = YAML::Tiny->read( $opt->{config} )
or die "Config file " . $opt->{config} . " is invalid\n";
if ( not $yaml->[0] ) {
die "Config file " . $opt->{config} . " is invalid\n";
}
$conf = $yaml->[0];
}
$conf->{notify} ||= [];
my $recording = $ARGV[0];
my $metadata = {};
if (-e "$recording/metadata.json"){
open(my $jst, "$recording/metadata.json") or die "$!";
local $/;
$metadata = from_json(<$jst>);
}
my $video = undef;
opendir ( DIR, $recording ) || die "Error in opening dir $recording\n";
while( (my $filename = readdir(DIR))) {
if ($filename =~ m/\.mp4$/){
$video = basename($filename);
last;
}
}
closedir(DIR);
foreach my $participant (@{$metadata->{participants}}){
push @{$conf->{notify}}, $participant->{user}->{id};
}
if (defined $video){
foreach my $dest (@{$conf->{notify}}){
send_mail(
"Enregistrement Jitsi Meet",
$dest,
"L'enregistrement vidéo est disponible à l'adresse $conf->{base_url}/" .
basename($recording) . "/$video\n"
);
}
}

View File

@@ -0,0 +1,10 @@
---
from: jitsi-noreply@{{ ansible_domain }}
{% if jitsi_jibri_recording_notify | length > 0 %}
notify:
{% for dest in jitsi_jibri_recording_notify %}
- {{ dest }}
{% endfor %}
{% endif %}
base_url: {{ jitsi_jibri_recordings_base_url }}

View File

@@ -0,0 +1,88 @@
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 = "{{ jitsi_root_dir }}/jibri/finalize.pl"
}
streaming {
rtmp-allow-list = [
".*"
]
}
ffmpeg {
//resolution = "1024x768"
// The audio source that will be used to capture audio on Linux
audio-source = "alsa"
// The audio device that will be used to capture audio on Linux
audio-device = "plug:bsnoop"
}
chrome {
// The flags which will be passed to chromium when launching
flags = [
"--use-fake-ui-for-media-stream",
//"--start-maximized",
"--window-size=1920,1080",
"--kiosk",
"--enabled",
"--disable-infobars",
"--autoplay-policy=no-user-gesture-required"
]
}
stats {
enable-stats-d = true
}
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
}
}

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Jibri Recordings Cleaner
[Service]
Type=oneshot
PrivateTmp=yes
User={{ jitsi_jibri_user }}
Group={{ jitsi_jibri_user }}
ExecStart={{ jitsi_root_dir }}/jibri/clean_records.sh

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Jibri Recordings Cleaner
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target

View File

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

View File

@@ -0,0 +1,20 @@
[Unit]
Description=Jitsi Broadcasting Infrastructure
After=network.target
Requires=jitsi-jibri-xorg.service
[Service]
Type=simple
SuccessExitStatus=143
User={{ jitsi_jibri_user }}
Group={{ jitsi_jibri_user }}
PrivateTmp=true
Restart=always
StartLimitInterval=0
RestartSec=30
ExecStart=/bin/java -Dconfig.file={{ jitsi_root_dir }}/etc/jibri/jibri.conf -jar {{ jitsi_root_dir }}/jibri/jibri.jar
SyslogIdentifier=jibri
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,5 @@
# Serve recordings through nginx
location /recordings {
alias /opt/jitsi/data/recordings;
add_header Content-disposition "attachment";
}

View File

@@ -0,0 +1,26 @@
Section "Device"
Identifier "Configured Video Device"
Driver "dummy"
VideoRam 256000
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
ModeLine "1920x1080" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +Hsync +Vsync
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection