summaryrefslogtreecommitdiff
path: root/bin/gitano-auth.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gitano-auth.in')
-rw-r--r--bin/gitano-auth.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/gitano-auth.in b/bin/gitano-auth.in
index e99eb11..51ba85d 100644
--- a/bin/gitano-auth.in
+++ b/bin/gitano-auth.in
@@ -25,6 +25,8 @@ gitano.config.repo_path(repo_root)
local cmdline = luxio.getenv "SSH_ORIGINAL_COMMAND" or ""
+local transactionid = gitano.log.syslog.open()
+
if cmdline:match("^[ \t\n]*$") then
gitano.log.fatal("No command provided, cannot continue")
end
@@ -89,6 +91,11 @@ local repo
-- Find the command
+
+ip = string.match(luxio.getenv "SSH_CLIENT", "^[^ ]+") or ""
+gitano.log.syslog.info("Client connected from ", ip,
+ " Executing command: ", cmdline)
+
local cmd = gitano.command.get(parsed_cmdline[1])
if not cmd then
@@ -153,6 +160,7 @@ local env = {
["GITANO_KEYTAG"] = keytag,
["GITANO_PROJECT"] = (repo or {}).name,
["GITANO_SOURCE"] = "ssh",
+ ["GITANO_TRANSACTION_ID"] = transactionid,
}
local how, why = cmd.run(config, repo, parsed_cmdline, env)
@@ -161,6 +169,10 @@ if how ~= "exit" or why ~= 0 then
gitano.log.critical("Error running sub-process:",
("%s (%d)"):format(how, why))
gitano.log.fatal("Unable to continue")
+else
+ gitano.log.syslog.info(cmdline, "completed successfully")
end
+gitano.log.syslog.close()
+
return 0