lol

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

+37 -20
+31 -17
nixos/modules/services/networking/jicofo.nix
··· 4 4 5 5 let 6 6 cfg = config.services.jicofo; 7 + 8 + # HOCON is a JSON superset that some jitsi-meet components use for configuration 9 + toHOCON = x: if isAttrs x && x ? __hocon_envvar then ("\${" + x.__hocon_envvar + "}") 10 + else if isAttrs x && x ? __hocon_unquoted_string then x.__hocon_unquoted_string 11 + else if isAttrs x then "{${ concatStringsSep "," (mapAttrsToList (k: v: ''"${k}":${toHOCON v}'') x) }}" 12 + else if isList x then "[${ concatMapStringsSep "," toHOCON x }]" 13 + else builtins.toJSON x; 14 + 15 + configFile = pkgs.writeText "jicofo.conf" (toHOCON cfg.config); 7 16 in 8 17 { 9 18 options.services.jicofo = with types; { ··· 68 77 }; 69 78 70 79 config = mkOption { 71 - type = attrsOf str; 80 + type = (pkgs.formats.json {}).type; 72 81 default = { }; 73 82 example = literalExpression '' 74 83 { 75 - "org.jitsi.jicofo.auth.URL" = "XMPP:jitsi-meet.example.com"; 84 + jicofo.bridge.max-bridge-participants = 42; 76 85 } 77 86 ''; 78 87 description = lib.mdDoc '' 79 - Contents of the {file}`sip-communicator.properties` configuration file for jicofo. 88 + Contents of the {file}`jicofo.conf` configuration file. 80 89 ''; 81 90 }; 82 91 }; 83 92 84 93 config = mkIf cfg.enable { 85 - services.jicofo.config = mapAttrs (_: v: mkDefault v) { 86 - "org.jitsi.jicofo.BRIDGE_MUC" = cfg.bridgeMuc; 94 + services.jicofo.config = { 95 + jicofo = { 96 + bridge.brewery-jid = cfg.bridgeMuc; 97 + xmpp = rec { 98 + client = { 99 + hostname = cfg.xmppHost; 100 + username = cfg.userName; 101 + domain = cfg.userDomain; 102 + password = { __hocon_envvar = "JICOFO_AUTH_PASS"; }; 103 + xmpp-domain = if cfg.xmppDomain == null then cfg.xmppHost else cfg.xmppDomain; 104 + }; 105 + service = client; 106 + }; 107 + }; 87 108 }; 88 109 89 110 users.groups.jitsi-meet = {}; ··· 93 114 "-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION" = "/etc/jitsi"; 94 115 "-Dnet.java.sip.communicator.SC_HOME_DIR_NAME" = "jicofo"; 95 116 "-Djava.util.logging.config.file" = "/etc/jitsi/jicofo/logging.properties"; 117 + "-Dconfig.file" = configFile; 96 118 }; 97 119 in 98 120 { ··· 101 123 after = [ "network.target" ]; 102 124 103 125 restartTriggers = [ 104 - config.environment.etc."jitsi/jicofo/sip-communicator.properties".source 126 + configFile 105 127 ]; 106 128 environment.JAVA_SYS_PROPS = concatStringsSep " " (mapAttrsToList (k: v: "${k}=${toString v}") jicofoProps); 107 129 108 130 script = '' 109 - ${pkgs.jicofo}/bin/jicofo \ 110 - --host=${cfg.xmppHost} \ 111 - --domain=${if cfg.xmppDomain == null then cfg.xmppHost else cfg.xmppDomain} \ 112 - --secret=$(cat ${cfg.componentPasswordFile}) \ 113 - --user_name=${cfg.userName} \ 114 - --user_domain=${cfg.userDomain} \ 115 - --user_password=$(cat ${cfg.userPasswordFile}) 131 + export JICOFO_AUTH_PASS="$(<${cfg.userPasswordFile})" 132 + exec "${pkgs.jicofo}/bin/jicofo" 116 133 ''; 117 134 118 135 serviceConfig = { ··· 140 157 }; 141 158 }; 142 159 143 - environment.etc."jitsi/jicofo/sip-communicator.properties".source = 144 - pkgs.writeText "sip-communicator.properties" ( 145 - generators.toKeyValue {} cfg.config 146 - ); 160 + environment.etc."jitsi/jicofo/sip-communicator.properties".text = ""; 147 161 environment.etc."jitsi/jicofo/logging.properties".source = 148 162 mkDefault "${pkgs.jicofo}/etc/jitsi/jicofo/logging.properties-journal"; 149 163 };
+6 -3
nixos/modules/services/web-apps/jitsi-meet.nix
··· 411 411 componentPasswordFile = "/var/lib/jitsi-meet/jicofo-component-secret"; 412 412 bridgeMuc = "jvbbrewery@internal.${cfg.hostName}"; 413 413 config = mkMerge [{ 414 - "org.jitsi.jicofo.ALWAYS_TRUST_MODE_ENABLED" = "true"; 414 + jicofo.xmpp.service.disable-certificate-verification = true; 415 + jicofo.xmpp.client.disable-certificate-verification = true; 415 416 #} (lib.mkIf cfg.jibri.enable { 416 417 } (lib.mkIf (config.services.jibri.enable || cfg.jibri.enable) { 417 - "org.jitsi.jicofo.jibri.BREWERY" = "JibriBrewery@internal.${cfg.hostName}"; 418 - "org.jitsi.jicofo.jibri.PENDING_TIMEOUT" = "90"; 418 + jicofo.jibri = { 419 + brewery-jid = "JibriBrewery@internal.${cfg.hostName}"; 420 + pending-timeout = "90"; 421 + }; 419 422 })]; 420 423 }; 421 424