Commit Graph

58 Commits

Author SHA1 Message Date
Jacob Vosmaer 6bcc52a536 Refine Git garbage collection 2016-11-04 14:30:11 +01:00
Grzegorz Bizon cfd0d66c83 Reassign secret token when regenerating one 2016-10-13 10:04:58 +02:00
Justin DiPierro fe46e4eb35 Load Github::Shell's secret token from file on initialization instead of every request. 2016-10-06 11:22:37 -04:00
Jacob Vosmaer 67ec96e3e0 Strip comments before sending keys to gitlab-shell
Avoid issues with text encoding by not sending out non-7-bit ASCII
text.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22167
2016-09-16 11:49:11 +02:00
Elan Ruusamäe ab43e9c1f9 update gitlab shell secret file also when it is empty 2016-09-13 09:38:51 +03:00
Alejandro Rodríguez 1dcfb1d3a7 Fix a bug where forking a project from a repository storage to another would fail 2016-07-26 17:22:13 -04:00
Alejandro Rodríguez 20b9bb2029 Create (if necessary) and link the gitlab-shell secret file on the rake install task 2016-06-29 22:30:33 -04:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Connor Shea 9cc0937b3a Enable the Rubocop DeprecatedClassMethods cop
This reports uses of `File.exists?` and `Dir.exists?`, which were both
deprecated in Ruby and will eventually be removed in favor of
`.exist?`. Also fixes all existing uses of the deprecated methods.
2016-05-08 15:33:34 -06:00
Rémy Coutable 44f89eafc0 Use Rugged's TagCollection#create instead of gitlab-shell's Repository#add_tag for better performance
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-04 17:19:13 +02:00
Robert Speicher 34b0561560 Merge branch 'pmq20/gitlab-ce-psvr/change-head' into 'master'
Use rugged to change HEAD

_Originally opened at !2850 by @pmq20._

Needless to invoke gitlab_shell here, which is slow.

See merge request !3705
2016-04-15 16:44:21 +00:00
Rémy Coutable 8b7bf2a0e0 Merge branch 'rugged-delete-tag' into 'master'
Delete tags via rugged

Improve the performance by directly using rugged instead of shelling out to a git operation.

See merge request !3748
2016-04-15 14:42:05 +00:00
Robert Schilling 3c704c33e0 Delete tags via rugged 2016-04-15 16:05:04 +02:00
Robert Schilling 106c443e76 Remove unused backend methods 2016-04-15 13:30:33 +02:00
Rémy Coutable f8e8a61c9c
Remove Gitlab::Shell#update_repository_head since it's not used anymore
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-15 11:38:59 +02:00
Drew Blessing 5f38dbc026 Increase project import timeout from 4 minutes to 15 minutes
Many users were experiencing timeouts when we only allowed
4 minutes before a timeout. A 15 minute timeout is more
than reasonable and prevents us from having to add a
configuration for this.

Fixes gitlab-org/gitlab-ee#246
2016-02-04 13:41:42 -06:00
James Lopez ecb174bfea fixed move project method in migration 2016-02-02 17:28:14 +01:00
Jeroen Nijhof 9b28220f88 Merge gitlab.com:gitlab-org/gitlab-ce 2016-01-06 14:55:44 +01:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Douwe Maan 841a7c6897 Store and show reason why import failed. 2015-11-18 12:00:56 +01:00
Jeroen Nijhof 4f0a38f1a8 Added housekeeping for git repositories 2015-10-21 15:15:54 +02:00
Robert Speicher 69b41ba043 Normalize space-like characters in keys before output to gitlab-shell
gitlab-shell expects only one tab separator per key, and an SSH key with
a tab character in the comment, for example, would break things.

Closes #2970
2015-10-08 20:34:50 -04:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 9f10943c1a
Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets a87989fb7d Remove satellites 2015-07-15 15:45:57 +02:00
Dmitriy Zaporozhets 97ff86e07c Move repository when project is removed
Ths commit does next:

* When we remove project we move repository to path+deleted.git
* Then we schedule removal of path+deleted with sidekiq
* If repository move failed we abort project removal

This should help us with NFS issue when project get removed but
repository stayed. The full explanation of problem is below:

* rm -rf project.git
* rm -rf removes project.git/objects/foo
* NFS server renames foo to foo.nfsXXXX because some NFS client (think
* Unicorn) still has the file open
* rm -rf exits, but project.git/objects/foo.nfsXXX still exists
* Unicorn closes the file, the NFS client closes the file (foo), and the
* NFS server removes foo.nfsXXX
* the directory project.git/objects/ still exists => problem

