diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-07-14 15:16:15 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-07-14 15:16:15 +0000 |
commit | 4b8ce6875266fdd6609a217dcf2924d7d4815cc2 (patch) | |
tree | 8d7a5edd116bf327df8f507f21eaad428b056998 /bin/gitano-command.cgi.in | |
parent | d5a76a5caf51d12c811317ac6e376942b7633770 (diff) | |
parent | ef7cb90b7e3df1f953d9190f1193101ac4c2f9db (diff) | |
download | gitano-baserock/morph.tar.gz |
Merge branch 'baserock/pedroalvarez/trove-ansible3' into baserock/morphbaserock/morph
Updated to the latest version of gitano, which now allows
the user to change the skeleton path.
Diffstat (limited to 'bin/gitano-command.cgi.in')
-rwxr-xr-x | bin/gitano-command.cgi.in | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/bin/gitano-command.cgi.in b/bin/gitano-command.cgi.in index 1954635..2fa1db2 100755 --- a/bin/gitano-command.cgi.in +++ b/bin/gitano-command.cgi.in @@ -29,26 +29,6 @@ function url_decode(str) return str end -function run_command(cmd, cmdline, parsed_cmdline, user, config, env, repo) - gitano.log.debug("Welcome to " .. config.global.site_name) - gitano.log.debug("Running:") - for i = 1, #parsed_cmdline do - gitano.log.debug(" => " .. parsed_cmdline[i]) - end - gitano.log.debug("") - gitano.log.debug("On behalf of " .. user .. " using key " .. env["GITANO_KEYTAG"]) - - local how, why = cmd.run(config, repo, parsed_cmdline, env) - - if how ~= "exit" or why ~= 0 then - gitano.log.critical("Error running " .. parsed_cmdline[1] .. ": " .. how) - return why - else - gitano.log.syslog.info(cmdline, "completed successfully") - return 0 - end -end - if os.getenv("QUERY_STRING") then local query_string = url_decode(os.getenv("QUERY_STRING")) local cmdline = query_string @@ -74,10 +54,10 @@ if os.getenv("QUERY_STRING") then gitano.log.buffer_output() local authorized, cmd, parsed_cmdline, config, env, repo = - gitano.auth.is_authorized(user, "http", cmdline) + gitano.auth.is_authorized(user, "http", cmdline, os.getenv("GITANO_ROOT")) if authorized then - local exit = run_command(cmd, cmdline, parsed_cmdline, + local exit = gitano.util.run_command(cmd, cmdline, parsed_cmdline, user, config, env, repo) stdout:write("Status: " .. (exit == 0 and "200 OK" or "400 Bad request") |