nixpkgs/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch
2019-12-22 23:48:18 +01:00

58 lines
1.7 KiB
Diff

diff --git a/internal/config/config.go b/internal/config/config.go
index 2231851..c869930 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"
@@ -38,16 +37,13 @@ type Config struct {
}
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) {
diff --git a/internal/keyline/key_line.go b/internal/keyline/key_line.go
index c29a320..c44b701 100644
--- a/internal/keyline/key_line.go
+++ b/internal/keyline/key_line.go
@@ -36,7 +36,7 @@ func NewPrincipalKeyLine(keyId string, principal string, rootDir string) (*KeyLi
}
func (k *KeyLine) ToString() string {
- command := fmt.Sprintf("%s %s-%s", path.Join(k.RootDir, executable.BinDir, executable.GitlabShell), k.Prefix, k.Id)
+ command := fmt.Sprintf("%s %s-%s", path.Join("/run/current-system/sw/bin", executable.GitlabShell), k.Prefix, k.Id)
return fmt.Sprintf(`command="%s",%s %s`, command, SshOptions, k.Value)
}
diff --git a/support/gitlab_config.rb b/support/gitlab_config.rb
index 52ac5ee..d96baa3 100644
--- a/support/gitlab_config.rb
+++ b/support/gitlab_config.rb
@@ -7,7 +7,7 @@ class GitlabConfig
attr_reader :config
def initialize
- @config = YAML.load_file(File.join(ROOT_PATH, 'config.yml'))
+ @config = YAML.load_file('/run/gitlab/shell-config.yml')
end
def auth_file