2023-08-31 01:55:45 +03:00
|
|
|
{ config, lib, depot, ... }:
|
2022-02-04 01:08:05 +02:00
|
|
|
let
|
2023-05-26 17:46:01 +03:00
|
|
|
inherit (config) links;
|
|
|
|
|
2024-07-16 15:06:08 +03:00
|
|
|
inherit (config.reflection) interfaces;
|
2022-02-04 01:08:05 +02:00
|
|
|
in
|
2021-10-16 21:24:57 +03:00
|
|
|
{
|
2023-05-26 17:46:01 +03:00
|
|
|
links = {
|
|
|
|
jitsi-exporter.protocol = "http";
|
|
|
|
};
|
|
|
|
|
2021-10-16 21:24:57 +03:00
|
|
|
services.jitsi-meet = {
|
|
|
|
enable = true;
|
2023-08-31 01:55:45 +03:00
|
|
|
hostName = "meet.${depot.lib.meta.domain}";
|
2021-10-16 21:24:57 +03:00
|
|
|
nginx.enable = true;
|
|
|
|
jicofo.enable = true;
|
|
|
|
videobridge.enable = true;
|
|
|
|
prosody.enable = true;
|
2022-06-07 19:48:38 +03:00
|
|
|
config = {
|
|
|
|
p2p.enabled = false;
|
|
|
|
startAudioOnly = true;
|
2024-01-27 10:27:06 +02:00
|
|
|
openBridgeChannel = "websocket";
|
2022-06-07 19:48:38 +03:00
|
|
|
};
|
2021-10-16 21:24:57 +03:00
|
|
|
};
|
2022-03-18 20:24:14 +02:00
|
|
|
services.jitsi-videobridge = {
|
|
|
|
openFirewall = true;
|
2023-06-02 17:08:43 +03:00
|
|
|
colibriRestApi = true;
|
2022-05-15 01:35:02 +03:00
|
|
|
config.videobridge = {
|
|
|
|
ice = {
|
|
|
|
tcp.port = 7777;
|
|
|
|
};
|
|
|
|
stats.transports = [
|
|
|
|
{ type = "muc"; }
|
|
|
|
{ type = "colibri"; }
|
|
|
|
];
|
2022-03-18 20:24:49 +02:00
|
|
|
};
|
2023-02-24 16:16:15 +02:00
|
|
|
nat = lib.optionalAttrs interfaces.primary.isNat {
|
2022-03-18 20:24:14 +02:00
|
|
|
localAddress = interfaces.primary.addr;
|
|
|
|
publicAddress = interfaces.primary.addrPublic;
|
|
|
|
};
|
|
|
|
};
|
2023-08-31 01:55:45 +03:00
|
|
|
services.nginx.virtualHosts."meet.${depot.lib.meta.domain}" = {
|
2021-10-16 21:24:57 +03:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."=/images/watermark.svg" = {
|
|
|
|
return = "200";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
systemd.services = lib.genAttrs [ "jicofo" "jitsi-meet-init-secrets" "jitsi-videobridge2" "prosody" ] (_: {
|
|
|
|
serviceConfig = {
|
|
|
|
Slice = "communications.slice";
|
|
|
|
};
|
|
|
|
});
|
2021-12-02 22:45:05 +02:00
|
|
|
boot.kernel.sysctl."net.core.rmem_max" = lib.mkForce 10485760;
|
2023-05-26 17:46:01 +03:00
|
|
|
|
|
|
|
services.prometheus.exporters.jitsi = {
|
|
|
|
enable = true;
|
|
|
|
interval = "60s";
|
|
|
|
listenAddress = links.jitsi-exporter.ipv4;
|
|
|
|
inherit (links.jitsi-exporter) port;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.grafana-agent.settings.metrics.configs = lib.singleton {
|
|
|
|
name = "metrics-jitsi";
|
|
|
|
scrape_configs = lib.singleton {
|
|
|
|
job_name = "jitsi";
|
|
|
|
static_configs = lib.singleton {
|
|
|
|
targets = lib.singleton links.jitsi-exporter.tuple;
|
|
|
|
labels.instance = config.services.jitsi-meet.hostName;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-10-16 21:24:57 +03:00
|
|
|
}
|