Skip to content

Commit 46b9249

Browse files
committed
Merge pull request gitlabhq#212 from jirutka/patch-1
Allow to configure location of the secret file
2 parents fd677db + 9beb1c4 commit 46b9249

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

config.yml.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ repos_path: "/home/git/repositories"
2525
# File used as authorized_keys for gitlab user
2626
auth_file: "/home/git/.ssh/authorized_keys"
2727

28+
# File that contains the secret key for verifying access to GitLab.
29+
# Default is .gitlab_shell_secret in the root directory.
30+
# secret_file: "/home/git/gitlab-shell/.gitlab_shell_secret"
31+
2832
# Redis settings used for pushing commit notices to gitlab
2933
redis:
3034
bin: /usr/bin/redis-cli

lib/gitlab_config.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def auth_file
1919
@config['auth_file'] ||= File.join(home, ".ssh/authorized_keys")
2020
end
2121

22+
def secret_file
23+
@config['secret_file'] ||= File.join(ROOT_PATH, '.gitlab_shell_secret')
24+
end
25+
2226
def gitlab_url
2327
@config['gitlab_url'] ||= "http://localhost/"
2428
end

lib/gitlab_net.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,6 @@ def cert_store
137137
end
138138

139139
def secret_token
140-
@secret_token ||= File.read File.join(ROOT_PATH, '.gitlab_shell_secret')
140+
@secret_token ||= File.read config.secret_file
141141
end
142142
end

0 commit comments

Comments
 (0)