From 09014f7af5e4e948547e1174fce7d1b7e61f2636 Mon Sep 17 00:00:00 2001 From: Till Date: Fri, 6 Mar 2026 23:14:39 +0100 Subject: [PATCH] uploadsize --- system/matrix-server/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/system/matrix-server/default.nix b/system/matrix-server/default.nix index 183392e..d2a9efe 100644 --- a/system/matrix-server/default.nix +++ b/system/matrix-server/default.nix @@ -1,6 +1,7 @@ { ... }: let + domain = "jeppers.app"; fqdn = "matrix.${domain}"; baseUrl = "https://${fqdn}"; @@ -11,15 +12,18 @@ let add_header Access-Control-Allow-Origin *; return 200 '${builtins.toJSON data}'; ''; + maxUploadSize = "20M"; in { + services.matrix-synapse = { enable = true; settings = { server_name = domain; public_baseurl = baseUrl; + max_upload_size = maxUploadSize; listeners = [ { port = 8008; @@ -38,22 +42,25 @@ in ]; } ]; - extraConfigFiles = "/var/custom-access/matrix-shared-secret"; }; + extraConfigFiles = [ "/var/custom-access/matrix-shared-secret" ]; }; services.nginx.virtualHosts = { "${domain}" = { enableACME = true; - forceSSL = true; + onlySSL = true; locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig; locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig; }; "${fqdn}" = { enableACME = true; - forceSSL = true; + onlySSL = true; + extraConfig = '' + client_max_body_size ${maxUploadSize}; + ''; locations."/".extraConfig = '' return 404; ''; @@ -62,6 +69,6 @@ in }; }; - services.postgresql.enable = true; + services.postgresql.enable = true; }