Handling fs
This commit is contained in:
@@ -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" ];
|
||||
|
||||
Reference in New Issue
Block a user