matrix
This commit is contained in:
parent
b27835f9b7
commit
552eceaf18
3 changed files with 33 additions and 7 deletions
|
|
@ -2,6 +2,7 @@ _: {
|
||||||
imports = [
|
imports = [
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
./databases.nix
|
./databases.nix
|
||||||
|
./matrix-synapse.nix
|
||||||
./media
|
./media
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,42 @@
|
||||||
_:
|
_:
|
||||||
let
|
let
|
||||||
server_name = "jdonszelmann.nl";
|
server_name = "jdonszelmann.nl";
|
||||||
|
domain = "matrix.${server_name}";
|
||||||
port = 11001;
|
port = 11001;
|
||||||
in {
|
in
|
||||||
services.nginx.virtualHosts.${server_name} = {
|
{
|
||||||
|
services.nginx.virtualHosts.${domain} = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
locations."/" = {
|
locations."/_matrix" = {
|
||||||
proxyPass = "http://[::1]:${port}";
|
proxyPass = "http://[::1]:${toString port}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
|
locations."/_synapse/client" = {
|
||||||
|
proxyPass = "http://[::1]:${toString port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${server_name} = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/.well-known/matrix/client".extraConfig = ''
|
||||||
|
add_header Content-Type application/json;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
return 200 '${
|
||||||
|
builtins.toJSON {
|
||||||
|
"m.homeserver".base_url = "https://${domain}";
|
||||||
|
"m.identity_server" = { };
|
||||||
|
}
|
||||||
|
}';
|
||||||
|
'';
|
||||||
|
locations."/.well-known/matrix/server".extraConfig = ''
|
||||||
|
add_header Content-Type application/json;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
return 200 '${builtins.toJSON { "m.server" = "${domain}:443"; }}';
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,11 @@ _: {
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
79
|
80
|
||||||
442
|
443
|
||||||
];
|
];
|
||||||
|
|
||||||
security.acme.defaults.email = "jana@donsz.nl";
|
security.acme.defaults.email = "jana@donsz.nl";
|
||||||
security.acme.acceptTerms = true;
|
security.acme.acceptTerms = true;
|
||||||
security.acme.preliminarySelfsigned = true;
|
security.acme.preliminarySelfsigned = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue