1
0
Fork 0

fix downloading big files for nextcloud

This commit is contained in:
ibizaman 2023-12-29 14:32:02 -08:00 committed by Pierre Penninckx
parent 61ef981511
commit 7c9b585b81

View file

@ -39,6 +39,15 @@ in
description = "File containing the Nextcloud admin password."; description = "File containing the Nextcloud admin password.";
}; };
maxUploadSize = lib.mkOption {
default = "4G";
type = lib.types.str;
description = ''
The upload limit for files. This changes the relevant options
in php.ini and nginx if enabled.
'';
};
onlyoffice = lib.mkOption { onlyoffice = lib.mkOption {
description = "If non null, set up an Only Office service."; description = "If non null, set up an Only Office service.";
default = null; default = null;
@ -170,6 +179,8 @@ in
hostName = fqdn; hostName = fqdn;
nginx.hstsMaxAge = 31536000; # Needs > 1 year for https://hstspreload.org to be happy nginx.hstsMaxAge = 31536000; # Needs > 1 year for https://hstspreload.org to be happy
inherit (cfg) maxUploadSize;
config = { config = {
dbtype = "pgsql"; dbtype = "pgsql";
adminuser = "root"; adminuser = "root";
@ -248,6 +259,14 @@ in
sslCertificate = lib.mkIf config.shb.ssl.enable "/var/lib/acme/${cfg.domain}/cert.pem"; sslCertificate = lib.mkIf config.shb.ssl.enable "/var/lib/acme/${cfg.domain}/cert.pem";
sslCertificateKey = lib.mkIf config.shb.ssl.enable "/var/lib/acme/${cfg.domain}/key.pem"; sslCertificateKey = lib.mkIf config.shb.ssl.enable "/var/lib/acme/${cfg.domain}/key.pem";
forceSSL = lib.mkIf config.shb.ssl.enable true; forceSSL = lib.mkIf config.shb.ssl.enable true;
# From [1] this should fix downloading of big files. [2] seems to indicate that buffering
# happens at multiple places anyway, so disabling one place should be okay.
# [1]: https://help.nextcloud.com/t/download-aborts-after-time-or-large-file/25044/6
# [2]: https://stackoverflow.com/a/50891625/1013628
extraConfig = ''
proxy_buffering off;
'';
}; };
environment.systemPackages = [ environment.systemPackages = [