diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-24 22:06:46 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-30 05:30:33 +0300 |
commit | 20b9bb2029972c5f5334d6d684e0d60edb034c5f (patch) | |
tree | a6a9cbc01ec7d9f68cb639aeb80e26d8b6cd865a /config | |
parent | 86359ec854314574dccea75247f45590262b05c0 (diff) |
Create (if necessary) and link the gitlab-shell secret file on the rake install task
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/gitlab_shell_secret_token.rb | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/config/initializers/gitlab_shell_secret_token.rb b/config/initializers/gitlab_shell_secret_token.rb index 751fccead07..7454c33c9dd 100644 --- a/config/initializers/gitlab_shell_secret_token.rb +++ b/config/initializers/gitlab_shell_secret_token.rb @@ -1,19 +1 @@ -# Be sure to restart your server when you modify this file. - -require 'securerandom' - -# Your secret key for verifying the gitlab_shell. - - -secret_file = Gitlab.config.gitlab_shell.secret_file - -unless File.exist? secret_file - # Generate a new token of 16 random hexadecimal characters and store it in secret_file. - token = SecureRandom.hex(16) - File.write(secret_file, token) -end - -link_path = File.join(Gitlab.config.gitlab_shell.path, '.gitlab_shell_secret') -if File.exist?(Gitlab.config.gitlab_shell.path) && !File.exist?(link_path) - FileUtils.symlink(secret_file, link_path) -end +Gitlab::Shell.new.generate_and_link_secret_token |