feat: make storage mode configurable env var

This commit is contained in:
hexastack 2025-01-17 19:10:39 +01:00
parent b74c4a4e3a
commit 3ed8bbcbe3
2 changed files with 4 additions and 2 deletions

View File

@ -111,7 +111,7 @@ export const config: Config = {
process.env.UPLOAD_DIR || '/uploads', process.env.UPLOAD_DIR || '/uploads',
'/avatars', '/avatars',
), ),
storageMode: 'disk', storageMode: (process.env.STORAGE_MODE as 'disk' | 'memory') || 'disk',
maxUploadSize: process.env.UPLOAD_MAX_SIZE_IN_BYTES maxUploadSize: process.env.UPLOAD_MAX_SIZE_IN_BYTES
? Number(process.env.UPLOAD_MAX_SIZE_IN_BYTES) ? Number(process.env.UPLOAD_MAX_SIZE_IN_BYTES)
: 50 * 1024 * 1024, // 50 MB in bytes : 50 * 1024 * 1024, // 50 MB in bytes

View File

@ -18,6 +18,8 @@ SESSION_SECRET=f661ff500fff6b0c8f91310b6fff6b0c
SESSION_NAME=s.id SESSION_NAME=s.id
# Relative attachments upload directory path to the app folder # 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 # Max attachments upload size in bytes
UPLOAD_MAX_SIZE_IN_BYTES=20971520 UPLOAD_MAX_SIZE_IN_BYTES=20971520
INVITATION_JWT_SECRET=dev_only INVITATION_JWT_SECRET=dev_only