git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #118861 from talyz/gitlab-shell-fix

gitlab-shell: 13.15.1 -> 13.17.0

commit37f49597e3e6e9126692e3741b58f0582e952340 authorKim Lindberger <kim.lindberger@gmail.com> dateFri 16 Apr 2021, 16:17 (6 years ago) parent7124e247377a1d
3 files changed+25−34
pkgs/applications/version-management/gitlab/default.nix+4−1 pkgs/applications/version-management/gitlab/gitlab-shell/default.nix+2−2 pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch+19−31
pkgs/applications/version-management/gitlab/default.nix+4−1
@@ -122,7 +122,10 @@ stdenv.mkDerivation {
122122 rubyEnv rubyEnv.wrappedRuby rubyEnv.bundler tzdata git nettools
123123 ];
124124
125− patches = [ ./remove-hardcoded-locations.patch ];
125+ patches = [
126+ # Change hardcoded paths to the NixOS equivalent
127+ ./remove-hardcoded-locations.patch
128+ ];
126129
127130 postPatch = ''
128131 ${lib.optionalString (!gitlabEnterprise) ''
pkgs/applications/version-management/gitlab/gitlab-shell/default.nix+2−2
@@ -7,14 +7,14 @@ buildGoModule rec {
77 owner = "gitlab-org";
88 repo = "gitlab-shell";
99 rev = "v${version}";
10− sha256 = "sha256-wDZLcCBbWjG6wIcEj02eqwWVfAYy1TuAo/xvJB8tt+0=";
10+ sha256 = "sha256-j/80AIIJdRSisu2fNXcqazb4oIzAQP5CfxHX3l6yijY=";
1111 };
1212
1313 buildInputs = [ ruby ];
1414
1515 patches = [ ./remove-hardcoded-locations.patch ];
1616
17− vendorSha256 = "16fa3bka0008x2yazahc6xxcv4fa6yqg74kk64v8lrp7snbvjf4d";
17+ vendorSha256 = "sha256-/jJTMtS5fcbQroWuaPPfvYxy6znNS0FOXVN7IcE/spQ=";
1818
1919 postInstall = ''
2020 cp -r "$NIX_BUILD_TOP/source"/bin/* $out/bin
pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch+19−31
@@ -1,34 +1,25 @@
11diff --git a/internal/config/config.go b/internal/config/config.go
2−index 79c2a36..12ba31e 100644
2+index 36f8625..72ede08 100644
33--- a/internal/config/config.go
44+++ b/internal/config/config.go
5−@@ -3,7 +3,6 @@ package config
6− import (
7− "io/ioutil"
8− "net/url"
9−- "os"
10− "path"
11− "path/filepath"
12−
13−@@ -59,16 +58,13 @@ func (c *Config) GetHttpClient() *client.HttpClient {
14− }
15−
16− func New() (*Config, error) {
17−- dir, err := os.Getwd()
18−- if err != nil {
19−- return nil, err
20−- }
21−+ dir := "/run/gitlab"
22−
23− return NewFromDir(dir)
24− }
25−
26− func NewFromDir(dir string) (*Config, error) {
27−- return newFromFile(path.Join(dir, configFile))
28−+ return newFromFile("/run/gitlab/shell-config.yml")
29− }
30−
31− func newFromFile(filename string) (*Config, error) {
5+@@ -12,7 +12,7 @@ import (
6+ )
7+
8+ const (
9+- configFile = "config.yml"
10++ configFile = "shell-config.yml"
11+ defaultSecretFileName = ".gitlab_shell_secret"
12+ )
13+
14+@@ -91,7 +91,7 @@ func (c *Config) GetHttpClient() *client.HttpClient {
15+ // NewFromDirExternal returns a new config from a given root dir. It also applies defaults appropriate for
16+ // gitlab-shell running in an external SSH server.
17+ func NewFromDirExternal(dir string) (*Config, error) {
18+- cfg, err := newFromFile(filepath.Join(dir, configFile))
19++ cfg, err := newFromFile(filepath.Join("/run/gitlab", configFile))
20+ if err != nil {
21+ return nil, err
22+ }
3223diff --git a/internal/keyline/key_line.go b/internal/keyline/key_line.go
3324index c6f2422..fb0426b 100644
3425--- a/internal/keyline/key_line.go
@@ -55,6 +46,3 @@ index 52ac5ee..d96baa3 100644
5546 end
5647
5748 def auth_file
58−--
59−2.28.0
60−