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

Configurable maximum crate size #153

Merged
merged 2 commits into from
May 22, 2023
Merged

Configurable maximum crate size #153

merged 2 commits into from
May 22, 2023

Conversation

Hirevo
Copy link
Owner

@Hirevo Hirevo commented May 20, 2023

This PR introduces a new max_crate_size (under [general]) configuration option to control the maximum allowed crate size upon publication.

This configuration option can be expressed as either a single number (in bytes) or as a string with a specific file size unit.
It is also possible to omit this field to disable any file size limits.

This configuration option only applies to crate tarball sizes, it doesn't apply this size limit to any other request payloads in the API.
Therefore, it is still recommended to run Alexandrie behind a reverse proxy server and set it to limit the size for all incoming HTTP request body.

Here are some examples of accepted values:

# 20 megabytes can be set using either:
max_crate_size = 20_000_000
# or:
max_crate_size = "20 MB"
# 50 mibibytes can be set using either:
max_crate_size = 52_428_800
# or:
max_crate_size = "50 MiB"
# 1 gigabyte can be set using either:
max_crate_size = 1_000_000_000
# or:
max_crate_size = "1 GB"

Closes #98.
Closes #151.

@Hirevo Hirevo added C-enhancement Category: Enhancement P-high Priority: High M-api Module: Programmatic API M-deployment Module: Deployment labels May 20, 2023
@Hirevo Hirevo self-assigned this May 20, 2023
@Hirevo Hirevo merged commit 841e44a into master May 22, 2023
6 checks passed
@Hirevo Hirevo deleted the feat/max-crate-size branch May 22, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement M-api Module: Programmatic API M-deployment Module: Deployment P-high Priority: High
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo checksum verification fails Allow configuring the crate upload size limit
1 participant