Try this now
This commit is contained in:
@@ -1,5 +1,30 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
serverName = "atri.dad";
|
||||
matrixDomain = "chat.atri.dad";
|
||||
|
||||
# .well-known/matrix/client JSON
|
||||
wellKnownClient = builtins.toJSON {
|
||||
"m.homeserver" = {
|
||||
base_url = "https://${matrixDomain}";
|
||||
};
|
||||
"org.matrix.msc3575.proxy" = {
|
||||
url = "https://${matrixDomain}";
|
||||
};
|
||||
"org.matrix.msc4143.rtc_foci" = [
|
||||
{
|
||||
type = "livekit";
|
||||
livekit_service_url = "https://${matrixDomain}/livekit/jwt";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# .well-known/matrix/server JSON
|
||||
wellKnownServer = builtins.toJSON {
|
||||
"m.server" = "${matrixDomain}:443";
|
||||
};
|
||||
in
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
@@ -119,6 +144,19 @@
|
||||
proxyPass = "http://lloyd.tadpole-pain.ts.net:3000";
|
||||
extraConfig = "if ($fuckai) { return 444; }";
|
||||
};
|
||||
locations."= /.well-known/matrix/server" = {
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '${wellKnownServer}';
|
||||
'';
|
||||
};
|
||||
locations."= /.well-known/matrix/client" = {
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
return 200 '${wellKnownClient}';
|
||||
'';
|
||||
};
|
||||
};
|
||||
"analytics.atri.dad" = {
|
||||
enableACME = true;
|
||||
@@ -337,6 +375,67 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Matrix
|
||||
"chat.atri.dad" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://[::1]:8008";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
client_max_body_size 100M;
|
||||
'';
|
||||
};
|
||||
|
||||
locations."^~ /livekit/jwt/" = {
|
||||
priority = 400;
|
||||
proxyPass = "http://[::1]:${toString config.services.lk-jwt-service.port}/";
|
||||
};
|
||||
|
||||
locations."^~ /livekit/sfu/" = {
|
||||
priority = 400;
|
||||
proxyPass = "http://[::1]:${toString config.services.livekit.settings.port}/";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_send_timeout 120;
|
||||
proxy_read_timeout 120;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Accept-Encoding gzip;
|
||||
'';
|
||||
};
|
||||
|
||||
locations."= /.well-known/matrix/server" = {
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
return 200 '${wellKnownServer}';
|
||||
'';
|
||||
};
|
||||
locations."= /.well-known/matrix/client" = {
|
||||
extraConfig = ''
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
return 200 '${wellKnownClient}';
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# LiveKit WebRTC signaling domain
|
||||
"matrixrtc.atri.dad" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://[::1]:${toString config.services.livekit.settings.port}";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_send_timeout 120;
|
||||
proxy_read_timeout 120;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Accept-Encoding gzip;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# atash.dev hosts
|
||||
"atash.dev" = {
|
||||
enableACME = true;
|
||||
|
||||
Reference in New Issue
Block a user