Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-18 18:14:36 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-18 18:14:36 +0300
commitf7bf892cca6bb8106194c14bef1ed9ddfc26ec91 (patch)
treeb9f47db5ffcb682281a52f281069e2bd8a852bad /lib
parentcfee95d0327485dffb8ea4d698d3f7f310fc6c19 (diff)
Revert "gitlab shell works if multiple rubies installed"
This reverts commit 533f4cdf30b38c587f7a91f0dfd898b907ecd944.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/backend/shell.rb21
-rw-r--r--lib/tasks/gitlab/shell.rake12
2 files changed, 3 insertions, 30 deletions
diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb
index 7b10ab539eb..aabc7f1e69a 100644
--- a/lib/gitlab/backend/shell.rb
+++ b/lib/gitlab/backend/shell.rb
@@ -1,5 +1,3 @@
-require 'securerandom'
-
module Gitlab
class Shell
class AccessDenied < StandardError; end
@@ -15,25 +13,6 @@ module Gitlab
@version_required ||= File.read(Rails.root.
join('GITLAB_SHELL_VERSION')).strip
end
-
- # Be sure to restart your server when you modify this method.
- def setup_secret_token
- secret_file = Rails.root.join('.gitlab_shell_secret')
- gitlab_shell_symlink = File.join(Gitlab.config.gitlab_shell.path,
- '.gitlab_shell_secret')
-
- 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
-
- if File.exist?(Gitlab.config.gitlab_shell.path) &&
- !File.exist?(gitlab_shell_symlink)
- FileUtils.symlink(secret_file, gitlab_shell_symlink)
- end
- end
end
# Init new repository
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index d3cc7135c54..202e55c89ad 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -22,14 +22,10 @@ namespace :gitlab do
# Make sure we're on the right tag
Dir.chdir(target_dir) do
- # Allows to change the origin URL to the fork
- # when developing gitlab-shell.
- sh(*%W(git remote set-url origin #{args.repo}))
-
# First try to checkout without fetching
# to avoid stalling tests if the Internet is down.
- reset = "(rev=\"$(git describe #{args.tag} || git describe \"origin/#{args.tag}\")\" && git reset --hard \"$rev\")"
- sh "#{reset} || (git fetch --tags origin && #{reset})"
+ reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})"
+ sh "#{reset} || git fetch origin && #{reset}"
config = {
user: user,
@@ -41,7 +37,7 @@ namespace :gitlab do
bin: %x{which redis-cli}.chomp,
namespace: "resque:gitlab"
}.stringify_keys,
- log_level: Rails.env.test? ? 'DEBUG' : 'INFO',
+ log_level: "INFO",
audit_usernames: false
}.stringify_keys
@@ -70,8 +66,6 @@ namespace :gitlab do
File.open(File.join(home_dir, ".ssh", "environment"), "w+") do |f|
f.puts "PATH=#{ENV['PATH']}"
end
-
- Gitlab::Shell.setup_secret_token
end
desc "GITLAB | Setup gitlab-shell"