Compare commits
2
Commits
6bb9ceefb8
...
41359f9649
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41359f9649 | ||
|
|
cccfcb255d |
No files matched your search
@@ -158,11 +158,14 @@ in
|
|||||||
name = "mirotalk-server";
|
name = "mirotalk-server";
|
||||||
subdomain = "meet";
|
subdomain = "meet";
|
||||||
hostHttpPort = 5110;
|
hostHttpPort = 5110;
|
||||||
|
minPort = 40000;
|
||||||
|
maxPort = 40100;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
turn = {
|
turn = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "turn-server";
|
name = "turn-server";
|
||||||
|
listenIP = "172.30.0.28";
|
||||||
listenPort = 3479;
|
listenPort = 3479;
|
||||||
minPort = 49160;
|
minPort = 49160;
|
||||||
maxPort = 49200;
|
maxPort = 49200;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ in
|
|||||||
"mirotalk/client_secret" = { };
|
"mirotalk/client_secret" = { };
|
||||||
"mirotalk/session_secret" = { };
|
"mirotalk/session_secret" = { };
|
||||||
"mirotalk/api_key_secret" = { };
|
"mirotalk/api_key_secret" = { };
|
||||||
|
"mirotalk/jwt_secret" = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.targets."${common.backend}-${cfg.targetName}" = {
|
systemd.targets."${common.backend}-${cfg.targetName}" = {
|
||||||
|
|||||||
@@ -6,43 +6,40 @@ let
|
|||||||
domain = "${config.sops.placeholder."domains/serv"}";
|
domain = "${config.sops.placeholder."domains/serv"}";
|
||||||
pocketIdSubdomain = config.selfhosted.pocket-id.subdomain;
|
pocketIdSubdomain = config.selfhosted.pocket-id.subdomain;
|
||||||
publicUrl = "https://${cfg.subdomain}.${domain}";
|
publicUrl = "https://${cfg.subdomain}.${domain}";
|
||||||
stunUrl = "stun:${config.selfhosted.netbird.subdomain}.${domain}:3478";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = mkIf rootCfg.enable {
|
config = mkIf rootCfg.enable {
|
||||||
sops.templates."mirotalk.env".content = ''
|
sops.templates."mirotalk.env".content = ''
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
TZ=${config.time.timeZone}
|
TZ=${config.time.timeZone}
|
||||||
PORT=3000
|
SERVER_LISTEN_PORT=3010
|
||||||
|
SERVER_HOST_URL=${publicUrl}
|
||||||
TRUST_PROXY=true
|
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_ENABLED=true
|
||||||
OIDC_ALLOW_ROOMS_CREATION_FOR_AUTH_USERS=true
|
OIDC_ALLOW_ROOMS_CREATION_FOR_AUTH_USERS=true
|
||||||
OIDC_BASE_URL_DYNAMIC=false
|
OIDC_BASE_URL_DYNAMIC=false
|
||||||
OIDC_ISSUER_BASE_URL=https://${pocketIdSubdomain}.${domain}
|
OIDC_ISSUER=https://${pocketIdSubdomain}.${domain}
|
||||||
OIDC_BASE_URL=${publicUrl}
|
OIDC_BASE_URL=${publicUrl}
|
||||||
OIDC_CLIENT_ID=mirotalk
|
OIDC_CLIENT_ID=mirotalk
|
||||||
OIDC_CLIENT_SECRET=${config.sops.placeholder."mirotalk/client_secret"}
|
OIDC_CLIENT_SECRET=${config.sops.placeholder."mirotalk/client_secret"}
|
||||||
|
OIDC_SECRET=${config.sops.placeholder."mirotalk/session_secret"}
|
||||||
OIDC_AUTH_REQUIRED=false
|
OIDC_AUTH_REQUIRED=false
|
||||||
OIDC_AUTH_LOGOUT=true
|
OIDC_AUTH_LOGOUT=true
|
||||||
SESSION_SECRET=${config.sops.placeholder."mirotalk/session_secret"}
|
|
||||||
|
|
||||||
HOST_PROTECTED=false
|
JWT_SECRET=${config.sops.placeholder."mirotalk/jwt_secret"}
|
||||||
HOST_USER_AUTH=false
|
JWT_EXPIRATION=1h
|
||||||
HOST_USERS='[]'
|
|
||||||
|
|
||||||
API_KEY_SECRET=${config.sops.placeholder."mirotalk/api_key_secret"}
|
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
|
SHOW_ACTIVE_ROOMS=true
|
||||||
STATS_ENABLED=false
|
|
||||||
SURVEY_ENABLED=false
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -18,13 +18,21 @@ in
|
|||||||
hostHttpPort = mkOption {
|
hostHttpPort = mkOption {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
};
|
};
|
||||||
|
minPort = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
};
|
||||||
|
maxPort = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf rootCfg.enable {
|
config = mkIf rootCfg.enable {
|
||||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
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 = [
|
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}";
|
user = "${common.user.uid}:${common.group.gid}";
|
||||||
environmentFiles = [ config.sops.templates."mirotalk.env".path ];
|
environmentFiles = [ config.sops.templates."mirotalk.env".path ];
|
||||||
@@ -43,9 +51,6 @@ in
|
|||||||
};
|
};
|
||||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||||
partOf = [ "${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" = { };
|
"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-port=${toString cfg.listenPort}
|
||||||
|
listening-ip=${cfg.listenIP}
|
||||||
fingerprint
|
fingerprint
|
||||||
lt-cred-mech
|
lt-cred-mech
|
||||||
realm=${realm}
|
realm=${realm}
|
||||||
user=turn:${config.sops.placeholder."turn/password"}
|
user=turn:${config.sops.placeholder."turn/password"}
|
||||||
min-port=${toString cfg.minPort}
|
min-port=${toString cfg.minPort}
|
||||||
max-port=${toString cfg.maxPort}
|
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
|
log-file=stdout
|
||||||
no-cli
|
no-cli
|
||||||
no-tls
|
no-tls
|
||||||
no-dtls
|
no-dtls
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,9 @@ in
|
|||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
listenIP = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
listenPort = mkOption {
|
listenPort = mkOption {
|
||||||
type = types.port;
|
type = types.port;
|
||||||
};
|
};
|
||||||
@@ -27,14 +30,16 @@ in
|
|||||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||||
image = "docker.io/coturn/coturn:4.6.3";
|
image = "docker.io/coturn/coturn:4.6.3";
|
||||||
cmd = [ "-c" "/etc/turnserver.conf" ];
|
cmd = [ "-c" "/etc/turnserver.conf" ];
|
||||||
ports =
|
ports = [
|
||||||
[ "0.0.0.0:${toString cfg.listenPort}:${toString cfg.listenPort}/udp" ]
|
"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
|
++ 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" ];
|
volumes = [ "${config.sops.templates."turnserver.conf".path}:/etc/turnserver.conf:ro" ];
|
||||||
log-driver = "journald";
|
log-driver = "journald";
|
||||||
extraOptions = [ "--network=${common.network.name}" ];
|
extraOptions = [
|
||||||
|
"--network=${common.network.name}"
|
||||||
|
"--ip=172.30.0.28"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."${common.backend}-${cfg.name}" = {
|
systemd.services."${common.backend}-${cfg.name}" = {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ in
|
|||||||
SSO_CLIENT_SECRET=${config.sops.placeholder."vaultwarden/client_secret"}
|
SSO_CLIENT_SECRET=${config.sops.placeholder."vaultwarden/client_secret"}
|
||||||
SSO_AUTH_ONLY_NOT_SESSION=true
|
SSO_AUTH_ONLY_NOT_SESSION=true
|
||||||
|
|
||||||
# SMTP via Stalwart
|
# SMTP
|
||||||
SMTP_HOST=${mailCfg.subdomain}.${domain}
|
SMTP_HOST=${mailCfg.subdomain}.${domain}
|
||||||
SMTP_FROM=${smtpUser}
|
SMTP_FROM=${smtpUser}
|
||||||
SMTP_FROM_NAME=Vaultwarden
|
SMTP_FROM_NAME=Vaultwarden
|
||||||
|
|||||||
@@ -22,11 +22,23 @@
|
|||||||
++ lib.optionals config.selfhosted.turn.enable [
|
++ lib.optionals config.selfhosted.turn.enable [
|
||||||
config.selfhosted.turn.listenPort
|
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 [
|
allowedUDPPortRanges = lib.optionals config.selfhosted.turn.enable [
|
||||||
{
|
{
|
||||||
from = config.selfhosted.turn.minPort;
|
from = config.selfhosted.turn.minPort;
|
||||||
to = config.selfhosted.turn.maxPort;
|
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