added ebuild and patches for gitlab-shell-1.9.3

This commit is contained in:
Manuel Friedli 2014-05-18 18:01:40 +02:00
parent 9d04c5fddd
commit d5533d34de
5 changed files with 228 additions and 0 deletions

View file

@ -0,0 +1,39 @@
--- a/support/rewrite-hooks.sh 2013-08-26 11:59:22.000000000 +0200
+++ b/support/rewrite-hooks.sh 2013-09-10 21:31:30.135841009 +0200
@@ -1,13 +1,14 @@
#!/bin/bash
# $1 is an optional argument specifying the location of the repositories directory.
-# Defaults to /home/git/repositories if not provided
+# If no argument is provided then path is readed from /etc/gitlab-shell.yml
-home_dir="/home/git"
-src=${1:-"$home_dir/repositories"}
+base_path="$(realpath `dirname $(readlink -f "$0")`/..)"
+repos_path="$(ruby -ryaml -e 'puts YAML::load_file("/etc/gitlab-shell.yml")["repos_path"]')"
+src=${1:-"$repos_path"}
function create_link_in {
- ln -s -f "$home_dir/gitlab-shell/hooks/update" "$1/hooks/update"
+ ln -s -f "$base_path/hooks/update" "$1/hooks/update"
}
for dir in `ls "$src/"`
--- a/support/truncate_repositories.sh 2013-08-26 11:59:22.000000000 +0200
+++ b/support/truncate_repositories.sh 2013-09-10 21:31:30.135841009 +0200
@@ -1,12 +1,12 @@
#!/bin/bash
-home_dir="/home/git"
+repos_path="$(ruby -ryaml -e 'puts YAML::load_file("/etc/gitlab-shell.yml")["repos_path"]')"
echo "Danger!!! Data Loss"
while true; do
- read -p "Do you wish to delete all directories (except gitolite-admin.git) from $home_dir/repositories/ (y/n) ?: " yn
+ read -p "Do you wish to delete all directories (except gitolite-admin.git) from $repos_path (y/n) ?: " yn
case $yn in
- [Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
+ [Yy]* ) sh -c "find $repos_path/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac

View file

@ -0,0 +1,21 @@
--- a/lib/gitlab_config.rb
+++ b/lib/gitlab_config.rb
@@ -53,7 +53,7 @@ class GitlabConfig
if redis.has_key?("socket")
%W(#{redis['bin']} -s #{redis['socket']})
else
- %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']})
+ %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']} -n #{redis['db']})
end
end
end
--- a/config.yml.example
+++ b/config.yml.example
@@ -25,6 +25,7 @@ redis:
bin: /usr/bin/redis-cli
host: 127.0.0.1
port: 6379
+ # db: 0
# socket: /tmp/redis.socket # Only define this if you want to use sockets
namespace: resque:gitlab

View file

@ -0,0 +1,40 @@
--- config.yml.example.orig 2014-04-03 17:20:56.000000000 +0200
+++ config.yml.example 2014-05-18 17:52:54.290000000 +0200
@@ -15,10 +15,10 @@
# Give the canonicalized absolute pathname,
# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
# Check twice that none of the components is a symlink, including "/home".
-repos_path: "/home/git/repositories"
+repos_path: "/var/lib/git/repositories"
# File used as authorized_keys for gitlab user
-auth_file: "/home/git/.ssh/authorized_keys"
+auth_file: "/var/lib/git/.ssh/authorized_keys"
# Redis settings used for pushing commit notices to gitlab
redis:
@@ -30,7 +30,7 @@
# Log file.
# Default is gitlab-shell.log in the root directory.
-# log_file: "/home/git/gitlab-shell/gitlab-shell.log"
+# log_file: "/var/log/gitlab/gitlab-shell.log"
# Log level. INFO by default
log_level: INFO
--- lib/gitlab_config.rb.orig 2014-05-18 17:48:34.660000000 +0200
+++ lib/gitlab_config.rb 2014-05-18 17:51:15.690000000 +0200
@@ -8,11 +8,11 @@
end
def repos_path
- @config['repos_path'] ||= "/home/git/repositories"
+ @config['repos_path'] ||= "/var/lib/git/repositories"
end
def auth_file
- @config['auth_file'] ||= "/home/git/.ssh/authorized_keys"
+ @config['auth_file'] ||= "/var/lib/git/.ssh/authorized_keys"
end
def gitlab_url