summary refs log tree commit diff
path: root/pkgs/applications/version-management/gitlab-shell
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2018-03-19 21:52:36 +0100
committerRobin Gloster <mail@glob.in>2018-03-22 02:29:27 +0100
commit31d77fd4f3d009631e0dc4361bfc0648fadcce4a (patch)
treefee8f4637472b6e887b50c2ed32e65da9bdd3257 /pkgs/applications/version-management/gitlab-shell
parentfa347164b607df52768fd952d56bd42a90fc9a6a (diff)
downloadnixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.tar
nixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.tar.gz
nixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.tar.bz2
nixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.tar.lz
nixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.tar.xz
nixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.tar.zst
nixlib-31d77fd4f3d009631e0dc4361bfc0648fadcce4a.zip
gitlab-shell: fix config path finding
and remove TimeoutSec for gitlab
Diffstat (limited to 'pkgs/applications/version-management/gitlab-shell')
-rw-r--r--pkgs/applications/version-management/gitlab-shell/default.nix26
-rw-r--r--pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch2
2 files changed, 4 insertions, 24 deletions
diff --git a/pkgs/applications/version-management/gitlab-shell/default.nix b/pkgs/applications/version-management/gitlab-shell/default.nix
index ab0ff74f03f5..2d013ff70944 100644
--- a/pkgs/applications/version-management/gitlab-shell/default.nix
+++ b/pkgs/applications/version-management/gitlab-shell/default.nix
@@ -30,29 +30,9 @@ stdenv.mkDerivation rec {
   # code by default which doesn't work in nixos because it's a
   # read-only filesystem
   postPatch = ''
-    substituteInPlace lib/gitlab_config.rb --replace\
-       "File.join(ROOT_PATH, 'config.yml')"\
-       "ENV['GITLAB_SHELL_CONFIG_PATH']"
-
-    # Note that we're running gitlab-shell from current-system/sw
-    # because otherwise updating gitlab-shell won't be reflected in
-    # the hardcoded path of the authorized-keys file:
-    substituteInPlace lib/gitlab_keys.rb --replace\
-        "\"#{ROOT_PATH}/bin/gitlab-shell"\
-        "\"GITLAB_SHELL_CONFIG_PATH=#{ENV['GITLAB_SHELL_CONFIG_PATH']} /run/current-system/sw/bin/gitlab-shell"
-
-    # We're setting GITLAB_SHELL_CONFIG_PATH in the ssh authorized key
-    # environment because we need it in gitlab_configrb
-    # . unsetenv_others will remove that so we're not doing it for
-    # now.
-    #
-    # TODO: Are there any security implications? The commit adding
-    # unsetenv_others didn't mention anything...
-    #
-    # Kernel::exec({'PATH' => ENV['PATH'], 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], 'GL_ID' => ENV['GL_ID']}, *args, unsetenv_others: true)
-    substituteInPlace lib/gitlab_shell.rb --replace\
-        " *args, unsetenv_others: true)"\
-        " *args)"
+    substituteInPlace lib/gitlab_config.rb --replace \
+       "File.join(ROOT_PATH, 'config.yml')" \
+       "'/run/gitlab/shell-config.yml'"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch
index f28e74b88c50..d0e555b33df9 100644
--- a/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch
+++ b/pkgs/applications/version-management/gitlab-shell/remove-hardcoded-locations.patch
@@ -34,7 +34,7 @@ index c57b4de..88cfc95 100644
  	cfg.RootDir = dir
  
 -	configBytes, err := ioutil.ReadFile(path.Join(cfg.RootDir, configFile))
-+	configBytes, err := ioutil.ReadFile(os.Getenv("GITLAB_SHELL_CONFIG_PATH"))
++	configBytes, err := ioutil.ReadFile("/run/gitlab/shell-config.yml")
  	if err != nil {
  		return nil, err
  	}