Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41359f9649 | ||
|
|
cccfcb255d |
No files matched your search
@@ -158,11 +158,14 @@ in
|
||||
name = "mirotalk-server";
|
||||
subdomain = "meet";
|
||||
hostHttpPort = 5110;
|
||||
minPort = 40000;
|
||||
maxPort = 40100;
|
||||
};
|
||||
};
|
||||
turn = {
|
||||
enable = true;
|
||||
name = "turn-server";
|
||||
listenIP = "172.30.0.28";
|
||||
listenPort = 3479;
|
||||
minPort = 49160;
|
||||
maxPort = 49200;
|
||||
|
||||
@@ -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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,19 +12,27 @@ in
|
||||
"turn/public-ip" = { };
|
||||
};
|
||||
|
||||
sops.templates."turnserver.conf".content = ''
|
||||
sops.templates."turnserver.conf" = {
|
||||
owner = "nobody";
|
||||
group = "nogroup";
|
||||
mode = "0400";
|
||||
restartUnits = [ "docker-turn-server.service" ];
|
||||
content = ''
|
||||
listening-port=${toString cfg.listenPort}
|
||||
listening-ip=${cfg.listenIP}
|
||||
fingerprint
|
||||
lt-cred-mech
|
||||
realm=${realm}
|
||||
user=turn:${config.sops.placeholder."turn/password"}
|
||||
min-port=${toString cfg.minPort}
|
||||
max-port=${toString cfg.maxPort}
|
||||
external-ip=${config.sops.placeholder."turn/public-ip"}
|
||||
relay-ip=${cfg.listenIP}
|
||||
external-ip=${config.sops.placeholder."turn/public-ip"}/${cfg.listenIP}
|
||||
log-file=stdout
|
||||
no-cli
|
||||
no-tls
|
||||
no-dtls
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,6 +12,9 @@ in
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
listenIP = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
listenPort = mkOption {
|
||||
type = types.port;
|
||||
};
|
||||
@@ -27,14 +30,16 @@ in
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
image = "docker.io/coturn/coturn:4.6.3";
|
||||
cmd = [ "-c" "/etc/turnserver.conf" ];
|
||||
ports =
|
||||
[ "0.0.0.0:${toString cfg.listenPort}:${toString cfg.listenPort}/udp" ]
|
||||
++ map (port: "0.0.0.0:${toString port}:${toString port}/udp") (
|
||||
range cfg.minPort cfg.maxPort
|
||||
);
|
||||
ports = [
|
||||
"0.0.0.0:${toString cfg.listenPort}:${toString cfg.listenPort}/udp"
|
||||
]
|
||||
++ map (port: "0.0.0.0:${toString port}:${toString port}/udp") (range cfg.minPort cfg.maxPort);
|
||||
volumes = [ "${config.sops.templates."turnserver.conf".path}:/etc/turnserver.conf:ro" ];
|
||||
log-driver = "journald";
|
||||
extraOptions = [ "--network=${common.network.name}" ];
|
||||
extraOptions = [
|
||||
"--network=${common.network.name}"
|
||||
"--ip=172.30.0.28"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."${common.backend}-${cfg.name}" = {
|
||||
|
||||
@@ -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