Feat: adjust max file size to have customizable limit - #1648
Conversation
|
@Benebo7 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I am actually curious about storage limit per workspace specifically on official cloud, but I am not certain about whether it is a architectural decision or a missing config. Whatever, I would be happy to implement it if wanted... |
Summary
Makes the 500MB per-file upload cap configurable via
MAX_FILE_SIZE_MBinstead of hardcoded, so self-hosted operators can raise it for their
own hardware. Enforced on the backend; the frontend reads the same
value via runtime config so its pre-upload check stays in sync.
Changes
adjust env example to a correct formatation, preventing error from direct copy— fixes an invalidETL_SERVICEplaceholder insurfsense_backend/.env.examplethat broke a direct copy-paste setup.add max file size env providing customizable limitation— introducesMAX_FILE_SIZE_MB, wired through the backend cap and the frontend runtime config.Testing
Verified with
MAX_FILE_SIZE_MBunset (default 500MB) and raised — inboth cases the frontend and backend limits stayed in sync, rejecting
files above the configured cap and accepting files within it end-to-end.
Confirmed the frontend keeps rejecting oversized files even after
raising the limit, until a file at or under the new cap is provided.
Obs
No UI changes so it`s not out of my codebase knowledge...
High-level PR Summary
This PR makes the 500MB per-file upload limit configurable through a new environment variable
MAX_FILE_SIZE_MB, allowing self-hosted operators to adjust the cap based on their hardware capabilities. The change propagates the configurable limit through both backend enforcement and frontend pre-upload checks to keep them synchronized. Additionally, it fixes an invalidETL_SERVICEplaceholder in the backend environment example file that previously caused setup errors when copied directly.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
docker/.env.examplesurfsense_backend/.env.exampledocker/docker-compose.ymldocker/docker-compose.dev.ymlsurfsense_backend/app/routes/documents_routes.pysurfsense_web/components/providers/runtime-config.server.tsxsurfsense_web/components/providers/runtime-config.tsxsurfsense_web/components/sources/DocumentUploadTab.tsx