gitlab: 8.0.5 -> 8.5.0, service improvements

Updates gitlab to the current stable version and fixes a lot of features that
were broken, at least with the current version and our configuration.

Quite a lot of sweat and tears has gone into testing nearly all features and
reading/patching the Gitlab source as we're about to deploy gitlab for our
whole company.

Things to note:

 * The gitlab config is now written as a nix attribute set and will be
   converted to JSON. Gitlab uses YAML but JSON is a subset of YAML.
   The `extraConfig` opition is also an attribute set that will be merged
   with the default config. This way *all* Gitlab options are supported.

 * Some paths like uploads and configs are hardcoded in rails  (at least
   after my study of the Gitlab source). This is why they are linked from
   the Gitlab root to /run/gitlab and then linked to the  configurable
   `statePath`.

 * Backup & restore should work out of the box from another Gitlab instance.

 * gitlab-git-http-server has been replaced by gitlab-workhorse upstream.
   Push & pull over HTTPS works perfectly. Communication to gitlab is done
   over unix sockets. An HTTP server is required to proxy requests to
   gitlab-workhorse over another unix socket at
   `/run/gitlab/gitlab-workhorse.socket`.

 * The user & group running gitlab are now configurable. These can even be
   changed for live instances.

 * The initial email address & password of the root user can be configured.

Fixes #8598.
This commit is contained in:
Franz Pletz
2016-01-30 14:47:04 +01:00
parent 30891166be
commit bcfa59bf82
14 changed files with 3741 additions and 3578 deletions

View File

@@ -1,19 +1,22 @@
{ stdenv, ruby, bundler, fetchgit }:
{ stdenv, ruby, bundler, fetchFromGitLab }:
stdenv.mkDerivation rec {
version = "2.1.0";
version = "2.6.10";
name = "gitlab-shell-${version}";
srcs = fetchgit {
url = "https://gitlab.com/gitlab-org/gitlab-shell.git";
rev = "ebbb9d80811c23d49a7d1b75d7a7d2b8ffe7437b";
sha256 = "fe69ab85d75a3871b4afa11ebc17f43008d135bbdbd6c581f6bebee2a4a3c75d";
srcs = fetchFromGitLab {
owner = "gitlab-org";
repo = "gitlab-shell";
rev = "v${version}";
sha256 = "1f1ma49xpkan2iksnw9amzjdw6i0bxnzdbsk0329m7if4987vcqd";
};
buildInputs = [
ruby bundler
];
patches = [ ./remove-hardcoded-locations.patch ];
installPhase = ''
mkdir -p $out/
cp -R . $out/

View File

@@ -0,0 +1,13 @@
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
index c1d175a..7f7fd2f 100644
--- a/lib/gitlab_projects.rb
+++ b/lib/gitlab_projects.rb
@@ -5,7 +5,7 @@ require_relative 'gitlab_config'
require_relative 'gitlab_logger'
class GitlabProjects
- GLOBAL_HOOKS_DIRECTORY = File.join(ROOT_PATH, 'hooks')
+ GLOBAL_HOOKS_DIRECTORY = ENV['GITLAB_SHELL_HOOKS_PATH'] || File.join(ROOT_PATH, 'hooks')
# Project name is a directory name for repository with .git at the end
# It may be namespaced or not. Like repo.git or gitlab/repo.git