nixos/jicofo: fix after update

https://github.com/jitsi/jicofo/commit/2943c21ff7a9e2464a7be646fdf10a9bde4f8c6a
removed the cli parameters

migrate from legacy config while we're at it

ajs124 adc59137 9b061691

Changed files
+37 -20
nixos
modules
services
networking
web-apps
+31 -17
nixos/modules/services/networking/jicofo.nix
···
let
cfg = config.services.jicofo;
in
{
options.services.jicofo = with types; {
···
};
config = mkOption {
-
type = attrsOf str;
default = { };
example = literalExpression ''
{
-
"org.jitsi.jicofo.auth.URL" = "XMPP:jitsi-meet.example.com";
}
'';
description = lib.mdDoc ''
-
Contents of the {file}`sip-communicator.properties` configuration file for jicofo.
'';
};
};
config = mkIf cfg.enable {
-
services.jicofo.config = mapAttrs (_: v: mkDefault v) {
-
"org.jitsi.jicofo.BRIDGE_MUC" = cfg.bridgeMuc;
};
users.groups.jitsi-meet = {};
···
"-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION" = "/etc/jitsi";
"-Dnet.java.sip.communicator.SC_HOME_DIR_NAME" = "jicofo";
"-Djava.util.logging.config.file" = "/etc/jitsi/jicofo/logging.properties";
};
in
{
···
after = [ "network.target" ];
restartTriggers = [
-
config.environment.etc."jitsi/jicofo/sip-communicator.properties".source
];
environment.JAVA_SYS_PROPS = concatStringsSep " " (mapAttrsToList (k: v: "${k}=${toString v}") jicofoProps);
script = ''
-
${pkgs.jicofo}/bin/jicofo \
-
--host=${cfg.xmppHost} \
-
--domain=${if cfg.xmppDomain == null then cfg.xmppHost else cfg.xmppDomain} \
-
--secret=$(cat ${cfg.componentPasswordFile}) \
-
--user_name=${cfg.userName} \
-
--user_domain=${cfg.userDomain} \
-
--user_password=$(cat ${cfg.userPasswordFile})
'';
serviceConfig = {
···
};
};
-
environment.etc."jitsi/jicofo/sip-communicator.properties".source =
-
pkgs.writeText "sip-communicator.properties" (
-
generators.toKeyValue {} cfg.config
-
);
environment.etc."jitsi/jicofo/logging.properties".source =
mkDefault "${pkgs.jicofo}/etc/jitsi/jicofo/logging.properties-journal";
};
···
let
cfg = config.services.jicofo;
+
+
# HOCON is a JSON superset that some jitsi-meet components use for configuration
+
toHOCON = x: if isAttrs x && x ? __hocon_envvar then ("\${" + x.__hocon_envvar + "}")
+
else if isAttrs x && x ? __hocon_unquoted_string then x.__hocon_unquoted_string
+
else if isAttrs x then "{${ concatStringsSep "," (mapAttrsToList (k: v: ''"${k}":${toHOCON v}'') x) }}"
+
else if isList x then "[${ concatMapStringsSep "," toHOCON x }]"
+
else builtins.toJSON x;
+
+
configFile = pkgs.writeText "jicofo.conf" (toHOCON cfg.config);
in
{
options.services.jicofo = with types; {
···
};
config = mkOption {
+
type = (pkgs.formats.json {}).type;
default = { };
example = literalExpression ''
{
+
jicofo.bridge.max-bridge-participants = 42;
}
'';
description = lib.mdDoc ''
+
Contents of the {file}`jicofo.conf` configuration file.
'';
};
};
config = mkIf cfg.enable {
+
services.jicofo.config = {
+
jicofo = {
+
bridge.brewery-jid = cfg.bridgeMuc;
+
xmpp = rec {
+
client = {
+
hostname = cfg.xmppHost;
+
username = cfg.userName;
+
domain = cfg.userDomain;
+
password = { __hocon_envvar = "JICOFO_AUTH_PASS"; };
+
xmpp-domain = if cfg.xmppDomain == null then cfg.xmppHost else cfg.xmppDomain;
+
};
+
service = client;
+
};
+
};
};
users.groups.jitsi-meet = {};
···
"-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION" = "/etc/jitsi";
"-Dnet.java.sip.communicator.SC_HOME_DIR_NAME" = "jicofo";
"-Djava.util.logging.config.file" = "/etc/jitsi/jicofo/logging.properties";
+
"-Dconfig.file" = configFile;
};
in
{
···
after = [ "network.target" ];
restartTriggers = [
+
configFile
];
environment.JAVA_SYS_PROPS = concatStringsSep " " (mapAttrsToList (k: v: "${k}=${toString v}") jicofoProps);
script = ''
+
export JICOFO_AUTH_PASS="$(<${cfg.userPasswordFile})"
+
exec "${pkgs.jicofo}/bin/jicofo"
'';
serviceConfig = {
···
};
};
+
environment.etc."jitsi/jicofo/sip-communicator.properties".text = "";
environment.etc."jitsi/jicofo/logging.properties".source =
mkDefault "${pkgs.jicofo}/etc/jitsi/jicofo/logging.properties-journal";
};
+6 -3
nixos/modules/services/web-apps/jitsi-meet.nix
···
componentPasswordFile = "/var/lib/jitsi-meet/jicofo-component-secret";
bridgeMuc = "jvbbrewery@internal.${cfg.hostName}";
config = mkMerge [{
-
"org.jitsi.jicofo.ALWAYS_TRUST_MODE_ENABLED" = "true";
#} (lib.mkIf cfg.jibri.enable {
} (lib.mkIf (config.services.jibri.enable || cfg.jibri.enable) {
-
"org.jitsi.jicofo.jibri.BREWERY" = "JibriBrewery@internal.${cfg.hostName}";
-
"org.jitsi.jicofo.jibri.PENDING_TIMEOUT" = "90";
})];
};
···
componentPasswordFile = "/var/lib/jitsi-meet/jicofo-component-secret";
bridgeMuc = "jvbbrewery@internal.${cfg.hostName}";
config = mkMerge [{
+
jicofo.xmpp.service.disable-certificate-verification = true;
+
jicofo.xmpp.client.disable-certificate-verification = true;
#} (lib.mkIf cfg.jibri.enable {
} (lib.mkIf (config.services.jibri.enable || cfg.jibri.enable) {
+
jicofo.jibri = {
+
brewery-jid = "JibriBrewery@internal.${cfg.hostName}";
+
pending-timeout = "90";
+
};
})];
};