feat: make avatar upload size limit configurable via environment variable#375
feat: make avatar upload size limit configurable via environment variable#375tgoetten wants to merge 1 commit intokanbn:mainfrom
Conversation
|
Hi @tgoetten, Thank you for your PR! I've went ahead and tested this on my development machine. It does reject larger files provided by the environment variable as well as a successful upload of an image smaller than the maximum, but it seems there is no visual feedback of an error message after the POST request. It returns a HTTP status of 400 (bad request) with the JSON body of: But I don't get a toast notification or any visual feedback that an error occurred. |
|
Hi @program-the-brain-not-the-heartbeat, You're right that there's no toast notification for this error. However, I noticed that several other error cases in the application also only log to the browser console without visual feedback. I'd suggest keeping this PR focused on the backend configuration change, and addressing the toast notifications as a separate improvement that could cover all upload error cases consistently (avatars, attachments, etc.). Would you be open to merging this as-is and tracking the UI feedback enhancement in a separate issue/PR? I'm happy to create that issue if you'd like. |
|
Yes, I 100% agree, let's leave the user feedback/notification defects in a separate issue. |
|
lgtm @tgoetten, you'll also need to add this to:
|
Description
This PR makes the avatar upload size limit configurable via the
S3_AVATAR_UPLOAD_LIMITenvironment variable, instead of being hardcoded to 2MB.Closes #374
Changes
MAX_SIZE_BYTESfrom environment variable with 2MB defaultS3_AVATAR_UPLOAD_LIMITexampleMotivation
Self-hosted instances may have different storage constraints and user requirements. This change allows administrators to configure the avatar upload limit without modifying source code.
Usage
# In .env file - set to 10MB S3_AVATAR_UPLOAD_LIMIT=10485760If not set, the default remains 2MB (2097152 bytes) for backward compatibility.
Testing
S3_AVATAR_UPLOAD_LIMIT=10485760in.envChecklist