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

6
flake.lock generated
View File

@@ -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": {

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