So now we move repository and even if repository removal failed

Repository directory is moved so no bugs with project removed but
repository directory taken. User still able to create new project with
same name. From administrator perspective you can easily find stalled
repositories by searching `*+deleted.git`

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 13:05:43 +02:00
Douwe Maan f915a4b80f Warn when gitlab-shell version doesn't match requirement. 2015-04-06 14:02:49 +02:00
Dmitriy Zaporozhets f7bf892cca Revert "gitlab shell works if multiple rubies installed"
This reverts commit 533f4cdf30.
2014-11-18 17:14:36 +02:00
Ciro Santilli 533f4cdf30 gitlab shell works if multiple rubies installed
Before this it would fail because git hooks automatically prepend
things to the path, which can lead the wrong Ruby version to be called
in which dependencies are not installed.

To make sure that this is correct, the forked_merge_requests commented
out test that depends on this change was uncommented.

For that test to pass, it is also necessary to setup the mock server
on port 3001 under test_env.rb.
2014-11-18 11:38:23 +01:00
Ciro Santilli f36db59d97 Factor GITLAB_SHELL_VERSION get method 2014-11-05 17:16:04 +01:00
Ciro Santilli 0b1084a453 Don't output to stdout from lib non-interactive methods
It pollutes the test output too much.
2014-11-05 12:35:33 +01:00
Ciro Santilli d549a2a525 Factor lib backend gitlab shell path 2014-10-31 13:00:50 +01:00
Ciro Santilli 2e9f5de868 Add parenthesis to function def with arguments. 2014-10-03 09:18:46 +02:00
Sean Edge 468b2e8e0b Added annotated tags. Updated tag haml file and call to gitlab-shell. Updated API for annotated tags. Added tests for API. Strip leading/trailing whitespace from message, if present. Update CHANGELOG. 2014-09-04 09:47:20 -04:00
Dmitriy Zaporozhets 4535db04b2
Increase import timeout from 2 to 4 minutes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-11 20:58:39 +03:00
Jacob Vosmaer 779fa4a7b7 Use batch_add_keys in `rake gitlab🐚setup` 2014-03-14 15:49:11 +01:00
Dmitriy Zaporozhets f1c82bc56c
Add gitlab-shell#path option in config
Before this commit gitlab-shell but me placed directly in home dir.
Ex:
  /home/git/gitlab-shell

After this change you can place gitlab-shell in custom location.
Ex:
  /Users/developer/gitlab/gitlab-shell

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-09 19:32:37 +02:00
Dmitriy Zaporozhets b07c02eb13
Add more info to admin dashboard
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-20 13:41:41 +02:00
Dmitriy Zaporozhets 592d1fabd6 Revert "Escape strings"
This reverts commit ce75f46bf7.
2013-11-01 16:29:28 +02:00
Dmitriy Zaporozhets 482a39abb0 Revert "Best to escape strings not split them"
This reverts commit aca7f56fef.
2013-11-01 16:25:06 +02:00
Nigel Kukard aca7f56fef Best to escape strings not split them
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2013-10-31 07:34:11 +00:00
Nigel Kukard ce75f46bf7 Escape strings
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2013-10-29 18:06:10 +00:00
Johannes Schleifenbaum cd19f82e51 Fix typos 2013-07-29 12:47:06 +02:00
Dmitriy Zaporozhets 475f607a22 Use gitlab-shell authorized_keys truncation. Fix issue with authorized_keys stored in different location 2013-07-18 13:55:01 +03:00
Dmitriy Zaporozhets 132caae734 Move repo tags to own controller. add ability to remove tags 2013-07-16 23:12:52 +03:00
Dmitriy Zaporozhets a466b2175a Add create_branch, rm_branch methods to Gitlab::Shell class 2013-07-16 22:18:14 +03:00
Dmitriy Zaporozhets 58427749fd Update repository head when change default project branch 2013-06-25 17:05:39 +03:00
Joe Andaverde ba21546a58 System calls were using unsanitized user input 2013-05-12 09:11:09 -05:00
Angus MacArthur ae33fdf297 updated fork feature to use gitlab-shell for v5 of gitlab 2013-04-15 01:54:52 -04:00
Dmitriy Zaporozhets c4299bb45a Move directory logic out of model. Use Gitlab:Shell class to interact with file system 2013-03-21 22:11:08 +02:00