Skip to content

Feat: adjust max file size to have customizable limit - #1648

Open
Benebo7 wants to merge 2 commits into
MODSetter:devfrom
Benebo7:feat/add-max-file-size
Open

Feat: adjust max file size to have customizable limit#1648
Benebo7 wants to merge 2 commits into
MODSetter:devfrom
Benebo7:feat/add-max-file-size

Conversation

@Benebo7

@Benebo7 Benebo7 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes the 500MB per-file upload cap configurable via MAX_FILE_SIZE_MB
instead 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 invalid ETL_SERVICE placeholder in surfsense_backend/.env.example that broke a direct copy-paste setup.
  • add max file size env providing customizable limitation — introduces MAX_FILE_SIZE_MB, wired through the backend cap and the frontend runtime config.

Testing

Verified with MAX_FILE_SIZE_MB unset (default 500MB) and raised — in
both 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 invalid ETL_SERVICE placeholder in the backend environment example file that previously caused setup errors when copied directly.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 docker/.env.example
2 surfsense_backend/.env.example
3 docker/docker-compose.yml
4 docker/docker-compose.dev.yml
5 surfsense_backend/app/routes/documents_routes.py
6 surfsense_web/components/providers/runtime-config.server.tsx
7 surfsense_web/components/providers/runtime-config.tsx
8 surfsense_web/components/sources/DocumentUploadTab.tsx

Need help? Join our Discord

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f75edb59-f117-494d-b1c6-bda973f37855

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Benebo7

Benebo7 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant