From 1d0d4e601673c324b004de65f594e29ca9ca1da4 Mon Sep 17 00:00:00 2001 From: Agatha Lovelace Date: Sat, 18 Feb 2023 13:50:10 +0100 Subject: [PATCH] Increase upload limit in bin --- common/fragments/bin.nix | 1 + common/services/bin.nix | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/common/fragments/bin.nix b/common/fragments/bin.nix index 14fc19f..a78f213 100644 --- a/common/fragments/bin.nix +++ b/common/fragments/bin.nix @@ -5,5 +5,6 @@ enable = true; address = "0.0.0.0"; port = 6162; + textUploadLimit = 32; }; } diff --git a/common/services/bin.nix b/common/services/bin.nix index 5550e51..d0e0731 100644 --- a/common/services/bin.nix +++ b/common/services/bin.nix @@ -20,6 +20,12 @@ in { description = "Binary uploads file size limit (in MiB)"; }; + textUploadLimit = mkOption { + type = types.nullOr types.int; + default = 16; + description = "Text uploads file size limit (in MiB)"; + }; + clientDesc = mkOption { type = types.nullOr types.bool; default = false; @@ -50,6 +56,8 @@ in { serviceConfig = { Type = "simple"; + Environment = + ''BIN_LIMITS={form="${toString cfg.textUploadLimit} MiB"}''; ExecStart = "${pkgs.bin}/bin/bin -a ${toString cfg.address} -b ${ toString cfg.binaryUploadLimit } -p ${toString cfg.port} -u ${toString cfg.upload}";