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

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

Sandro a74a4a2f ae41827d

Changed files
+15 -8
nixos
doc
manual
release-notes
modules
services
tests
+2
nixos/doc/manual/release-notes/rl-2305.section.md
···
- `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`.
+
- 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)".
+
## Detailed migration information {#sec-release-23.05-migration}
### Pipewire configuration overrides {#sec-release-23.05-migration-pipewire}
+12 -7
nixos/modules/services/networking/jitsi-videobridge.nix
···
muc_nickname = xmppConfig.mucNickname;
disable_certificate_verification = xmppConfig.disableCertificateVerification;
});
+
apis.rest.enabled = cfg.colibriRestApi;
};
};
···
jvbConfig = recursiveUpdate defaultJvbConfig cfg.config;
in
{
+
imports = [
+
(mkRemovedOptionModule [ "services" "jitsi-videobridge" "apis" ]
+
"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."
+
)
+
];
options.services.jitsi-videobridge = with types; {
enable = mkEnableOption (lib.mdDoc "Jitsi Videobridge, a WebRTC compatible video router");
···
'';
};
-
apis = mkOption {
-
type = with types; listOf str;
+
colibriRestApi = mkOption {
+
type = bool;
description = lib.mdDoc ''
-
What is passed as --apis= parameter. If this is empty, "none" is passed.
-
Needed for monitoring jitsi.
+
Whether to enable the private rest API for the COLIBRI control interface.
+
Needed for monitoring jitsi, enabling scraping of the /colibri/stats endpoint.
'';
-
default = [];
-
example = literalExpression "[ \"colibri\" \"rest\" ]";
+
default = false;
};
};
···
"export ${toVarName name}=$(cat ${xmppConfig.passwordFile})\n"
) cfg.xmppConfigs))
+ ''
-
${pkgs.jitsi-videobridge}/bin/jitsi-videobridge --apis=${if (cfg.apis == []) then "none" else concatStringsSep "," cfg.apis}
+
${pkgs.jitsi-videobridge}/bin/jitsi-videobridge
'';
serviceConfig = {
+1 -1
nixos/tests/prometheus-exporters.nix
···
systemd.services.prometheus-jitsi-exporter.after = [ "jitsi-videobridge2.service" ];
services.jitsi-videobridge = {
enable = true;
-
apis = [ "colibri" "rest" ];
+
colibriRestApi = true;
};
};
exporterTest = ''