Commit 7626d957 authored by ash's avatar ash

Logging throughout gitlab-shell.

parent 51727f5c
...@@ -20,8 +20,15 @@ class GitlabShell ...@@ -20,8 +20,15 @@ class GitlabShell
if validate_access if validate_access
process_cmd process_cmd
else
message = "gitlab-shell: Access denied for git command <#{@origin_cmd}>"
message << " by user with key #{@key_id}."
$logger.warn message
end end
else 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' puts 'Not allowed command'
end end
else else
...@@ -44,7 +51,9 @@ class GitlabShell ...@@ -44,7 +51,9 @@ class GitlabShell
def process_cmd def process_cmd
repo_full_path = File.join(repos_path, repo_name) 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 end
def validate_access 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