User Tools

Site Tools


jitsi

Repris et traduit depuis le dépôt officiel,

Jitsi est un ensemble de projets open-source qui vous permettent de facilement construire et déployer des solutions sécurisées de vidéoconférence.
Au coeur de Jitsi on trouve Jitsi Vidéobridge et Jitsi Meet qui vous permettent d'organiser des conférences sur Internet…

Sur cette page nous présenterons l'usage de Jitsi au cmNOG

Principales fonctions utilisées

  • vidéoconférence
  • enregistrement local des conférences
  • diffusion en direct sur Youtube

Afin d'améliorer la lisibilité, pour certains fichiers, nous ne présenterons que la différence entre le fichier à son installation et après modification.

Environnement et versions employées

Autant que possible, il faut toujours séparer les services qui peuvent l'être.

Instance Hardware Software Notes
meet.cmnog.cm CPU: 4 coeurs
RAM: 8 GB
OS: Debian 10
Jitsi-meet (2.0.4468-1)
Jitsi-videobridge2 (2.1-183-gdbddd169-1)
Jicofo (1.0-549-1)
stream2.cmnog.cm CPU: 4 coeurs
RAM: 8 GB
OS: ubuntu 20.04
Jibri (8.0-14-g0ccc3f6-1)
ffmpeg (7:4.2.2-1ubuntu1)

Mise en place

Sur meet.cmnog

Il s'agit d'une contextualisation de l'installation rapide du guide officiel.

Bien évidemment dans le fichier de zone, il faut les entrées correspondantes pour le serveur pour y accéder en IPv4 et IPv6.

Quelques paquets à installer avant jitsi: nginx, apt-transport-https

root@vps2:~# apt update
root@vps2:~# apt install nginx gnupg2 apt-transport-https

Le logiciel recommande des entrées statiques dans le fichier /etc/hosts également. Le notre est donc

diff --git a/hosts b/hosts
index 45c0345..eee6c00 100644
--- a/hosts
+++ b/hosts
@@ -1,6 +1,6 @@
-127.0.0.1      localhost vps2
+127.0.0.1      localhost vps2 meet.cmnog.cm
 
 # The following lines are desirable for IPv6 capable hosts
-::1     localhost ip6-localhost ip6-loopback vps2
+::1     localhost ip6-localhost ip6-loopback vps2 meet.cmnog.cm
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters

Ajouter le dépôt de jitsi

root@vps2:~# echo 'deb https://download.jitsi.org stable/' | tee /etc/apt/sources.list.d/jitsi-stable.list
wget -qO -  https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -

Installation de jitsi-meet

root@vps2:~# apt update
root@vps2:~# apt install jitsi-meet

Pendant l'installation, il vous sera demandé de donner le nom de l'instance jitsi. Dans notre cas: meet.cmnog.cm

Cette procédure permet d'avoir une instance jitsi ouverte à tout public. C'est à dire que n'importe qui peut créer un nouveau salon. Dans notre usage, nous souhaitons restreindre l'ouverture d'un salon à des comptes auorisés. Cela se fait à ajoutant un domaine sécurisé.

Le reste de la documentation tient compte du fait qu'il s'agit d'un domaine sécurisé au sens de jitsi.

Sauter l'installtion de letsencrypt

Installation des certificats

root@vps2:~# apt install certbot
root@vps2:~# systemctl stop nginx
root@vps2:~# certbot certonly --standalone -d meet.cmnog.cm

Les clés seront utilisées dans la déclaration du virtualhost dans nginx.

Jitsi aura besoin de certains comptes xmpp pour son fonctionnement. Les scripts d'installation créeront les comptes utilisés pour son fonctionnement interne. Il faudra rajouter au moins 2 types de comptes:

  • Pour ceux qui pourront ouvrir/gérer des salons
  • Pour Jibri, qui aura besoin de deux comptes

Pour créer un compte il faut proceder ainsi

root@vps2:~# prosodyctl adduser JID

JID correspond au compte à créer. Ex: me@meet.cmnog.cm

La configuration fait appel à la modification de certains logiciels.

Nginx

  • /etc/nginx/sites-available/meet.cmnog.cm.conf
