Skip to content
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

Allow configuration of MAX_UPLOAD_SIZE #792

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Allow configuration of MAX_UPLOAD_SIZE #792

merged 1 commit into from
Feb 15, 2024

Conversation

tbuerli-komax
Copy link
Contributor

Allow the image users (server operators) to define their own limit for the Maximal Documentation size.

This approach implements a new Environmental Variable, which can be used to overwrite the default maximum post size of 100MB. It was proposed with the same default to be backwards compatible and simple to setup.
With this change the operator can adapt the application better to their specific environment.

@randombenj
Copy link
Member

@fliiiix any idea why we are limiting the max body size at all? Or could we just remove the max body size and don't limit it?

@tbuerli-komax
Copy link
Contributor Author

@fliiiix any idea why we are limiting the max body size at all? Or could we just remove the max body size and don't limit it?

according to the documentation setting it to 0 would allow disabling it, which is then possible for the user to do: https://nginx.org/en/docs/http/ngx_http_core_module.html

But on the other hand forcing it to be 0 for everyone might lead to denial-of-service depending on the exact configuration.

@fliiiix
Copy link
Member

fliiiix commented Feb 6, 2024

I think because it is best practice to limit that and if you have docs which are bigger that is 'interesting'

@tbuerli-komax is that an actual use-case you had?

@fliiiix fliiiix self-requested a review February 6, 2024 20:03
@fliiiix
Copy link
Member

fliiiix commented Feb 6, 2024

but i mean that looks fair enough you could also just override the config via mount something we do in production to change different aspects of the config

@tbuerli-komax
Copy link
Contributor Author

Yes mounting and therefore overwriting the configuration in the container at runtime is also a possibility. But this comes with the drawback, that it overwrites the whole config, which then requires extra maintanance (from the operators) as the config also contains other settings.

For Example, if the internal setup changes (for example the python_backend port) this requires a change in the nginx config and this is only a nonbreaking change as long as operators do not overwrite internal files.

@tbuerli-komax
Copy link
Contributor Author

I think because it is best practice to limit that and if you have docs which are bigger that is 'interesting'

@tbuerli-komax is that an actual use-case you had?

Yes, exactly this was what triggered this pull request. Some of our Documentations are bigger than 100MB and if we use a suficcient storage backing the container it should work to serve even the bigger Documentations.

Since you have already aproved it, can you also merge it?
(FYI, as external Person I do not have the permission to merge it)

@fliiiix fliiiix merged commit 6f784be into docat-org:main Feb 15, 2024
4 checks passed
@tbuerli-komax tbuerli-komax deleted the feature/config-max-upload-size branch February 16, 2024 10:10
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.

3 participants