summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
Commit message (Collapse)AuthorAgeFilesLines
* Print console messages to $stderr if present9217-warn-on-git-fetch-over-ssh-if-the-secondary-is-lagging-the-primaryAsh McKenzie2019-04-041-0/+2
| | | | Using ConsoleHelper::write_stderr
* Use write_stderr instead of $stderr.putsAsh McKenzie2019-04-041-4/+7
|
* Add support for using gl_project_pathsh-use-gl-project-pathStan Hu2019-02-161-1/+3
| | | | | | This will enable us to track the human-readable project path with SSH access in gitlab-shell. Currently the Gitaly logs will only show the hashed storage and gl_repository path (e.g. project-1234).
* Make better use of constants in lib/gitlab_shell.rbJacob Vosmaer2018-12-211-5/+5
|
* Revert "Merge branch 'sh-bump-ruby-version' into 'master'"Douwe Maan2018-12-131-8/+6
| | | This reverts merge request !257
* Upgrade to Ruby 2.5.3Stan Hu2018-12-131-6/+8
|
* Include LFS operation when making auth requestashmckenzie/8114-geo-push-ssh-lfs-http-auth-bugAsh McKenzie2018-11-081-4/+5
| | | | Operation is either upload or download
* Display helpful feedback when proxying an SSH git push to secondary request ↵Ash McKenzie2018-09-251-2/+3
| | | | (v2)
* Custom Action supportash.mckenzie/custom-action-supportAsh McKenzie2018-09-081-11/+27
|
* Use constants for git commands in GitlabShellAsh McKenzie2018-09-071-6/+11
|
* Clean up cmd_exec execution environmentZeger-Jan van de Weg2018-08-241-63/+16
| | | | | | | | | | | Given the gitaly-* now proxy the data from the client to the Gitaly server, the environment variables aren't used. Therefor we don't have to set them either. Only exception to the rule, is the GITALY_TOKEN. These changes also remove the `GIT_TRACE` options, introduced by 192e2bd367494bf66746c8971896a2d9cb84fc92. Part of: https://gitlab.com/gitlab-org/gitaly/issues/1300
* Remove non Gitaly code pathsZeger-Jan van de Weg2018-08-201-23/+23
| | | | | | | All shell access goes through Gitaly, so dead code paths exist to support the legacy way too. This change mostly removes the dead code from `#process_cmd`.
* Remove repo_path from GitlabShellzj-remove-repo-pathZeger-Jan van de Weg2018-08-161-10/+1
| | | | | | | | | | | | | | | The internal api returns '/' from gitlab, since `8fad07383ada021fc995294fd0fe0f77fe37da35` from GitLab CE. To clean up later, https://gitlab.com/gitlab-org/gitlab-shell/issues/135 was created. This change closes that issue, making it possible to remove the field from the response on GitLab-CE too. Given the Rails app always returns `/` as the repository_path, the associated checks are basically a noop too. The tests are updated and at times look a little fishy, but those are testing code that is to be removed in another MR. Closes https://gitlab.com/gitlab-org/gitlab-shell/issues/135
* Merge remote-tracking branch 'upstream/8-1-stable' into ↵Nick Thomas2018-08-141-1/+1
|\ | | | | | | 148-merge-8-1-1-to-master
| * Guard discovery by username or key against bad API responsesNick Thomas2018-08-091-1/+1
| |
| * Fix two regressions in SSH certificate supportÆvar Arnfjörð Bjarmason2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two regressions in my 2e8b670 ("Add support for SSH certificate authentication", 2018-06-14) merged in gitlab-org/gitlab-shell!207. This fixes the issue noted in gitlab-org/gitlab-shell#145 where the command-line contains things other than the key/user/username, and also a regression where SSH certificates are being used, and the username presented in the key is unknown to GitLab. In that case, we should log the user in as "Anonymous" (on an instance that allows public access), but because of how the error checking around api.discover() was implemented we ended up erroring out instead.
| * use GIT_PROTOCOL env variable in gitlab_shell#execJames Lopez2018-08-011-1/+1
| |
| * update gitlab shell to remove git_protocol env varJames Lopez2018-08-011-1/+0
| |
| * Add Git protocol v2James Lopez2018-08-011-2/+5
| |
* | Restore "Pass custom git_config_options to Gitalyo"Nick Thomas2018-08-141-0/+2
| | | | | | | | This reverts commit 764f6f47fa6a8698ae033532ae49875a87030518.
* | Revert "Merge branch 'ash.mckenzie/srp-refactor' into 'master'"Nick Thomas2018-08-141-64/+243
| | | | | | | | | | This reverts commit 3aaf4751e09262c53544a1987f59b1308af9b6c1, reversing changes made to c6577e0d75f51b017f2f332838b97c3ca5b497c0.
* | Typo fixAsh McKenzie2018-08-081-1/+1
| |
* | Update Actor::Username, add specsAsh McKenzie2018-08-011-1/+1
| |
* | Merge remote-tracking branch 'origin/master' into ash.mckenzie/srp-refactorAsh McKenzie2018-08-011-15/+11
|\ \ | |/
| * Add support for SSH certificate authenticationÆvar Arnfjörð Bjarmason2018-07-261-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This along with the code submitted to gitlab-ce in the gitlab-org/gitlab-ce! MR implements SSH certificate authentication. See the docs added to gitlab-ce for why and how to enable this. This, along with that MR, closes gitlab-org/gitlab-ce#3457 Implementation notes: - Because it's easy to do, and because an earlier nascent version of this would pass user-ID to gitlab-shell, that's now supported, even though the SSH certificate authentication uses username-USERNAME. - The astute reader will notice that not all the API calls in gitlab-ce's lib/api/internal.rb support a "username" argument, some only support "user_id". There's a few reasons for this: a) For this to be efficient, I am bending over backwards to avoid extra API calls when using SSH certificates. Therefore the /allowed API call will now return a "user id" to us if we're allowed to proceed further. This is then fed to existing APIs that would only be called after a successful call to /allowed. b) Not all of the git-shell codepaths go through /internal/allowed, or ever deal with a repository, e.g. the argument-less "Welcome to GitLab", and /internal/2fa_recovery_codes. These need to use /internal/discover to figure out details about the user, so support looking that up by username. c) Once we have the "user id", the GL_ID gets passed down to e.g. user-authored hooks. I don't want to have those all break by having to handle a third GL_ID mode of "username" in addition to the current "key id" and "user id".
* | Use Struct::ParsedCommand to keep vars closeAsh McKenzie2018-08-011-13/+21
| |
* | Use actor when we don't know if it's a Key or UserAsh McKenzie2018-08-011-13/+13
| | | | | | | | | | | | * Use gl_id when we don't know if it's a key-X or user-X * Use Actor.new_from(gl_id) which will figure out if it's a Key or User * Use key_str when we're referring to key-X as key_id is confusing
* | Utilise new ActionsAsh McKenzie2018-08-011-210/+47
| | | | | | | | | | | | | | | | | | | | * Move gitaly, git-lfs and 2FA logic out from gitlab_shell.rb * Streamline parsing of origin_cmd in GitlabShell * Utilise proper HTTP status codes sent from the API * Also support 200 OK with status of true/false (ideally get rid of this) * Use HTTP status constants * Use attr_reader definitions (var over @var) * Rspec deprecation fixes
* | Tidy up GitlabShellAsh McKenzie2018-08-011-7/+12
| | | | | | | | | | * Use constants for git commands * private instead of protected
* | Move common exceptions into errors.rbAsh McKenzie2018-08-011-3/+0
| |
* | Move GL_PROTOCOL into GitlabNetAsh McKenzie2018-07-301-3/+2
|/
* Bump version to 7.1.3bvl-display-username-instead-of-fullnameBob Van Landuyt2018-05-241-1/+7
|
* Display the username instead of fullnameBob Van Landuyt2018-05-231-2/+2
| | | | | | | | When running `ssh git@gitlab.example.com` we used to reply with the full name. But it might actually be more useful to display the username. This is unique and can help support identifying issues. Closes #131
* Add Gitaly git-upload-archive migrated commandgitaly-upload-archiveAlejandro Rodríguez2018-03-201-0/+1
|
* Switch to structured loggingJacob Vosmaer (GitLab)2018-03-191-8/+6
|
* Update files to pass modern rubocop checks. Disable some of themdz-update-depsDmitriy Zaporozhets2018-02-221-11/+11
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Update rubocop and code to pass itDmitriy Zaporozhets2018-02-221-2/+2
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Remove special case treatment of Geo nodes for SSHStan Hu2018-01-121-9/+1
| | | | | | | We removed SSH support in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3553, so we no longer need the ability to show all refs for Geo nodes. Closes #115
* pass gl_username through to hooksDavid Turner2017-09-281-3/+6
|
* Fix SSH support for Git for Windows v2.14sh-fix-git-upload-packStan Hu2017-08-061-3/+12
| | | | | | | Git For Windows 2.14 has a patch that changes `git-upload-pack` to `git upload-pack`. To make this work for gitlab-shell, just map this to `git-upload-pack`. Closes gitlab-org/gitlab-ce#36028
* Use git_config_options instead of git_config_parameters for Gitaly requestssh-support-gitaly-upload-pack-unhide-refsStan Hu2017-08-031-7/+10
|
* Support unhiding of all refs for Geo NodesStan Hu2017-07-211-1/+6
| | | | | | By default, we hide certain refs (e.g. keep-around/XXX) to save user download time. We need to preserve these references on secondary Geo nodes to have a true copy.
* no more single-value mergeKim "BKC" Carlbäcker2017-07-071-3/+1
|
* metrics makes no sense because 'exec'Kim "BKC" Carlbäcker2017-07-071-4/+2
|
* hashes have .include? not .has?Kim "BKC" Carlbäcker2017-07-071-1/+1
|
* type-oKim "BKC" Carlbäcker2017-07-061-1/+1
|
* We need metrics loggingKim "BKC" Carlbäcker2017-07-061-2/+4
|
* no more attrsKim "BKC" Carlbäcker2017-07-061-1/+1
|
* - Update gitaly vendoringKim "BKC" Carlbäcker2017-07-031-4/+11
| | | | | - Wire up gitaly-*-pack to Gitaly. Don't pass git-*-pack to go - Disable tests for go1.5 & 1.6
* Make gitaly executable mapping clearergo-wrappersJacob Vosmaer2017-05-231-8/+12
|