Not working coturn + ssl fix

This commit is contained in:
Aleksandr Lebedev 2025-04-03 18:43:12 +00:00
parent a337a12561
commit e9047f10db

View file

@ -63,27 +63,19 @@ users = {
enable = true; # Hopefully? helps with freezing when using swap enable = true; # Hopefully? helps with freezing when using swap
}; };
#Chat host #Chat host
networking.firewall.allowedTCPPorts = [ 80 443 22 8448 ]; networking.firewall.allowedTCPPorts = [ 80 443 22 8448
security.acme = { #3478 5349
acceptTerms = true; ];
defaults.email = "alex.lebedev2003@icloud.com"; # networking.firewall.allowedUDPPortRanges = with config.services.coturn; [ {
certs = { # from = min-port;
"kylekrein.com" = { # to = max-port;
webroot = "/var/lib/acme/challenges-kylekrein"; #} ];
email = "alex.lebedev2003@icloud.com"; #networking.firewall.allowedUDPPorts = [ 3478 5349 ];
group = "nginx"; sops.secrets."services/conduwuit" = {mode = "0755";};
extraDomainNames = [
"matrix.kylekrein.com"
#"chat.kylekrein.com"
];
};
};
};
users.users.nginx.extraGroups = [ "acme" ];
sops.secrets."services/conduwuit" = {neededForUsers = true;};
services.conduwuit = { services.conduwuit = {
enable = true; enable = true;
#user = "turnserver";
settings = { settings = {
global = { global = {
server_name = "kylekrein.com"; server_name = "kylekrein.com";
@ -100,46 +92,37 @@ users = {
CONDUWUIT_NEW_USER_DISPLAYNAME_SUFFIX = "🐝"; CONDUWUIT_NEW_USER_DISPLAYNAME_SUFFIX = "🐝";
CONDUWUIT_REQUIRE_AUTH_FOR_PROFILE_REQUESTS = "true"; CONDUWUIT_REQUIRE_AUTH_FOR_PROFILE_REQUESTS = "true";
CONDUWUIT_ALLOW_LOCAL_PRESENCE = "true"; CONDUWUIT_ALLOW_LOCAL_PRESENCE = "true";
CONDUWUIT_WELL_KNOWN__SERVER = "matrix.kylekrein.com:443";
CONDUWUIT_WELL_KNOWN__CLIENT = "https://matrix.kylekrein.com";
#CONDUWUIT_TURN_URIS = "turn:turn.kylekrein.com:3478?transport=udp";
#CONDUWUIT_TURN_SECRET = "true";
#CONDUWUIT_TURN_SECRET_FILE = "\"${config.sops.secrets."services/conduwuit".path}\"";
}; };
}; };
services.coturn = rec {
services.nginx.enable = true; enable = false;
services.nginx = { no-cli = true;
# Use recommended settings no-tcp-relay = true;
recommendedGzipSettings = true; min-port = 49000;
recommendedOptimisation = true; max-port = 50000;
recommendedProxySettings = true; use-auth-secret = true;
recommendedTlsSettings = true; static-auth-secret-file = config.sops.secrets."services/conduwuit".path;
clientMaxBodySize = "20000000"; realm = "turn.kylekrein.com";
#cert = "${config.security.acme.certs.${realm}.directory}/full.pem";
#pkey = "${config.security.acme.certs.${realm}.directory}/key.pem";
}; };
services.nginx.virtualHosts = let services.caddy = {
SSL = { enable = true;
#enableACME = true; virtualHosts."kylekrein.com:8448".extraConfig = ''
forceSSL = true; reverse_proxy http://localhost:6167
useACMEHost = "kylekrein.com"; '';
acmeRoot = "/var/lib/acme/challenges-kylekrein"; virtualHosts."matrix.kylekrein.com, matrix.kylekrein.com:8448".extraConfig = ''
}; in { reverse_proxy http://localhost:6167
"kylekrein.com" = (SSL // { '';
listen = [{port = 443; addr="0.0.0.0"; ssl=true;} {port = 8448; addr="0.0.0.0"; ssl=true;}]; #virtualHosts."turn.kylekrein.com:3478".extraConfig = ''
locations."/" = { #reverse_proxy http://localhost:3478
proxyPass = "http://localhost:6167"; #'';
proxyWebsockets = true; };
};
});
#"chat.kylekrein.com" = (SSL // {
# locations."/" = {
# proxyPass = "http://localhost:8080/";
# proxyWebsockets = true;
# };
#});
"matrix.kylekrein.com" = (SSL // {
listen = [{port = 443; addr="0.0.0.0"; ssl=true;} {port = 8448; addr="0.0.0.0"; ssl=true;}];
locations."/" = {
proxyPass = "http://localhost:6167";
proxyWebsockets = true;
};
});
};
system.stateVersion = "24.11"; system.stateVersion = "24.11";
nix = { nix = {
settings = { settings = {