uploadsize

This commit is contained in:
Till 2026-03-06 23:14:39 +01:00
parent 809e20f981
commit 09014f7af5

View file

@ -1,6 +1,7 @@
{ ... }: { ... }:
let let
domain = "jeppers.app"; domain = "jeppers.app";
fqdn = "matrix.${domain}"; fqdn = "matrix.${domain}";
baseUrl = "https://${fqdn}"; baseUrl = "https://${fqdn}";
@ -11,15 +12,18 @@ let
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON data}'; return 200 '${builtins.toJSON data}';
''; '';
maxUploadSize = "20M";
in in
{ {
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
settings = { settings = {
server_name = domain; server_name = domain;
public_baseurl = baseUrl; public_baseurl = baseUrl;
max_upload_size = maxUploadSize;
listeners = [ listeners = [
{ {
port = 8008; port = 8008;
@ -38,22 +42,25 @@ in
]; ];
} }
]; ];
extraConfigFiles = "/var/custom-access/matrix-shared-secret";
}; };
extraConfigFiles = [ "/var/custom-access/matrix-shared-secret" ];
}; };
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"${domain}" = { "${domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; onlySSL = true;
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig; locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig; locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
}; };
"${fqdn}" = { "${fqdn}" = {
enableACME = true; enableACME = true;
forceSSL = true; onlySSL = true;
extraConfig = ''
client_max_body_size ${maxUploadSize};
'';
locations."/".extraConfig = '' locations."/".extraConfig = ''
return 404; return 404;
''; '';
@ -62,6 +69,6 @@ in
}; };
}; };
services.postgresql.enable = true; services.postgresql.enable = true;
} }