1 { config, lib, pkgs, ... }:
3 cfg = config.services.jicofo;
5 format = pkgs.formats.hocon { };
7 configFile = format.generate "jicofo.conf" cfg.config;
10 options.services.jicofo = with lib.types; {
11 enable = lib.mkEnableOption "Jitsi Conference Focus - component of Jitsi Meet";
13 xmppHost = lib.mkOption {
15 example = "localhost";
17 Hostname of the XMPP server to connect to.
21 xmppDomain = lib.mkOption {
23 example = "meet.example.org";
25 Domain name of the XMMP server to which to connect as a component.
27 If null, {option}`xmppHost` is used.
31 componentPasswordFile = lib.mkOption {
33 example = "/run/keys/jicofo-component";
35 Path to file containing component secret.
39 userName = lib.mkOption {
43 User part of the JID for XMPP user connection.
47 userDomain = lib.mkOption {
49 example = "auth.meet.example.org";
51 Domain part of the JID for XMPP user connection.
55 userPasswordFile = lib.mkOption {
57 example = "/run/keys/jicofo-user";
59 Path to file containing password for XMPP user connection.
63 bridgeMuc = lib.mkOption {
65 example = "jvbbrewery@internal.meet.example.org";
67 JID of the internal MUC used to communicate with Videobridges.
71 config = lib.mkOption {
74 example = lib.literalExpression ''
76 jicofo.bridge.max-bridge-participants = 42;
80 Contents of the {file}`jicofo.conf` configuration file.
85 config = lib.mkIf cfg.enable {
86 services.jicofo.config = {
88 bridge.brewery-jid = cfg.bridgeMuc;
91 hostname = cfg.xmppHost;
92 username = cfg.userName;
93 domain = cfg.userDomain;
94 password = format.lib.mkSubstitution "JICOFO_AUTH_PASS";
95 xmpp-domain = if cfg.xmppDomain == null then cfg.xmppHost else cfg.xmppDomain;
102 users.groups.jitsi-meet = {};
104 systemd.services.jicofo = let
106 "-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION" = "/etc/jitsi";
107 "-Dnet.java.sip.communicator.SC_HOME_DIR_NAME" = "jicofo";
108 "-Djava.util.logging.config.file" = "/etc/jitsi/jicofo/logging.properties";
109 "-Dconfig.file" = configFile;
113 description = "JItsi COnference FOcus";
114 wantedBy = [ "multi-user.target" ];
115 after = [ "network.target" ];
120 environment.JAVA_SYS_PROPS = lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "${k}=${toString v}") jicofoProps);
123 export JICOFO_AUTH_PASS="$(<${cfg.userPasswordFile})"
124 exec "${pkgs.jicofo}/bin/jicofo"
132 Group = "jitsi-meet";
134 CapabilityBoundingSet = "";
135 NoNewPrivileges = true;
136 ProtectSystem = "strict";
139 PrivateDevices = true;
140 ProtectHostname = true;
141 ProtectKernelTunables = true;
142 ProtectKernelModules = true;
143 ProtectControlGroups = true;
144 RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
145 RestrictNamespaces = true;
146 LockPersonality = true;
147 RestrictRealtime = true;
148 RestrictSUIDSGID = true;
152 environment.etc."jitsi/jicofo/sip-communicator.properties".text = "";
153 environment.etc."jitsi/jicofo/logging.properties".source =
154 lib.mkDefault "${pkgs.jicofo}/etc/jitsi/jicofo/logging.properties-journal";
157 meta.maintainers = lib.teams.jitsi.members;