Commit Graph

118 Commits

Author SHA1 Message Date
Ævar Arnfjörð Bjarmason e00a7faba0 Add support for SSH certificate authentication
Why and how to enable this is covered in the docs being changed
here. This requires gitlab-org/gitlab-shell@2e8b670 ("Add support for
SSH certificate authentication", 2018-06-14) which has been merged in
and tagged as 8.0.0, so GITLAB_SHELL_VERSION needs to be bumped.

Merging this closes gitlab-org/gitlab-ce#34572 see
gitlab-org/gitlab-shell!207 for the gitlab-shell MR.

Implementation notes:

 - The APIs being changed here are all internal, and their sole
   consumer is gitlab-shell.

 - Most of the changed code is a MR to gitlab-shell, see the
   gitlab-org/gitlab-shell!207 MR. That change covers why only some of
   the internal methods get a new "username" parameter, and why some
   others only get a "user_id".
2018-08-01 08:44:39 +02:00
Grzegorz Bizon cfdd80ec10 Merge branch 'zj-internal-repo-path' into 'master'
Don't pass the repository path to Gitlab Shell

See merge request gitlab-org/gitlab-ce!19011
2018-05-28 08:13:58 +00:00
Jacob Vosmaer 8fad07383a Return '/' as a bogus repo path to gitlab-shell 2018-05-25 13:58:22 +02:00
Rémy Coutable d50a80a282
Replace Gitlab::REVISION with Gitlab.revision and handle installations without a .git directory
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-05-24 10:14:01 +02:00
Zeger-Jan van de Weg a33d591602
Don't pass the repository path to Gitlab Shell
This isn't a requirement, and removes deprecated method calls
2018-05-17 15:19:32 +02:00
🙈 jacopo beschi 🙉 c6b1043e9d Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
Jacob Vosmaer (GitLab) b942462788 Remove support for absolute dirs from Git::Env 2018-03-30 09:19:46 +00:00
Nick Thomas 6b0c6e69e1
Use hashed storage in the specs 2018-02-07 13:40:46 +00:00
Tiago Botelho 1e56b3f476 Moves project creationg to git access check for git push 2018-02-06 16:52:29 +00:00
Tiago Botelho dc229c076c Abstracts ProjectMoved and ProjectCreated into a BaseProject 2018-02-06 13:35:35 +00:00
Tiago Botelho e42a548f1d Move new project on push logic to a service 2018-02-06 13:35:35 +00:00
Tiago Botelho bc78ae6985 Add specs 2018-02-06 13:35:35 +00:00
Tiago Botelho 32b2ff2601 Adds remote messsage when project is created in a push over SSH or HTTP 2018-02-06 13:35:35 +00:00
Tiago Botelho 35882e681b Adds option to push over SSH to create a new project 2018-02-06 13:35:35 +00:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Pablo Carranza ac86b2043d Backport authorized_keys branch 'find-key-by-fingerprint'
Add find key by base64 key or fingerprint to the internal API

See merge request !250

Squashed changes:
Add unique index to fingerprint
Add new index to schema
Add internal api to get ssh key by fingerprint
Change API endpoint to authorized_keys
Add InsecureKeyFingerprint that calculates the fingerprint without shelling out
Add require for gitlab key fingerprint
Remove uniqueness of fingerprint index
Remove unique option from migration
Fix spec style in fingerprint test
Fix rubocop complain
Extract insecure key fingerprint to separate file
Change migration to support building index concurrently
Remove those hideous tabs
2018-01-08 20:34:16 +00:00
Stan Hu 36bdf3dc9a Gracefully handle orphaned write deploy keys in /internal/post_receive
On GitLab.com, there are write deploy keys with no associated users.
Pushes with these deploy keys end with an Error 500 since we attempt
to look up redirect message. If there is no user, don't attempt
to display a redirect message.

Closes #41466
2017-12-24 09:39:08 -08:00
Mayra Cabrera 562fb460b8 Allow git pull/push on project redirects 2017-12-08 17:42:43 +00:00
Ahmad Sherif 52bfd06462 Use relative git object paths to construct absolute ones before setting Env 2017-11-14 20:26:39 +01:00
David Turner 01ce58bde4 add username to authorized result, so that gitlab-shell can pass it to hooks 2017-09-29 18:16:55 -04:00
James Lopez 67d06dee30 refactor users update service 2017-09-28 08:46:39 +02:00
James Lopez 9621dd0c9d refactor services to match EE signature 2017-09-28 08:46:39 +02:00
Alejandro Rodríguez ff3eeffa08 Implement /internal/pre-receive for shell operations 2017-09-05 20:12:25 -03:00
Alejandro Rodríguez 8323e55b6c Return a value to check if redis is available on /internal/check 2017-09-05 20:12:18 -03:00
Alejandro Rodríguez eaf60bb544 Implement /internal/post_receive unified endpoint for PostReceive tasks 2017-08-31 11:31:45 -03:00
Andrew Newdigate a89f18bf2c Renamed Gitaly services 2017-07-18 07:59:36 +00:00
Stan Hu 0e23d1a74f Handle case when BroadcastMessage.current is nil
Somehow Rails.cache.fetch occasionally returns `nil` values, which causes
this endpoint to crash.

Closes #35094
2017-07-13 21:38:26 -07:00
Kim "BKC" Carlbäcker 8b074b4e78 Send Gitaly Repository with /api/internal/allowed
- Make single gitaly payload
- Add feature-flag specs to verify payload
2017-07-07 22:24:16 +02:00
James Lopez b33c638483 update code based on feedback 2017-06-23 17:11:31 +02:00
James Lopez b804db2648 refactor update user service not to do auth checks 2017-06-23 11:41:43 +02:00
James Lopez c9fd3dc42c more refactoring based on feedback 2017-06-23 11:41:42 +02:00
James Lopez 158550cf37 added service in the rest of controllers and classes 2017-06-23 11:41:42 +02:00
Matt Walsh 02ad2841d8 Allow discover by userid - issue 28517 2017-06-20 08:53:28 -06:00
Michael Kozono af784cc6e2 Add “Project moved” error to Git-over-SSH 2017-06-16 14:14:19 -07:00
Mike Ricketts 03b2ac659e #13336 - display multiple messages in both the UI and git output 2017-06-15 13:47:33 +00:00
Michael Kozono ef4e913597 Remove unnecessary variable 2017-06-05 10:39:32 -07:00
Michael Kozono b50a22894d Refactor construction of response 2017-06-05 05:32:26 -07:00
Michael Kozono 23d37382da Refactor to let GitAccess errors bubble up
No external behavior change.

This allows `GitHttpController` to set the HTTP status based on the type of error. Alternatively, we could have added an attribute to GitAccessStatus, but this pattern seemed appropriate.
2017-06-05 05:32:26 -07:00
Alejandro Rodríguez de33a5bd53 Prevent errors from non-functional notify_post_receive endpoint 2017-05-18 15:33:43 -04:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Alejandro Rodríguez 8bc381db90 Pass GL_REPOSITORY in Workhorse responses 2017-05-05 10:52:06 -03:00
Alejandro Rodríguez c45341c816 Generate and handle a gl_repository param to pass around components
This new param allows us to share project information between components
that don't share or don't have access to the same filesystem
mountpoints, for example between Gitaly and Rails or between Rails and
Gitlab-Shell hooks. The previous parameters are still supported, but if
found, gl_repository is prefered. The old parameters should be deprecated
once all components support the new format.
2017-05-03 17:37:30 -03:00
Luigi Leoni 615a77df83 Wrong method call on notify_post_receive. 2017-04-27 09:33:48 +02:00
Sean McGivern 380e40fee3 Remove unused user activities code 2017-04-14 15:20:55 +02:00
James Lopez 2951a8543e Add user activity service and spec. Also added relevant - NOT offline - migration
It uses a user activity table instead of a column in users.
Tested with mySQL and postgreSQL
2017-04-14 15:20:55 +02:00
Rémy Coutable 710cd82cc1 Set Git-specific env in /api/internal/allowed
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-10 16:10:18 +02:00
Jacob Vosmaer 20d415a676 Use Gitlab::Git::Repository#gitaly_... more 2017-04-07 12:53:30 +02:00
Alejandro Rodríguez 267cd3e359 Incorporate Gitaly client for refs service 2017-04-04 16:53:44 +02:00
Jacob Vosmaer 8f50ef5e75 Separate GRPC channels per repository storage 2017-03-29 14:48:05 +02:00
Alejandro Rodríguez f8fa6e6f47 Add internal endpoint to notify post-receive to Gitaly 2017-03-01 18:46:59 -03:00