update hastebin

This commit is contained in:
Joakim Repomaa
2025-02-11 10:13:58 +02:00
parent 43f44ad06d
commit 21f3f9e390
2 changed files with 15 additions and 15 deletions

View File

@@ -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;
'';
};
};
};
};