Commit 7626d957 authored by ash's avatar ash

Logging throughout gitlab-shell.

parent 51727f5c
......@@ -20,8 +20,15 @@ class GitlabShell
if validate_access
process_cmd
else
message = "gitlab-shell: Access denied for git command <#{@origin_cmd}>"
message << " by user with key #{@key_id}."
$logger.warn message
end
else
message = "gitlab-shell: Attempt to execute disallowed command "
message << "<#{@origin_cmd}> by user with key #{@key_id}."
$logger.warn message
puts 'Not allowed command'
end
else
......@@ -44,7 +51,9 @@ class GitlabShell
def process_cmd
repo_full_path = File.join(repos_path, repo_name)
exec_cmd "#{@git_cmd} #{repo_full_path}"
cmd = "#{@git_cmd} #{repo_full_path}"
$logger.info "gitlab-shell: executing git command <#{cmd}> for user with key #{@key_id}."
exec_cmd(cmd)
end
def validate_access
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment