From 3ed8bbcbe34facf51e7501ea35561abafd8a322e Mon Sep 17 00:00:00 2001 From: hexastack Date: Fri, 17 Jan 2025 19:10:39 +0100 Subject: [PATCH] feat: make storage mode configurable env var --- api/src/config/index.ts | 2 +- docker/.env.example | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/config/index.ts b/api/src/config/index.ts index 91d48b7f..4c8a66d5 100644 --- a/api/src/config/index.ts +++ b/api/src/config/index.ts @@ -111,7 +111,7 @@ export const config: Config = { process.env.UPLOAD_DIR || '/uploads', '/avatars', ), - storageMode: 'disk', + storageMode: (process.env.STORAGE_MODE as 'disk' | 'memory') || 'disk', maxUploadSize: process.env.UPLOAD_MAX_SIZE_IN_BYTES ? Number(process.env.UPLOAD_MAX_SIZE_IN_BYTES) : 50 * 1024 * 1024, // 50 MB in bytes diff --git a/docker/.env.example b/docker/.env.example index 66f0296a..d2941d2d 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -17,7 +17,9 @@ HTTPS_ENABLED=false SESSION_SECRET=f661ff500fff6b0c8f91310b6fff6b0c SESSION_NAME=s.id # Relative attachments upload directory path to the app folder -UPLOAD_DIR=/uploads +UPLOAD_DIR=/uploads +# STORAGE MODE +STORAGE_MODE=disk # Max attachments upload size in bytes UPLOAD_MAX_SIZE_IN_BYTES=20971520 INVITATION_JWT_SECRET=dev_only