Add maximum file upload size limit for the package registry
What does this MR do?
This adds new application limits:
nuget_max_file_size
pypi_max_file_size
conan_max_file_size
npm_max_file_size
maven_max_file_size
The default is 52428800 (50 megabytes in binary bytes) to match the existing hardcoded limit already in place.
This limit is used to prevent files that are too large from being uploaded using any of the available package APIs. They can be configured to a higher limit on self-managed instances (see docs update).
Database
Up Migration
== 20200818171229 AddPackageMaxFileSizeToPlanLimits: migrating ================
-- add_column(:plan_limits, :conan_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0021s
-- add_column(:plan_limits, :maven_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0008s
-- add_column(:plan_limits, :npm_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0007s
-- add_column(:plan_limits, :nuget_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0006s
-- add_column(:plan_limits, :pypi_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0007s
== 20200818171229 AddPackageMaxFileSizeToPlanLimits: migrated (0.0051s) =======
Down Migration
== 20200818171229 AddPackageMaxFileSizeToPlanLimits: reverting ================
-- remove_column(:plan_limits, :pypi_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0016s
-- remove_column(:plan_limits, :nuget_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0004s
-- remove_column(:plan_limits, :npm_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0004s
-- remove_column(:plan_limits, :maven_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0003s
-- remove_column(:plan_limits, :conan_max_file_size, :bigint, {:default=>52428800, :null=>false})
-> 0.0004s
== 20200818171229 AddPackageMaxFileSizeToPlanLimits: reverted (0.0056s) =======
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides - [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Related #218017 (closed), #218014 (closed), #218015 (closed), #218016 (closed), #218018 (closed)
Edited by Steve Abrams