From 0185ec57c7172ddb2e4b3697e08443eeafa082a1 Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Fri, 5 Jul 2024 11:36:16 -0400 Subject: [PATCH] add import limit for the environment variables --- .env.sample | 1 + pages/api/v1/migration/index.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 65f5a81..b7161ae 100644 --- a/.env.sample +++ b/.env.sample @@ -29,6 +29,7 @@ PDF_MAX_BUFFER= SCREENSHOT_MAX_BUFFER= READABILITY_MAX_BUFFER= PREVIEW_MAX_BUFFER= +IMPORT_LIMIT= # AWS S3 Settings SPACES_KEY= diff --git a/pages/api/v1/migration/index.ts b/pages/api/v1/migration/index.ts index 0bf3d76..8cdf5db 100644 --- a/pages/api/v1/migration/index.ts +++ b/pages/api/v1/migration/index.ts @@ -9,7 +9,9 @@ import importFromWallabag from "@/lib/api/controllers/migration/importFromWallab export const config = { api: { bodyParser: { - sizeLimit: "10mb", + sizeLimit: process.env.IMPORT_LIMIT + ? process.env.IMPORT_LIMIT + "mb" + : "10mb", }, }, };