diff --git a/nginx/sites-available/meet.cmnog.cm.conf b/nginx/sites-available/meet.cmnog.cm.conf
index 490ac7a..c862cc3 100644
--- a/nginx/sites-available/meet.cmnog.cm.conf
+++ b/nginx/sites-available/meet.cmnog.cm.conf
@@ -27,8 +27,8 @@ server {
 
     add_header Strict-Transport-Security "max-age=31536000";
 
-    ssl_certificate /etc/jitsi/meet/meet.cmnog.cm.crt;
-    ssl_certificate_key /etc/jitsi/meet/meet.cmnog.cm.key;
+    ssl_certificate /etc/letsencrypt/live/meet.cmnog.cm/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/meet.cmnog.cm/privkey.pem;
 
     root /usr/share/jitsi-meet;
  • Le fichier /etc/nginx/modules-enables/60-jitsi-meet.conf est utilisé pour faire le mapping entre jitsi et nginx sur notamment les ports à utiliser
# this is jitsi-meet nginx module configuration
# this forward all http traffic to the nginx virtual host port
# and the rest to the turn server
 
stream {
    upstream web {
        server 127.0.0.1:4444;
    }
    upstream turn {
        server 127.0.0.1:4445;
    }
    # since 1.13.10
    map $ssl_preread_alpn_protocols $upstream {
        ~\bh2\b         web;
        ~\bhttp/1\.     web;
        default         turn;
    }
 
    server {
        listen 443;
        listen [::]:443;
 
        # since 1.11.5
        ssl_preread on;
        proxy_pass $upstream;
 
        # Increase buffer to serve video
        proxy_buffer_size 10m;
    }
}

Coturn

  • Rien à modifir par défaut sur /etc/turnserver.conf
root@vps2:~# cat turnserver.conf
# jitsi-meet coturn config. Do not modify this line
lt-cred-mech
use-auth-secret
keep-address-family
static-auth-secret=IwannaBewithYouuuuuuuu
realm=meet.cmnog.cm
cert=/etc/jitsi/meet/meet.cmnog.cm.crt
pkey=/etc/jitsi/meet/meet.cmnog.cm.key
 
no-tcp
listening-port=443
tls-listening-port=4445
external-ip=meet.cmnog.cm
 
syslog

Prosody

Configuration locale du serveur xmpp.

  • /etc/prosody/conf.d/meet.cmnog.cm.cfg.lua
diff --git a/prosody/conf.avail/meet.cmnog.cm.cfg.lua b/prosody/conf.avail/meet.cmnog.cm.cfg.lua
index 61a1443..b0b1f9a 100644
--- a/prosody/conf.avail/meet.cmnog.cm.cfg.lua
+++ b/prosody/conf.avail/meet.cmnog.cm.cfg.lua
@@ -16,7 +16,7 @@ consider_bosh_secure = true;
 
 VirtualHost "meet.cmnog.cm"
         -- enabled = false -- Remove this line to enable this host
-        authentication = "anonymous"
+        authentication = "internal_plain"
         -- Properties below are modified by jitsi-meet-tokens package config
         -- and authentication above is switched to "token"
         --app_id="example_app_id"
@@ -42,11 +42,22 @@ VirtualHost "meet.cmnog.cm"
         }
         c2s_require_encryption = false
 
+VirtualHost "guest.meet.cmnog.cm"
+        authentication = "anonymous"
+        c2s_require_encryption = false
+        
+VirtualHost "recorder.meet.cmnog.cm"
+        modules_enabled = {
+            "ping";
+    }
+        authentication = "internal_plain"
+
 Component "conference.meet.cmnog.cm" "muc"
     storage = "memory"
     modules_enabled = {
         "muc_meeting_id";
         "muc_domain_mapper";
+        "muc_mam";
         -- "token_verification";
     }
     admins = { "focus@auth.meet.cmnog.cm" }
@@ -56,6 +67,7 @@ Component "conference.meet.cmnog.cm" "muc"
 -- internal muc component
 Component "internal.auth.meet.cmnog.cm" "muc"
     storage = "memory"
+    muc_room_cache_size = 1000
     modules_enabled = {
       "ping";
     }

Jitsi

Les modifications locales vont porter sur 2 fichiers.

  • /etc/jitsi/meet/meet.cmnog.cm-config.js
diff --git a/jitsi/meet/meet.cmnog.cm-config.js b/jitsi/meet/meet.cmnog.cm-config.js
index 3cd639d..f4166b2 100644
--- a/jitsi/meet/meet.cmnog.cm-config.js
+++ b/jitsi/meet/meet.cmnog.cm-config.js
@@ -9,7 +9,7 @@ var config = {
         domain: 'meet.cmnog.cm',
 
         // When using authentication, domain for guest users.
-        // anonymousdomain: 'guest.example.com',
+        anonymousdomain: 'guest.meet.cmnog.cm',
 
         // Domain for authenticated users. Defaults to <domain>.
         // authdomain: 'meet.cmnog.cm',
@@ -179,7 +179,8 @@ var config = {
     // Recording
 
     // Whether to enable file recording or not.
-    // fileRecordingsEnabled: false,
+     fileRecordingsEnabled: true,
+     hiddenDomain:'recorder.meet.cmnog.cm',
     // Enable the dropbox integration.
     // dropbox: {
     //     appKey: '<APP_KEY>' // Specify your app key here.
@@ -200,7 +201,7 @@ var config = {
     // fileRecordingsServiceSharingEnabled: false,
 
     // Whether to enable live streaming or not.
-    // liveStreamingEnabled: false,
+     liveStreamingEnabled: true,
 
     // Transcription (in interface_config,
     // subtitles and buttons can be configured)
  • /etc/jitsi/videobridge/sip-communicator.properties
diff --git a/jitsi/jicofo/sip-communicator.properties b/jitsi/jicofo/sip-communicator.properties
index cbcb394..e65a34b 100644
--- a/jitsi/jicofo/sip-communicator.properties
+++ b/jitsi/jicofo/sip-communicator.properties
@@ -1 +1,4 @@
 org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.meet.cmnog.cm
+org.jitsi.jicofo.auth.URL=XMPP:meet.cmnog.cm
+org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.meet.cmnog.cm
+org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90

Sur stream2.cmnog

Cette instance accueille principalement le nécessaire pour enregistrer les réunions et streamer (sur Youtube). Le composant de jitsi impliqué ici est: jibri.

L'installation s'est faite sur Ubuntu 20.04 qui vient avec une version récente de ffmpeg qui est un ensemble d'outils pour transcodage et streaming de fichiers multimédia.

Préconfiguration

  • Installer le paquet linux-image-extra-virtual afin de pouvoir utiliser le module ALSA.
  • ajouter snd-aloop dans /etc/modules
  • Si vous voulez charger directement en mémoire vive : modprobe snd-aloop
  • Installer ffmpeg
  • Installer le navigateur web Chrome et chromedriver
root@stream2:~# curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
root@stream2:~# echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
root@stream2:~# apt update
root@stream2:~# apt install google-chrome-stable
  • Ajouter le fichier de gestion de stratégie de chrome
root@stream2:~# mkdir -p /etc/opt/chrome/policies/managed
root@stream2:~# echo '{ "CommandLineFlagSecurityWarningsEnabled": false }' >>/etc/opt/chrome/policies/managed/managed_policies.json
  • Installation de chromedriver
root@stream2:~# CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
root@stream2:~# wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/
root@stream2:~# unzip ~/chromedriver_linux64.zip -d ~/
root@stream2:~# rm ~/chromedriver_linux64.zip
root@stream2:~# mv -f ~/chromedriver /usr/local/bin/chromedriver
root@stream2:~# chown root:root /usr/local/bin/chromedriver
root@stream2:~# chmod 0755 /usr/local/bin/chromedriver

Autres paquets nécessaires

root@stream2:~# apt install default-jre-headless curl alsa-utils icewm xdotool xserver-xorg-input-void xserver-xorg-video-dummy

Jibri

root@stream2:~# wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -
root@stream2:~# sh -c "echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list"
root@stream2:~# apt update
root@stream2:~# apt install jibri

Ajouter jibri dans certains groupes :

root@stream2:~# for group in adm plugdev; do adduser jibri $group; done

A l'installation; jibri faisait déjà partie des groupes audio et video

Créer le repertoire de destination des enregistrements /srv/jibri/recordings

Jibri doit en être le propriétaire

root@stream2:~# mkdir -p /srv/jibri/recordings
root@stream2:~# chown -R jibri /srv/jibri/

Le principal fichier à considérer sur cette instance est /etc/jitsi/jibri/config.json.

diff --git a/jitsi/jibri/config.json b/jitsi/jibri/config.json
index 6edaf3a..adfe5cf 100644
--- a/jitsi/jibri/config.json
+++ b/jitsi/jibri/config.json
@@ -3,9 +3,9 @@
     // values from your environment
 
     // Where recording files should be temporarily stored
-    "recording_directory":"/tmp/recordings",
+    "recording_directory":"/srv/jibri/recordings",
     // The path to the script which will be run on completed recordings
-    "finalize_recording_script_path": "/path/to/finalize_recording.sh",
+    "finalize_recording_script_path": "",
     "xmpp_environments": [
         {
             // A friendly name for this environment which can be used
@@ -14,34 +14,34 @@
             // The hosts of the XMPP servers to connect to as part of
             //  this environment
             "xmpp_server_hosts": [
-                "prod.xmpp.host.net"
+                "meet.cmnog.cm"
             ],
             // The xmpp domain we'll connect to on the XMPP server
-            "xmpp_domain": "xmpp.domain",
+            "xmpp_domain": "meet.cmnog.cm",
             // Jibri will login to the xmpp server as a privileged user 
             "control_login": {
                 // The domain to use for logging in
-                "domain": "auth.xmpp.domain",
+                "domain": "auth.meet.cmnog.cm",
                 // The credentials for logging in
-                "username": "username",
-                "password": "password"
+                "username": "jibri",
+                "password": "sssssskjkjkjksssssss"
             },
             // Using the control_login information above, Jibri will join 
             //  a control muc as a means of announcing its availability 
             //  to provide services for a given environment
             "control_muc": {
-                "domain": "internal.auth.xmpp.domain",
+                "domain": "internal.auth.meet.cmnog.cm",
                 "room_name": "JibriBrewery",
-                "nickname": "jibri-nickname"
+                "nickname": "jibri"
             },
             // All participants in a call join a muc so they can exchange
             //  information.  Jibri can be instructed to join a special muc
             //  with credentials to give it special abilities (e.g. not being
             //  displayed to other users like a normal participant)
             "call_login": {
-                "domain": "recorder.xmpp.domain",
-                "username": "username",
-                "password": "password"
+                "domain": "recorder.meet.cmnog.cm",
+                "username": "recorder",
+                "password": "seeUseeMe"
             },
             // When jibri gets a request to start a service for a room, the room
             //  jid will look like:

A Considerer sur l'instance de jitsi-meet

Sur l'instance hébergeant jitsi-meet; les sections les plus importantes sont

  • prosody
    • le Component “internal.meet.cmnog.cm” “muc”
    • le virtualhost recorder.meet.cmnog.cm
    • la creation de deux comptes xmpp
      • jibri@auth.meet.cmnog.cm
      • recorder@meet.cmnog.cm
  • jicofo
    • le fichier /etc/jitsi/jicofo/sip-communicator.properties avec ces deux informations
org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.meet.cmnog.cm
org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90
  • Dans /etc/jitsi/meet/yourdomain-config.js activez
    • fileRecordingsEnabled: true
    • liveStreamingEnabled: true
    • hiddenDomain: 'recorder.meet.cmnog.cm'

Exploitation

Création d'un salon

  • Pour créer un salon, il faut se rendre saisir le nom que l'on souhaite donner à la salle.
  • Si vous êtes l'hôte, il vous faudra saisir vos paramètres d'authentification
    • la création de compte s fait à l'aide de la commande prosodyctl adduser JID
  • Si vous n'êtes pas l'hôte, il faudra attendre qu'une personne ouvre la salle

Enregistrement et streaming

 Vu d'ensemble du menu

Enregistrement

Le modérateur de la salle peut démarrer l'enregistrement si l'instance de jibri est disponible. Pour cela il faut

  • Être modérateur
  • Etant dans une salle; cliquer sur les trois points
  • Menu Commencer l'enregistrement
  • Vous terminez l'enregistrement en suivant le même chemin

Les enregistrements par défaut sont stockés sur stream2 dans le dossier indiqué par la variable recording_directory

Streaming sur Youtube

Côté youtube

 Page d'édition du flux dans Youtube studio

  • Cliquer sur le menu “Créer” –> “Passer au direct”
  • Configurer la diffusion
  • Copier la clé de flux
  • Attendre que jibri envoie le flux avant de passer effectivement au direct

Côté Jitsi

  • Être modérateur
  • Etant dans une salle; cliquer sur les trois points
  • Menu Démarrer la diffusion en direct
  • Insérer la clé de flux
  • Si tout est ok, une charmante voix vous préviendra que le streaming a démarré
  • A la fin de session, arrêter la diffusion
jitsi.txt · Last modified: 2021/06/05 11:12 by willy