diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-08-01 09:47:14 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-09-07 12:27:35 -0500 |
commit | 007b81b8e298269bfdc5cac61bc11ae21b3825a5 (patch) | |
tree | 385debb0ca13ae715590388d5584cdf2ea0866c1 /lib/api/internal.rb | |
parent | 9083fc04f1add6f7e4628cdb10fef69c6b815ef5 (diff) | |
download | gitlab-ce-007b81b8e298269bfdc5cac61bc11ae21b3825a5.tar.gz |
Add receive_max_input_size setting to Application settings
If user has configure the setting then it will be passed to gitlab-shell
and gitlab-workhorse
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r-- | lib/api/internal.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 0990e2a1fba..e3e8cb71c09 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -74,6 +74,7 @@ module API gl_repository: gl_repository, gl_id: Gitlab::GlId.gl_id(user), gl_username: user&.username, + git_config_options: [], # This repository_path is a bogus value but gitlab-shell still requires # its presence. https://gitlab.com/gitlab-org/gitlab-shell/issues/135 @@ -81,6 +82,13 @@ module API gitaly: gitaly_payload(params[:action]) } + + # Custom option for git-receive-pack command + receive_max_input_size = Gitlab::CurrentSettings.receive_max_input_size.to_i + if receive_max_input_size > 0 + payload[:git_config_options] << "receive.maxInputSize=#{receive_max_input_size.megabytes}" + end + response_with_status(**payload) when ::Gitlab::GitAccessResult::CustomAction response_with_status(code: 300, message: check_result.message, payload: check_result.payload) |