nixpkgs/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch

59 lines
1.6 KiB
Diff
Raw Normal View History

2018-01-07 06:58:31 +03:00
diff --git a/go/internal/config/config.go b/go/internal/config/config.go
2018-11-23 17:29:38 +03:00
index 435cb29..078c1df 100644
2018-01-07 06:58:31 +03:00
--- a/go/internal/config/config.go
+++ b/go/internal/config/config.go
2018-11-23 17:29:38 +03:00
@@ -2,7 +2,6 @@ package config
import (
"io/ioutil"
- "os"
"path"
yaml "gopkg.in/yaml.v2"
@@ -26,16 +25,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))
2018-12-04 23:26:24 +03:00
+ return newFromFile("/run/gitlab/shell-config.yml")
2018-11-23 17:29:38 +03:00
}
func newFromFile(filename string) (*Config, error) {
2018-03-14 16:04:39 +03:00
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
2018-11-23 17:29:38 +03:00
index 57c70f5..700569b 100644
2018-03-14 16:04:39 +03:00
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
2018-11-23 17:29:38 +03:00
@@ -187,7 +187,8 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
2018-03-14 16:04:39 +03:00
2018-11-23 17:29:38 +03:00
args = [executable, gitaly_address, json_args]
2018-03-14 16:04:39 +03:00
# We use 'chdir: ROOT_PATH' to let the next executable know where config.yml is.
2018-04-25 20:55:58 +03:00
- Kernel.exec(env, *args, unsetenv_others: true, chdir: ROOT_PATH)
2018-03-14 16:04:39 +03:00
+ # Except we don't, because we're already in the right directory on nixos!
2018-04-25 20:55:58 +03:00
+ Kernel.exec(env, *args, unsetenv_others: true)
2018-03-14 16:04:39 +03:00
end
def api
diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb
index 0600a18..6814f0a 100644
--- a/lib/gitlab_keys.rb
+++ b/lib/gitlab_keys.rb
@@ -10,7 +10,7 @@ class GitlabKeys # rubocop:disable Metrics/ClassLength
attr_accessor :auth_file, :key
def self.command(whatever)
- "#{ROOT_PATH}/bin/gitlab-shell #{whatever}"
+ "/run/current-system/sw/bin/gitlab-shell #{whatever}"
end
def self.command_key(key_id)