-
Notifications
You must be signed in to change notification settings - Fork 70
Add per-domain client_max_body_size configuration #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added clientMaxBodySize field to Domain model in Prisma schema (default 100MB) - Created database migration for new field - Updated backend types and DTOs to support clientMaxBodySize - Updated domains repository to handle clientMaxBodySize in create/update operations - Updated nginx-config service to include client_max_body_size directive in generated configs - Updated frontend DomainDialogV2 to add input field for clientMaxBodySize in Advanced tab - Builds successfully on both backend and frontend Co-authored-by: vncloudsco <[email protected]>
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
- Created domain.constants.ts with DEFAULT_CLIENT_MAX_BODY_SIZE constant - Updated domains.repository.ts to use the constant - Updated nginx-config.service.ts to use the constant via helper method - Added getClientMaxBodySize() helper method to reduce code duplication - Improves maintainability by centralizing the default value Co-authored-by: vncloudsco <[email protected]>
|
vncloudsco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report for apps/api
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for configuring the maximum request body size (client_max_body_size) for Nginx domains. This allows administrators to control file upload size limits on a per-domain basis.
- Adds
clientMaxBodySizefield to domain schema with a default value of 100MB - Implements UI controls in the domain dialog for configuring this setting
- Generates appropriate Nginx configuration with the
client_max_body_sizedirective
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/api/prisma/schema.prisma | Adds clientMaxBodySize field to Domain model with default 100 |
| apps/api/prisma/migrations/20251104025114_add_client_max_body_size/migration.sql | Database migration to add the new column |
| apps/api/src/shared/constants/domain.constants.ts | Defines constant for default client max body size |
| apps/api/src/domains/domains/domains.types.ts | Adds clientMaxBodySize to AdvancedConfigData interface |
| apps/api/src/domains/domains/domains.repository.ts | Handles persistence of clientMaxBodySize in create/update operations |
| apps/api/src/domains/domains/services/nginx-config.service.ts | Generates client_max_body_size directive in Nginx configs |
| apps/web/src/components/domains/DomainDialogV2.tsx | Adds UI input field with validation for configuring max body size |





Users cannot upload files >20MB. Added configurable
client_max_body_sizeper domain (1MB-10GB range, default 100MB).Changes
Database
clientMaxBodySizefield to Domain model (nullable int, default 100)20251104025114_add_client_max_body_sizeBackend
DEFAULT_CLIENT_MAX_BODY_SIZEconstant (100MB)AdvancedConfigDatainterface withclientMaxBodySize?: numberclient_max_body_sizedirective in both HTTP and HTTPS server blocksFrontend
advancedConfig.clientMaxBodySizein API payloadGenerated Config
Setting a domain to 250MB produces:
Existing domains will default to 100MB after migration.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkpoint.prisma.io/usr/local/bin/node /home/REDACTED/.npm/_npx/2778af9cee32ff87/node_modules/prisma/build/child {"product":"prisma","version":"6.18.0","cli_install_type":"local","information":"","local_timestamp":"2025-11-04T02:53:39Z","project_hash":"a902f162","cli_path":"/home/REDACTED/.npm/_npx/2778af9cee32ff87/node_modules/.bin/prisma","cli_path_hash":"5a8877e8","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.5","ci":true,"ci_name":"GitHub Actions","command":"migrate dev --name [redacted] --create-only","schema_providers":["postgresql"],"schema_preview_features":[],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-5a8877e8","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/.npm/_npx/2778af9cee32ff87/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true}(dns block)/usr/local/bin/node /home/REDACTED/.npm/_npx/2778af9cee32ff87/node_modules/prisma/build/child {"product":"prisma","version":"6.18.0","cli_install_type":"local","information":"","local_timestamp":"2025-11-04T02:54:04Z","project_hash":"a902f162","cli_path":"/home/REDACTED/.npm/_npx/2778af9cee32ff87/node_modules/.bin/prisma","cli_path_hash":"5a8877e8","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.5","ci":true,"ci_name":"GitHub Actions","command":"migrate dev --name [redacted] --create-only","schema_providers":["postgresql"],"schema_preview_features":[],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-5a8877e8","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/.npm/_npx/2778af9cee32ff87/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true}(dns block)/usr/local/bin/node /home/REDACTED/work/nginx-love/nginx-love/apps/api/node_modules/prisma/build/child {"product":"prisma","version":"5.22.0","cli_install_type":"local","information":"","local_timestamp":"2025-11-04T02:59:30Z","project_hash":"a902f162","cli_path":"/home/REDACTED/work/nginx-love/nginx-love/apps/api/node_modules/prisma/build/index.js","cli_path_hash":"38728486","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.5","ci":true,"ci_name":"GitHub Actions","command":"generate --postinstall \"UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING\"","schema_providers":["postgresql"],"schema_preview_features":[],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-38728486","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/work/nginx-love/nginx-love/apps/api/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true}(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.