From 3473cff4b0ff09f29388558c0f54e7b44f98e2e8 Mon Sep 17 00:00:00 2001 From: Cleeyv Date: Thu, 23 Sep 2021 21:12:12 -0400 Subject: [PATCH] nixos/jibri: init at 8.0-93-g51fe7a2 This module was written by @puckipedia for nixcon-video-infra 2020. Minor changes made by @cleeyv for compat with existing jibri package. Co-authored-by: Puck Meerburg --- nixos/modules/module-list.nix | 1 + .../services/networking/jibri/default.nix | 23 +++++++++---- .../jibri/logging.properties-journal | 32 +++++++++++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 nixos/modules/services/networking/jibri/logging.properties-journal diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d4aaa7ebd221..41a7db17c328 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -756,6 +756,7 @@ ./services/networking/iscsi/root-initiator.nix ./services/networking/iscsi/target.nix ./services/networking/iwd.nix + ./services/networking/jibri/default.nix ./services/networking/jicofo.nix ./services/networking/jitsi-videobridge.nix ./services/networking/kea.nix diff --git a/nixos/modules/services/networking/jibri/default.nix b/nixos/modules/services/networking/jibri/default.nix index 6075676c1bdb..cae5ee9931e1 100644 --- a/nixos/modules/services/networking/jibri/default.nix +++ b/nixos/modules/services/networking/jibri/default.nix @@ -55,7 +55,11 @@ let recording = { recordings-directory = "/tmp/recordings"; +<<<<<<< HEAD finalize-script = "${cfg.finalizeScript}"; +======= + finalize-script = "/path/to/finalize"; # TODO(puck): replace with actual noop default +>>>>>>> a1dc2ddd630 (nixos/jibri: init at 8.0-93-g51fe7a2) }; streaming.rtmp-allow-list = [ ".*" ]; @@ -116,6 +120,8 @@ in ''; }; +======= +>>>>>>> a1dc2ddd630 (nixos/jibri: init at 8.0-93-g51fe7a2) xmppEnvironments = mkOption { description = '' XMPP servers to connect to. @@ -242,6 +248,7 @@ in config = mkIf cfg.enable { users.groups.jibri = { }; + users.groups.plugdev = { }; users.users.jibri = { isSystemUser = true; group = "jibri"; @@ -305,7 +312,7 @@ in after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - path = [ pkgs.chromedriver pkgs.chromium pkgs.ffmpeg-full ]; + path = with pkgs; [ chromedriver chromium ffmpeg-full ]; script = (concatStrings (mapAttrsToList (name: env: '' @@ -314,7 +321,11 @@ in '') cfg.xmppEnvironments)) + '' +<<<<<<< HEAD ${pkgs.jre8_headless}/bin/java -Djava.util.logging.config.file=${./logging.properties-journal} -Dconfig.file=${configFile} -jar ${pkgs.jibri}/opt/jitsi/jibri/jibri.jar --config /var/lib/jibri/jibri.json +======= + ${pkgs.jre_headless}/bin/java -Djava.util.logging.config.file=${./logging.properties-journal} -Dconfig.file=${configFile} -jar ${pkgs.jibri}/opt/jitsi/jibri/jibri.jar --config /var/lib/jibri/jibri.json +>>>>>>> a1dc2ddd630 (nixos/jibri: init at 8.0-93-g51fe7a2) ''; environment.HOME = "/var/lib/jibri"; @@ -331,15 +342,15 @@ in }; }; - systemd.tmpfiles.rules = - [ - "d /var/log/jitsi/jibri 755 jibri" - ]; + systemd.tmpfiles.rules = [ + "d /var/log/jitsi/jibri 755 jibri jibri" + ]; # Configure Chromium to not show the "Chrome is being controlled by automatic test software" message. environment.etc."chromium/policies/managed/managed_policies.json".text = builtins.toJSON { CommandLineFlagSecurityWarningsEnabled = false; }; + warnings = [ "All security warnings for Chromium have been disabled. This is necessary for Jibri, but it also impacts all other uses of Chromium on this system." ]; boot = { extraModprobeConfig = '' @@ -349,5 +360,5 @@ in }; }; - meta.maintainers = with lib.maintainers; [ ]; + meta.maintainers = lib.teams.jitsi.members; } diff --git a/nixos/modules/services/networking/jibri/logging.properties-journal b/nixos/modules/services/networking/jibri/logging.properties-journal new file mode 100644 index 000000000000..61eadbfddcb3 --- /dev/null +++ b/nixos/modules/services/networking/jibri/logging.properties-journal @@ -0,0 +1,32 @@ +handlers = java.util.logging.FileHandler + +java.util.logging.FileHandler.level = FINE +java.util.logging.FileHandler.pattern = /var/log/jitsi/jibri/log.%g.txt +java.util.logging.FileHandler.formatter = net.java.sip.communicator.util.ScLogFormatter +java.util.logging.FileHandler.count = 10 +java.util.logging.FileHandler.limit = 10000000 + +org.jitsi.jibri.capture.ffmpeg.util.FfmpegFileHandler.level = FINE +org.jitsi.jibri.capture.ffmpeg.util.FfmpegFileHandler.pattern = /var/log/jitsi/jibri/ffmpeg.%g.txt +org.jitsi.jibri.capture.ffmpeg.util.FfmpegFileHandler.formatter = net.java.sip.communicator.util.ScLogFormatter +org.jitsi.jibri.capture.ffmpeg.util.FfmpegFileHandler.count = 10 +org.jitsi.jibri.capture.ffmpeg.util.FfmpegFileHandler.limit = 10000000 + +org.jitsi.jibri.sipgateway.pjsua.util.PjsuaFileHandler.level = FINE +org.jitsi.jibri.sipgateway.pjsua.util.PjsuaFileHandler.pattern = /var/log/jitsi/jibri/pjsua.%g.txt +org.jitsi.jibri.sipgateway.pjsua.util.PjsuaFileHandler.formatter = net.java.sip.communicator.util.ScLogFormatter +org.jitsi.jibri.sipgateway.pjsua.util.PjsuaFileHandler.count = 10 +org.jitsi.jibri.sipgateway.pjsua.util.PjsuaFileHandler.limit = 10000000 + +org.jitsi.jibri.selenium.util.BrowserFileHandler.level = FINE +org.jitsi.jibri.selenium.util.BrowserFileHandler.pattern = /var/log/jitsi/jibri/browser.%g.txt +org.jitsi.jibri.selenium.util.BrowserFileHandler.formatter = net.java.sip.communicator.util.ScLogFormatter +org.jitsi.jibri.selenium.util.BrowserFileHandler.count = 10 +org.jitsi.jibri.selenium.util.BrowserFileHandler.limit = 10000000 + +org.jitsi.level = FINE +org.jitsi.jibri.config.level = INFO + +org.glassfish.level = INFO +org.osgi.level = INFO +org.jitsi.xmpp.level = INFO