Merge pull request #479 from Hexastack/revert-478-revert-476-474-bug-avatars-are-not-persistent-after-restarting-the-api

Revert "Revert "fix: persist subscriber avatars""
This commit is contained in:
Med Marrouchi 2024-12-20 18:58:32 +01:00 committed by GitHub
commit c32e8a2472
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View File

@ -103,10 +103,12 @@ export const config: Config = {
from: process.env.EMAIL_SMTP_FROM || 'noreply@example.com',
},
parameters: {
uploadDir:
(process.env.UPLOAD_DIR && join(process.cwd(), process.env.UPLOAD_DIR)) ??
join(process.cwd(), 'uploads'),
avatarDir: process.env.AVATAR_DIR ?? join(process.cwd(), 'avatars'),
uploadDir: process.env.UPLOAD_DIR
? join(process.cwd(), process.env.UPLOAD_DIR)
: join(process.cwd(), 'uploads'),
avatarDir: process.env.AVATAR_DIR
? join(process.cwd(), process.env.AVATAR_DIR)
: join(process.cwd(), 'avatars'),
storageMode: 'disk',
maxUploadSize: process.env.UPLOAD_MAX_SIZE_IN_BYTES
? Number(process.env.UPLOAD_MAX_SIZE_IN_BYTES)

View File

@ -15,6 +15,7 @@ HTTPS_ENABLED=false
SESSION_SECRET=f661ff500fff6b0c8f91310b6fff6b0c
SESSION_NAME=s.id
UPLOAD_DIR=/uploads
AVATAR_DIR=/avatars
UPLOAD_MAX_SIZE_IN_BYTES=2000000
INVITATION_JWT_SECRET=dev_only
INVITATION_EXPIRES_IN=24h
@ -71,4 +72,3 @@ APP_REDIS_PORT=9001
REDIS_ENABLED=false
REDIS_HOST=redis
REDIS_PORT=6379

View File

@ -12,6 +12,7 @@ services:
- app-network
volumes:
- api-data:/app/uploads
- api-avatars-data:/app/avatars
depends_on:
mongo:
condition: service_healthy
@ -55,6 +56,7 @@ services:
volumes:
mongo-data:
api-data:
api-avatars-data:
networks:
db-network: