Switch from mirotalk p2p to sfu
This commit is contained in:
1 parent
cccfcb255d
commit
41359f9649
6 files changed
+39
-22
No files matched your search
@@ -158,6 +158,8 @@ in
|
||||
name = "mirotalk-server";
|
||||
subdomain = "meet";
|
||||
hostHttpPort = 5110;
|
||||
minPort = 40000;
|
||||
maxPort = 40100;
|
||||
};
|
||||
};
|
||||
turn = {
|
||||
|
||||
@@ -19,6 +19,7 @@ in
|
||||
"mirotalk/client_secret" = { };
|
||||
"mirotalk/session_secret" = { };
|
||||
"mirotalk/api_key_secret" = { };
|
||||
"mirotalk/jwt_secret" = { };
|
||||
};
|
||||
|
||||
systemd.targets."${common.backend}-${cfg.targetName}" = {
|
||||
|
||||
@@ -6,43 +6,40 @@ let
|
||||
domain = "${config.sops.placeholder."domains/serv"}";
|
||||
pocketIdSubdomain = config.selfhosted.pocket-id.subdomain;
|
||||
publicUrl = "https://${cfg.subdomain}.${domain}";
|
||||
stunUrl = "stun:${config.selfhosted.netbird.subdomain}.${domain}:3478";
|
||||
in
|
||||
{
|
||||
config = mkIf rootCfg.enable {
|
||||
sops.templates."mirotalk.env".content = ''
|
||||
NODE_ENV=production
|
||||
TZ=${config.time.timeZone}
|
||||
PORT=3000
|
||||
SERVER_LISTEN_PORT=3010
|
||||
SERVER_HOST_URL=${publicUrl}
|
||||
TRUST_PROXY=true
|
||||
|
||||
SFU_LISTEN_IP=0.0.0.0
|
||||
SFU_ANNOUNCED_IP=${config.sops.placeholder."turn/public-ip"}
|
||||
SFU_MIN_PORT=${toString cfg.minPort}
|
||||
SFU_MAX_PORT=${toString cfg.maxPort}
|
||||
SFU_NUM_WORKERS=4
|
||||
SFU_SERVER=false
|
||||
|
||||
OIDC_ENABLED=true
|
||||
OIDC_ALLOW_ROOMS_CREATION_FOR_AUTH_USERS=true
|
||||
OIDC_BASE_URL_DYNAMIC=false
|
||||
OIDC_ISSUER_BASE_URL=https://${pocketIdSubdomain}.${domain}
|
||||
OIDC_ISSUER=https://${pocketIdSubdomain}.${domain}
|
||||
OIDC_BASE_URL=${publicUrl}
|
||||
OIDC_CLIENT_ID=mirotalk
|
||||
OIDC_CLIENT_SECRET=${config.sops.placeholder."mirotalk/client_secret"}
|
||||
OIDC_SECRET=${config.sops.placeholder."mirotalk/session_secret"}
|
||||
OIDC_AUTH_REQUIRED=false
|
||||
OIDC_AUTH_LOGOUT=true
|
||||
SESSION_SECRET=${config.sops.placeholder."mirotalk/session_secret"}
|
||||
|
||||
HOST_PROTECTED=false
|
||||
HOST_USER_AUTH=false
|
||||
HOST_USERS='[]'
|
||||
JWT_SECRET=${config.sops.placeholder."mirotalk/jwt_secret"}
|
||||
JWT_EXPIRATION=1h
|
||||
|
||||
API_KEY_SECRET=${config.sops.placeholder."mirotalk/api_key_secret"}
|
||||
|
||||
STUN_SERVER_ENABLED=true
|
||||
STUN_SERVER_URL=${stunUrl}
|
||||
TURN_SERVER_ENABLED=true
|
||||
TURN_SERVER_URL=turn:${config.selfhosted.netbird.subdomain}.${domain}:${toString config.selfhosted.turn.listenPort}
|
||||
TURN_SERVER_USERNAME=turn
|
||||
TURN_SERVER_CREDENTIAL=${config.sops.placeholder."turn/password"}
|
||||
|
||||
SHOW_ACTIVE_ROOMS=true
|
||||
STATS_ENABLED=false
|
||||
SURVEY_ENABLED=false
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -18,13 +18,21 @@ in
|
||||
hostHttpPort = mkOption {
|
||||
type = types.port;
|
||||
};
|
||||
minPort = mkOption {
|
||||
type = types.port;
|
||||
};
|
||||
maxPort = mkOption {
|
||||
type = types.port;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
image = "docker.io/mirotalk/p2p@sha256:c05675e2e3e8a2bb1ee63f07dcaaf8523a30b4dee4d1e594594ff5e36c959b07"; # 1.9.39 (2026-09-03)
|
||||
image = "docker.io/mirotalk/sfu@sha256:0e2bba6dde0be9c6b2138b9ff988aa46ec23c7421a6313551c13735355081a17"; # 2.6.79 (2026-10-23)
|
||||
ports = [
|
||||
"0.0.0.0:${toString cfg.hostHttpPort}:3000"
|
||||
"0.0.0.0:${toString cfg.hostHttpPort}:3010"
|
||||
"0.0.0.0:${toString cfg.minPort}-${toString cfg.maxPort}:${toString cfg.minPort}-${toString cfg.maxPort}/tcp"
|
||||
"0.0.0.0:${toString cfg.minPort}-${toString cfg.maxPort}:${toString cfg.minPort}-${toString cfg.maxPort}/udp"
|
||||
];
|
||||
user = "${common.user.uid}:${common.group.gid}";
|
||||
environmentFiles = [ config.sops.templates."mirotalk.env".path ];
|
||||
@@ -43,9 +51,6 @@ in
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
after = lib.optionals config.selfhosted.turn.enable [
|
||||
"${common.backend}-${config.selfhosted.turn.name}.service"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -24,7 +24,7 @@ in
|
||||
SSO_CLIENT_SECRET=${config.sops.placeholder."vaultwarden/client_secret"}
|
||||
SSO_AUTH_ONLY_NOT_SESSION=true
|
||||
|
||||
# SMTP via Stalwart
|
||||
# SMTP
|
||||
SMTP_HOST=${mailCfg.subdomain}.${domain}
|
||||
SMTP_FROM=${smtpUser}
|
||||
SMTP_FROM_NAME=Vaultwarden
|
||||
|
||||
@@ -22,11 +22,23 @@
|
||||
++ lib.optionals config.selfhosted.turn.enable [
|
||||
config.selfhosted.turn.listenPort
|
||||
];
|
||||
allowedTCPPortRanges = lib.optionals config.selfhosted.mirotalk.enable [
|
||||
{
|
||||
from = config.selfhosted.mirotalk.server.minPort;
|
||||
to = config.selfhosted.mirotalk.server.maxPort;
|
||||
}
|
||||
];
|
||||
allowedUDPPortRanges = lib.optionals config.selfhosted.turn.enable [
|
||||
{
|
||||
from = config.selfhosted.turn.minPort;
|
||||
to = config.selfhosted.turn.maxPort;
|
||||
}
|
||||
]
|
||||
++ lib.optionals config.selfhosted.mirotalk.enable [
|
||||
{
|
||||
from = config.selfhosted.mirotalk.server.minPort;
|
||||
to = config.selfhosted.mirotalk.server.maxPort;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user