Commit 82449c5c authored by Steve Abrams's avatar Steve Abrams Committed by Toon Claes

Update package max file sizes to sensible defaults

Update the default values for the _max_file_size
limits on package files. The new defaults are better
suited for realistic limits.
parent 2df757d7
---
title: Update default plan limits for maximum package file sizes
merge_request: 40410
author:
type: changed
# frozen_string_literal: true
class UpdatePackageFileSizePlanLimitsDefaults < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
change_column_default(:plan_limits, :maven_max_file_size, from: 50.megabytes, to: 3.gigabytes)
change_column_default(:plan_limits, :conan_max_file_size, from: 50.megabytes, to: 3.gigabytes)
change_column_default(:plan_limits, :nuget_max_file_size, from: 50.megabytes, to: 500.megabytes)
change_column_default(:plan_limits, :npm_max_file_size, from: 50.megabytes, to: 500.megabytes)
change_column_default(:plan_limits, :pypi_max_file_size, from: 50.megabytes, to: 3.gigabytes)
end
end
# frozen_string_literal: true
class UpdatePackageMaxFileSizePlanLimits < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
# this is intended to be a no-op for GitLab.com
# 5GB is the value for these columns as of 2020-09-02
if Gitlab.com?
update_all_plan_limits('conan_max_file_size', 5.gigabytes)
update_all_plan_limits('maven_max_file_size', 5.gigabytes)
update_all_plan_limits('npm_max_file_size', 5.gigabytes)
update_all_plan_limits('nuget_max_file_size', 5.gigabytes)
update_all_plan_limits('pypi_max_file_size', 5.gigabytes)
else
update_all_plan_limits('conan_max_file_size', 3.gigabytes)
update_all_plan_limits('maven_max_file_size', 3.gigabytes)
update_all_plan_limits('npm_max_file_size', 500.megabytes)
update_all_plan_limits('nuget_max_file_size', 500.megabytes)
update_all_plan_limits('pypi_max_file_size', 3.gigabytes)
end
end
def down
update_all_plan_limits('conan_max_file_size', 50.megabytes)
update_all_plan_limits('maven_max_file_size', 50.megabytes)
update_all_plan_limits('npm_max_file_size', 50.megabytes)
update_all_plan_limits('nuget_max_file_size', 50.megabytes)
update_all_plan_limits('pypi_max_file_size', 50.megabytes)
end
private
def update_all_plan_limits(limit_name, limit_value)
limit_name_quoted = quote_column_name(limit_name)
limit_value_quoted = quote(limit_value)
execute <<~SQL
UPDATE plan_limits
SET #{limit_name_quoted} = #{limit_value_quoted};
SQL
end
end
ff41fa940a0a5c3627dfec22ed4e704d6edc534edf30883a36aa454210bb3d43
\ No newline at end of file
58e1e87a9a0159d62db761d8caa91a5bf2cc1a2ccceb1b57ff35b53f7698d08f
\ No newline at end of file
...@@ -14220,11 +14220,11 @@ CREATE TABLE public.plan_limits ( ...@@ -14220,11 +14220,11 @@ CREATE TABLE public.plan_limits (
ci_max_artifact_size_browser_performance integer DEFAULT 0 NOT NULL, ci_max_artifact_size_browser_performance integer DEFAULT 0 NOT NULL,
ci_max_artifact_size_load_performance integer DEFAULT 0 NOT NULL, ci_max_artifact_size_load_performance integer DEFAULT 0 NOT NULL,
ci_needs_size_limit integer DEFAULT 50 NOT NULL, ci_needs_size_limit integer DEFAULT 50 NOT NULL,
conan_max_file_size bigint DEFAULT 52428800 NOT NULL, conan_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
maven_max_file_size bigint DEFAULT 52428800 NOT NULL, maven_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
npm_max_file_size bigint DEFAULT 52428800 NOT NULL, npm_max_file_size bigint DEFAULT 524288000 NOT NULL,
nuget_max_file_size bigint DEFAULT 52428800 NOT NULL, nuget_max_file_size bigint DEFAULT 524288000 NOT NULL,
pypi_max_file_size bigint DEFAULT 52428800 NOT NULL, pypi_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
generic_packages_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL generic_packages_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment