summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-02-24 14:20:20 +0100
committerPawel Chojnacki <pawel@chojnacki.ws>2017-02-24 14:20:20 +0100
commit42d31f8fe18424617da19f55feb9b10f16219812 (patch)
treedb5bdee18bb329daec31003b6626378c4fc3672a /lib/gitlab_shell.rb
parenta6e5b9a17821dab311e71fa83d2a973cb5361edb (diff)
downloadgitlab-shell-42d31f8fe18424617da19f55feb9b10f16219812.tar.gz
Remove git annex support
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb43
1 files changed, 2 insertions, 41 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index e243aac..f2e7465 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -9,7 +9,7 @@ class GitlabShell
class DisallowedCommandError < StandardError; end
class InvalidRepositoryPathError < StandardError; end
- GIT_COMMANDS = %w(git-upload-pack git-receive-pack git-upload-archive git-annex-shell git-lfs-authenticate).freeze
+ GIT_COMMANDS = %w(git-upload-pack git-receive-pack git-upload-archive git-lfs-authenticate).freeze
API_COMMANDS = %w(2fa_recovery_codes)
GL_PROTOCOL = 'ssh'.freeze
@@ -71,10 +71,6 @@ class GitlabShell
raise DisallowedCommandError unless GIT_COMMANDS.include?(@command)
case @command
- when 'git-annex-shell'
- raise DisallowedCommandError unless @config.git_annex_enabled?
-
- @repo_name = args[2].sub(/\A\/~\//, '')
when 'git-lfs-authenticate'
raise DisallowedCommandError unless args.count >= 2
@repo_name = args[1]
@@ -103,25 +99,7 @@ class GitlabShell
def process_cmd(args)
return self.send("api_#{@command}") if API_COMMANDS.include?(@command)
- if @command == 'git-annex-shell'
- raise DisallowedCommandError unless @config.git_annex_enabled?
-
- # Make sure repository has git-annex enabled
- init_git_annex unless gcryptsetup?(args)
-
- parsed_args =
- args.map do |arg|
- # use full repo path
- if arg =~ /\A\/.*\.git\Z/
- repo_path
- else
- arg
- end
- end
-
- $logger.info "gitlab-shell: executing git-annex command <#{parsed_args.join(' ')}> for #{log_username}."
- exec_cmd(*parsed_args)
- elsif @command == 'git-lfs-authenticate'
+ if @command == 'git-lfs-authenticate'
GitlabMetrics.measure('lfs-authenticate') do
$logger.info "gitlab-shell: Processing LFS authentication for #{log_username}."
lfs_authenticate
@@ -150,10 +128,6 @@ class GitlabShell
'GL_PROTOCOL' => GL_PROTOCOL
}
- if @config.git_annex_enabled?
- env.merge!({ 'GIT_ANNEX_SHELL_LIMITED' => '1' })
- end
-
if git_trace_available?
env.merge!({
'GIT_TRACE' => @config.git_trace_log_file,
@@ -188,19 +162,6 @@ class GitlabShell
@config.audit_usernames ? username : "user with key #{@key_id}"
end
- def init_git_annex
- unless File.exists?(File.join(repo_path, 'annex'))
- cmd = %W(git --git-dir=#{repo_path} annex init "GitLab")
- system(*cmd, err: '/dev/null', out: '/dev/null')
- $logger.info "Enable git-annex for repository: #{repo_name}."
- end
- end
-
- def gcryptsetup?(args)
- non_dashed = args.reject { |a| a.start_with?('-') }
- non_dashed[0, 2] == %w{git-annex-shell gcryptsetup}
- end
-
def lfs_authenticate
lfs_access = api.lfs_authenticate(@key_id, @repo_name)