Merge pull request #118861 from talyz/gitlab-shell-fix

gitlab-shell: 13.15.1 -> 13.17.0
wip/yesman
Kim Lindberger 3 years ago committed by GitHub
commit 37f49597e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      pkgs/applications/version-management/gitlab/default.nix
  2. 4
      pkgs/applications/version-management/gitlab/gitlab-shell/default.nix
  3. 50
      pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch

@ -122,7 +122,10 @@ stdenv.mkDerivation {
rubyEnv rubyEnv.wrappedRuby rubyEnv.bundler tzdata git nettools
];
patches = [ ./remove-hardcoded-locations.patch ];
patches = [
# Change hardcoded paths to the NixOS equivalent
./remove-hardcoded-locations.patch
];
postPatch = ''
${lib.optionalString (!gitlabEnterprise) ''

@ -7,14 +7,14 @@ buildGoModule rec {
owner = "gitlab-org";
repo = "gitlab-shell";
rev = "v${version}";
sha256 = "sha256-wDZLcCBbWjG6wIcEj02eqwWVfAYy1TuAo/xvJB8tt+0=";
sha256 = "sha256-j/80AIIJdRSisu2fNXcqazb4oIzAQP5CfxHX3l6yijY=";
};
buildInputs = [ ruby ];
patches = [ ./remove-hardcoded-locations.patch ];
vendorSha256 = "16fa3bka0008x2yazahc6xxcv4fa6yqg74kk64v8lrp7snbvjf4d";
vendorSha256 = "sha256-/jJTMtS5fcbQroWuaPPfvYxy6znNS0FOXVN7IcE/spQ=";
postInstall = ''
cp -r "$NIX_BUILD_TOP/source"/bin/* $out/bin

@ -1,34 +1,25 @@
diff --git a/internal/config/config.go b/internal/config/config.go
index 79c2a36..12ba31e 100644
index 36f8625..72ede08 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -3,7 +3,6 @@ package config
import (
"io/ioutil"
"net/url"
- "os"
"path"
"path/filepath"
@@ -59,16 +58,13 @@ func (c *Config) GetHttpClient() *client.HttpClient {
}
func New() (*Config, error) {
- dir, err := os.Getwd()
- if err != nil {
- return nil, err
- }
+ dir := "/run/gitlab"
return NewFromDir(dir)
}
func NewFromDir(dir string) (*Config, error) {
- return newFromFile(path.Join(dir, configFile))
+ return newFromFile("/run/gitlab/shell-config.yml")
}
func newFromFile(filename string) (*Config, error) {
@@ -12,7 +12,7 @@ import (
)
const (
- configFile = "config.yml"
+ configFile = "shell-config.yml"
defaultSecretFileName = ".gitlab_shell_secret"
)
@@ -91,7 +91,7 @@ func (c *Config) GetHttpClient() *client.HttpClient {
// NewFromDirExternal returns a new config from a given root dir. It also applies defaults appropriate for
// gitlab-shell running in an external SSH server.
func NewFromDirExternal(dir string) (*Config, error) {
- cfg, err := newFromFile(filepath.Join(dir, configFile))
+ cfg, err := newFromFile(filepath.Join("/run/gitlab", configFile))
if err != nil {
return nil, err
}
diff --git a/internal/keyline/key_line.go b/internal/keyline/key_line.go
index c6f2422..fb0426b 100644
--- a/internal/keyline/key_line.go
@ -55,6 +46,3 @@ index 52ac5ee..d96baa3 100644
end
def auth_file
--
2.28.0

Loading…
Cancel
Save