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.wip/yesman
parent
30891166be
commit
bcfa59bf82
@ -1,23 +0,0 @@ |
||||
{ stdenv, fetchgit, git, go }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
version = "0.2.14"; |
||||
name = "gitlab-git-http-server-${version}"; |
||||
|
||||
srcs = fetchgit { |
||||
url = "https://gitlab.com/gitlab-org/gitlab-git-http-server.git"; |
||||
rev = "7c63f08f7051348e56b903fc0bbefcfed398fc1c"; |
||||
sha256 = "557d63a90c61371598b971a06bc056993610b58c2ef5762d9ef145ec2fdada78"; |
||||
}; |
||||
|
||||
buildInputs = [ git go ]; |
||||
|
||||
buildPhase = '' |
||||
make PREFIX=$out |
||||
''; |
||||
|
||||
installPhase = '' |
||||
mkdir -p $out/bin |
||||
make install PREFIX=$out |
||||
''; |
||||
} |
@ -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
|
@ -0,0 +1,26 @@ |
||||
{ stdenv, fetchFromGitLab, git, go }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
version = "0.6.4"; |
||||
name = "gitlab-workhorse-${version}"; |
||||
|
||||
srcs = fetchFromGitLab { |
||||
owner = "gitlab-org"; |
||||
repo = "gitlab-workhorse"; |
||||
rev = version; |
||||
sha256 = "09bs3kdmqi6avdak2nqma141y4fhfv050zwqqx7qh9a9hgkgwjxw"; |
||||
}; |
||||
|
||||
buildInputs = [ git go ]; |
||||
|
||||
patches = [ ./remove-hardcoded-paths.patch ]; |
||||
|
||||
buildPhase = '' |
||||
make PREFIX=$out |
||||
''; |
||||
|
||||
installPhase = '' |
||||
mkdir -p $out/bin |
||||
make install PREFIX=$out |
||||
''; |
||||
} |
@ -0,0 +1,12 @@ |
||||
diff --git a/internal/git/command.go b/internal/git/command.go
|
||||
index 0e5496c..5778294 100644
|
||||
--- a/internal/git/command.go
|
||||
+++ b/internal/git/command.go
|
||||
@@ -16,6 +16,7 @@ func gitCommand(gl_id string, name string, args ...string) *exec.Cmd {
|
||||
cmd.Env = []string{
|
||||
fmt.Sprintf("HOME=%s", os.Getenv("HOME")),
|
||||
fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
|
||||
+ fmt.Sprintf("GITLAB_SHELL_CONFIG_PATH=%s", os.Getenv("GITLAB_SHELL_CONFIG_PATH")),
|
||||
fmt.Sprintf("LD_LIBRARY_PATH=%s", os.Getenv("LD_LIBRARY_PATH")),
|
||||
fmt.Sprintf("GL_ID=%s", gl_id),
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@ |
||||
index acd1874..f493451 100644
|
||||
--- a/Gemfile
|
||||
+++ b/Gemfile
|
||||
@@ -318,3 +318,5 @@ gem 'oauth2', '~> 1.0.0'
|
||||
|
||||
# Soft deletion
|
||||
gem "paranoia", "~> 2.0"
|
||||
+
|
||||
+gem "activerecord-nulldb-adapter"
|
||||
index 14d2c76..7a010f0 100644
|
||||
--- a/Gemfile.lock
|
||||
+++ b/Gemfile.lock
|
||||
@@ -34,6 +34,8 @@ GEM
|
||||
activesupport (= 4.2.5.1)
|
||||
arel (~> 6.0)
|
||||
activerecord-deprecated_finders (1.0.4)
|
||||
+ activerecord-nulldb-adapter (0.3.2)
|
||||
+ activerecord (>= 2.0.0)
|
||||
activerecord-session_store (0.1.2)
|
||||
actionpack (>= 4.0.0, < 5)
|
||||
activerecord (>= 4.0.0, < 5)
|
||||
@@ -880,6 +882,7 @@ DEPENDENCIES
|
||||
RedCloth (~> 4.2.9)
|
||||
ace-rails-ap (~> 2.0.1)
|
||||
activerecord-deprecated_finders (~> 1.0.3)
|
||||
+ activerecord-nulldb-adapter
|
||||
activerecord-session_store (~> 0.1.0)
|
||||
acts-as-taggable-on (~> 3.4)
|
||||
addressable (~> 2.3.8)
|
Loading…
Reference in new issue