diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-08-01 17:47:14 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-09-07 20:27:35 +0300 |
commit | 007b81b8e298269bfdc5cac61bc11ae21b3825a5 (patch) | |
tree | 385debb0ca13ae715590388d5584cdf2ea0866c1 /lib/gitlab/workhorse.rb | |
parent | 9083fc04f1add6f7e4628cdb10fef69c6b815ef5 (diff) |
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/gitlab/workhorse.rb')
-rw-r--r-- | lib/gitlab/workhorse.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb index a9629a92a50..30a8c3578d8 100644 --- a/lib/gitlab/workhorse.rb +++ b/lib/gitlab/workhorse.rb @@ -22,18 +22,27 @@ module Gitlab project = repository.project - { + attrs = { GL_ID: Gitlab::GlId.gl_id(user), GL_REPOSITORY: Gitlab::GlRepository.gl_repository(project, is_wiki), GL_USERNAME: user&.username, ShowAllRefs: show_all_refs, Repository: repository.gitaly_repository.to_h, RepoPath: 'ignored but not allowed to be empty in gitlab-workhorse', + GitConfigOptions: [], GitalyServer: { address: Gitlab::GitalyClient.address(project.repository_storage), token: Gitlab::GitalyClient.token(project.repository_storage) } } + + # 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 + attrs[:GitConfigOptions] << "receive.maxInputSize=#{receive_max_input_size.megabytes}" + end + + attrs end def send_git_blob(repository, blob) |