diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-16 15:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-16 15:09:17 +0300 |
commit | 09dff3eec735ccbe001d165293ecebf195452071 (patch) | |
tree | 03c73077d0703edb9452145e7109835da2cd4918 /app/models/instance_configuration.rb | |
parent | 78e911431fc575ff4f6c9b7e0f95c02b57a5e926 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/instance_configuration.rb')
-rw-r--r-- | app/models/instance_configuration.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/instance_configuration.rb b/app/models/instance_configuration.rb index 29bf1b8ae5d..09a60e9dd10 100644 --- a/app/models/instance_configuration.rb +++ b/app/models/instance_configuration.rb @@ -14,6 +14,7 @@ class InstanceConfiguration host: host, gitlab_pages: gitlab_pages, gitlab_ci: gitlab_ci, + package_file_size_limits: package_file_size_limits, rate_limits: rate_limits }.deep_symbolize_keys end end @@ -44,6 +45,22 @@ class InstanceConfiguration default: 100.megabytes }) end + def package_file_size_limits + Plan.all.to_h { |plan| [plan.name.capitalize, plan_file_size_limits(plan)] } + end + + def plan_file_size_limits(plan) + { + conan: plan.actual_limits[:conan_max_file_size], + maven: plan.actual_limits[:maven_max_file_size], + npm: plan.actual_limits[:npm_max_file_size], + nuget: plan.actual_limits[:nuget_max_file_size], + pypi: plan.actual_limits[:pypi_max_file_size], + terraform_module: plan.actual_limits[:terraform_module_max_file_size], + generic: plan.actual_limits[:generic_packages_max_file_size] + } + end + def rate_limits { unauthenticated: { |