Skip to content

Commit

Permalink
fix downloading big files for nextcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
ibizaman authored and ibizaman committed Dec 30, 2023
1 parent 61ef981 commit 7c9b585
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/services/nextcloud-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ in
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 {
description = "If non null, set up an Only Office service.";
default = null;
Expand Down Expand Up @@ -170,6 +179,8 @@ in
hostName = fqdn;
nginx.hstsMaxAge = 31536000; # Needs > 1 year for https://hstspreload.org to be happy

inherit (cfg) maxUploadSize;

config = {
dbtype = "pgsql";
adminuser = "root";
Expand Down Expand Up @@ -248,6 +259,14 @@ in
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";
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 = [
Expand Down

0 comments on commit 7c9b585

Please sign in to comment.