git-shell revision ec61f6f64207b4168960fcd645b1362d86fdecca
18242N/A#!/usr/bin/env ruby
15153N/A#
10017N/A# Git shell, invoked from ~/.ssh/authorized_keys
15153N/A#
10017N/A
10017N/Aunless ENV['SSH_CONNECTION']
10017N/A puts "Only ssh allowed"
18242N/A exit 1
18242N/Aend
18242N/A
18242N/Arequire File.expand_path('../../lib/init', __FILE__)
18242N/Abegin
18242N/A require 'git_shell'
18242N/A
18242N/A key_id = ARGV[0]
18242N/A command = ENV['SSH_ORIGINAL_COMMAND']
18242N/A
18242N/A GitShell.new(key_id, command).exec
15593N/Arescue StandardError, ScriptError => error
15593N/A Rails.logger.error do
18161N/A <<-ERROR
18161N/ACould not perform git push for
18242N/A Key-Id:<#{key_id}> and command:<#{command}>.
18161N/AWe also encountered this error:
18161N/A <##{error.class}> <#{error.message}>
18161N/AWith this stacktrace:
18161N/A #{error.backtrace.join('\n')}
18161N/A ERROR
18242N/A end
18161N/A puts <<-ERROR
18242N/AWe encountered a system error while processing your
18161N/Agit-interaction attempt.
18161N/AThe git command was not processed; your data
18161N/Ais safe. Please try again in a few minutes.
18161N/AContact an admin if this issue persists.
18161N/A ERROR
18161N/A exit 1
18161N/Aend
18161N/A