Handling fs

This commit is contained in:
Anaïs Saraiva
2026-08-15 10:31:52 +02:00
parent f1a8a05417
commit 12d9e99aa2
8 changed files with 64 additions and 17 deletions
+9 -2
View File
@@ -48,8 +48,14 @@ in
fileTtlMs = lib.mkOption {
type = lib.types.ints.positive;
default = 7 * 24 * 60 * 60 * 1000;
description = "Milliseconds before an uploaded file expires and is deleted.";
default = 48 * 60 * 60 * 1000;
description = "Milliseconds before an uploaded file expires and is deleted (hard-capped at 48 hours).";
};
maxStorageUsage = lib.mkOption {
type = lib.types.float;
default = 0.5;
description = "Maximum fraction (0.0-1.0) of the storage filesystem that may be used; uploads are rejected above this.";
};
publicBaseUrl = lib.mkOption {
@@ -127,6 +133,7 @@ in
"STORAGE_DIR=${cfg.storageDir}"
"MAX_FILE_SIZE=${cfg.maxFileSize}"
"FILE_TTL_MS=${toString cfg.fileTtlMs}"
"MAX_STORAGE_USAGE=${toString cfg.maxStorageUsage}"
]
++ lib.optionals (cfg.publicBaseUrl != null) [ "PUBLIC_BASE_URL=${cfg.publicBaseUrl}" ]
++ lib.optionals cfg.trustProxy [ "TRUST_PROXY=1" ];