lol

Merge pull request #232534 from teutat3s/zhf/fix-prometheus-exporter-jitsi

jitsi-videobridge: refactor broken `apis` option to `colibriRestApi`

authored by

Sandro and committed by
GitHub
a74a4a2f ae41827d

+15 -8
+2
nixos/doc/manual/release-notes/rl-2305.section.md
··· 563 563 564 564 - `make-disk-image` handles `contents` arguments that are directories better, fixing a bug where it used to put them in a subdirectory of the intended `target`. 565 565 566 + - The option `services.jitsi-videobridge.apis` has been renamed to `colibriRestApi` and turned into a boolean. Setting it to `true` will enable the private rest API, useful for monitoring using `services.prometheus.exporters.jitsi.enable`. Learn more about the API: "[The COLIBRI control interface (/colibri/)](https://github.com/jitsi/jitsi-videobridge/blob/v2.3/doc/rest.md)". 567 + 566 568 ## Detailed migration information {#sec-release-23.05-migration} 567 569 568 570 ### Pipewire configuration overrides {#sec-release-23.05-migration-pipewire}
+12 -7
nixos/modules/services/networking/jitsi-videobridge.nix
··· 43 43 muc_nickname = xmppConfig.mucNickname; 44 44 disable_certificate_verification = xmppConfig.disableCertificateVerification; 45 45 }); 46 + apis.rest.enabled = cfg.colibriRestApi; 46 47 }; 47 48 }; 48 49 ··· 50 51 jvbConfig = recursiveUpdate defaultJvbConfig cfg.config; 51 52 in 52 53 { 54 + imports = [ 55 + (mkRemovedOptionModule [ "services" "jitsi-videobridge" "apis" ] 56 + "services.jitsi-videobridge.apis was broken and has been migrated into the boolean option services.jitsi-videobridge.colibriRestApi. It is set to false by default, setting it to true will correctly enable the private /colibri rest API." 57 + ) 58 + ]; 53 59 options.services.jitsi-videobridge = with types; { 54 60 enable = mkEnableOption (lib.mdDoc "Jitsi Videobridge, a WebRTC compatible video router"); 55 61 ··· 192 198 ''; 193 199 }; 194 200 195 - apis = mkOption { 196 - type = with types; listOf str; 201 + colibriRestApi = mkOption { 202 + type = bool; 197 203 description = lib.mdDoc '' 198 - What is passed as --apis= parameter. If this is empty, "none" is passed. 199 - Needed for monitoring jitsi. 204 + Whether to enable the private rest API for the COLIBRI control interface. 205 + Needed for monitoring jitsi, enabling scraping of the /colibri/stats endpoint. 200 206 ''; 201 - default = []; 202 - example = literalExpression "[ \"colibri\" \"rest\" ]"; 207 + default = false; 203 208 }; 204 209 }; 205 210 ··· 233 238 "export ${toVarName name}=$(cat ${xmppConfig.passwordFile})\n" 234 239 ) cfg.xmppConfigs)) 235 240 + '' 236 - ${pkgs.jitsi-videobridge}/bin/jitsi-videobridge --apis=${if (cfg.apis == []) then "none" else concatStringsSep "," cfg.apis} 241 + ${pkgs.jitsi-videobridge}/bin/jitsi-videobridge 237 242 ''; 238 243 239 244 serviceConfig = {
+1 -1
nixos/tests/prometheus-exporters.nix
··· 328 328 systemd.services.prometheus-jitsi-exporter.after = [ "jitsi-videobridge2.service" ]; 329 329 services.jitsi-videobridge = { 330 330 enable = true; 331 - apis = [ "colibri" "rest" ]; 331 + colibriRestApi = true; 332 332 }; 333 333 }; 334 334 exporterTest = ''