-
-
Notifications
You must be signed in to change notification settings - Fork 267
Open
Labels
featureNew feature or requestNew feature or request
Description
✨ Feature Request
Is your feature request related to a problem? Please describe.
When self-hosting Kan with Docker, I'm unable to upload avatar images larger than 2MB. The error message "File too large" appears, but there is no way to configure this limit without modifying the source code and rebuilding the Docker image.
Describe the solution you'd like
Add a new environment variable (e.g., S3_AVATAR_UPLOAD_LIMIT) to make the avatar upload size limit configurable, similar to how S3_UPLOAD_LIMIT works for attachments.
The change would be in apps/web/src/pages/api/upload/avatar.ts:
// Current (hardcoded):
const MAX_SIZE_BYTES = 2 * 1024 * 1024; // 2MB
// Proposed (configurable):
const MAX_SIZE_BYTES = parseInt(process.env.S3_AVATAR_UPLOAD_LIMIT || '2097152', 10); // Default 2MBDescribe alternatives you've considered
- Resizing images manually before uploading (inconvenient for users)
- Building a custom Docker image with modified source code (difficult to maintain across updates)
- Using a reverse proxy to modify request limits (doesn't solve the application-level check)
Additional context
- The attachment upload endpoint already supports a configurable
S3_UPLOAD_LIMITenvironment variable - This would maintain consistency with the existing configuration pattern
- Default behavior would remain unchanged (2MB) for backward compatibility
- Affected file:
apps/web/src/pages/api/upload/avatar.ts
Implementation ideas (optional)
- Add
S3_AVATAR_UPLOAD_LIMITto the environment variable documentation in README.md - Update
apps/web/src/pages/api/upload/avatar.tsto read from the environment variable with a 2MB default - Optionally add validation to ensure the value is a positive integer
Would you like to work on this feature?
- Yes, I'd like to help implement this feature
- No, I'm just suggesting the feature
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request