diff --git a/.env.example b/.env.example index 0e3b7d5..518560a 100644 --- a/.env.example +++ b/.env.example @@ -23,3 +23,6 @@ DEBUG="app:*" # Disable public user registration. # DISABLE_SIGNUP=1 + +# Set maximum file size. Defaults to 10MB +# MAX_FILE_SIZE=20MB diff --git a/app/utils/media.server.ts b/app/utils/media.server.ts index 358d515..620a0cd 100644 --- a/app/utils/media.server.ts +++ b/app/utils/media.server.ts @@ -7,9 +7,10 @@ import { db } from "./db.server"; import { LRUCache } from "lru-cache"; import ms from "ms"; import { getImageData } from "./image.server"; +import envServer from "./env.server"; const log = debug("app:media-helpers"); -const MAX_FILE_SIZE = bytes("10MB"); +const MAX_FILE_SIZE = bytes(envServer.get('MAX_FILE_SIZE') ?? "10MB"); type UploadOutput = { url: string;