From 21f3f9e39017c6579e53403f63851e5d5f1f17bd Mon Sep 17 00:00:00 2001 From: Joakim Repomaa Date: Tue, 11 Feb 2025 10:13:58 +0200 Subject: [PATCH] update hastebin --- flake.lock | 6 +++--- modules/services/bin.nix | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 517d51e..7694090 100644 --- a/flake.lock +++ b/flake.lock @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1739189509, - "narHash": "sha256-Lmf7rjFQCuugOVy2Rl7ROS5SggUJfasiUGpGIHqbLL4=", + "lastModified": 1739261575, + "narHash": "sha256-MRU+at2TEZ61G1bXJeVYIswJ8mVIaqVmXrKLBNs0lvU=", "owner": "~repomaa", "repo": "hastebin", - "rev": "1b5ac48b94ffbdd9c960675cac867abc896c4c7f", + "rev": "0400c9d3fcfe77dd4bd087c3f1f5ce06a8f29ad9", "type": "sourcehut" }, "original": { diff --git a/modules/services/bin.nix b/modules/services/bin.nix index 4eb75cc..f8f090e 100644 --- a/modules/services/bin.nix +++ b/modules/services/bin.nix @@ -2,9 +2,6 @@ let cfg = config.modules.services.bin; fqdn = "${cfg.subdomain}.${config.networking.domain}"; - KiB = 1024; - MiB = 1024 * KiB; - GiB = 1024 * MiB; in { imports = [ @@ -28,7 +25,7 @@ in settings = { port = cfg.port; host = "::1"; - max_size = 1 * GiB; + max_size = "1 GiB"; mime_overrides = { "text/plain" = [ "log" @@ -51,14 +48,17 @@ in modules.services.webserver = { enable = lib.mkDefault true; - vHosts.${fqdn}.locations."/" = { - proxyPort = cfg.port; - extraConfig = '' - client_max_body_size ${toString (config.services.hastebin.settings.max_size / MiB)}m; - proxy_send_timeout 300; - proxy_read_timeout 300; - send_timeout 300; - ''; + vHosts.${fqdn} = { + proxyBuffering = false; + locations."/" = { + proxyPort = cfg.port; + extraConfig = '' + client_max_body_size 0; + proxy_send_timeout 300; + proxy_read_timeout 300; + send_timeout 300; + ''; + }; }; }; };