diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-12-03 16:06:30 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-12-03 16:06:49 +0000 |
commit | eb2f5c42f9f57de71d7d52075fdba5e8f453a492 (patch) | |
tree | dcdc7293e4460a36b85a1a2b15a68d3024868aeb /lib | |
parent | 00c1817dacfae3be2749f199000a2db25b5c8a43 (diff) | |
download | gitano-eb2f5c42f9f57de71d7d52075fdba5e8f453a492.tar.gz |
Support whining for supple, and clean up a few bits
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/actions.lua | 2 | ||||
-rw-r--r-- | lib/gitano/auth.lua | 6 | ||||
-rw-r--r-- | lib/gitano/lace.lua | 12 | ||||
-rw-r--r-- | lib/gitano/supple.lua | 7 |
4 files changed, 17 insertions, 10 deletions
diff --git a/lib/gitano/actions.lua b/lib/gitano/actions.lua index 94cb1dd..336a71f 100644 --- a/lib/gitano/actions.lua +++ b/lib/gitano/actions.lua @@ -20,7 +20,7 @@ local function update_actions(conf, repo, tags) tags["ref"] == "refs/heads/master" then -- Update to the master branch of the gitano-admin repo, perform a conf -- check based on the target sha - log.chat(i18n.expand(VERIFY_NEW_GITANO_ADMIN)) + log.chat(i18n.expand("VERIFY_NEW_GITANO_ADMIN")) local conf, msg = config.parse(repo.git:get(tags["newsha"])) if not conf then return false, msg diff --git a/lib/gitano/auth.lua b/lib/gitano/auth.lua index 705002d..0a2388d 100644 --- a/lib/gitano/auth.lua +++ b/lib/gitano/auth.lua @@ -105,9 +105,9 @@ local function is_authorized(user, source, cmdline, repo_root, end if user == "gitano-bypass" then - log.stdout(i18n.expand("BYPASS_USER_BANNER_HEADER")) - log.stdout(i18n.expand("BYPASS_USER_ALERT_MESSAGE")) - log.stdout(i18n.expand("BYPASS_USER_BANNER_FOOTER")) + log.state(i18n.expand("BYPASS_USER_BANNER_HEADER")) + log.state(i18n.expand("BYPASS_USER_ALERT_MESSAGE")) + log.state(i18n.expand("BYPASS_USER_BANNER_FOOTER")) end if not cmd.validate(admin_conf, repo, parsed_cmdline) then diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua index 59c5a7a..f50c3d4 100644 --- a/lib/gitano/lace.lua +++ b/lib/gitano/lace.lua @@ -211,15 +211,15 @@ end local function run_ruleset(ruleset, ctx) -- First check if we're running as bypass if ctx.as_user == "gitano-bypass" then - log.stdout(i18n.expand("LACE_BYPASS_BANNER_HEADER")) - log.stdout(i18n.expand("LACE_BYPASS_ALERT_MESSAGE")) - log.stdout(i18n.expand("LACE_BYPASS_BANNER_FOOTER")) + log.state(i18n.expand("LACE_BYPASS_BANNER_HEADER")) + log.state(i18n.expand("LACE_BYPASS_ALERT_MESSAGE")) + log.state(i18n.expand("LACE_BYPASS_BANNER_FOOTER")) return "allow", i18n.expand("LACE_BYPASSED") end if ctx.as_user == nil and ctx.user == "gitano-bypass" then - log.stdout(i18n.expand("LACE_BYPASS_BANNER_HEADER")) - log.stdout(i18n.expand("LACE_BYPASS_ALERT_MESSAGE")) - log.stdout(i18n.expand("LACE_BYPASS_BANNER_FOOTER")) + log.state(i18n.expand("LACE_BYPASS_BANNER_HEADER")) + log.state(i18n.expand("LACE_BYPASS_ALERT_MESSAGE")) + log.state(i18n.expand("LACE_BYPASS_BANNER_FOOTER")) return "allow", i18n.expand("LACE_BYPASSED") end return lace.engine.run(ruleset, ctx) diff --git a/lib/gitano/supple.lua b/lib/gitano/supple.lua index 693fdf5..fe44c0b 100644 --- a/lib/gitano/supple.lua +++ b/lib/gitano/supple.lua @@ -139,6 +139,13 @@ end)(...) ]] local function run_hook(hook, _repo, info, ...) + if info.username == "gitano-bypass" then + log.state("BANANA") + log.state(i18n.expand("SUPPLE_BYPASS_BANNER_HEADER")) + log.state(i18n.expand("SUPPLE_BYPASS_ALERT_MESSAGE")) + log.state(i18n.expand("SUPPLE_BYPASS_BANNER_FOOTER")) + return true, i18n.expand("SUPPLE_BYPASSED") + end local proxy = get_repo_proxy(_repo) repo = _repo log.ddebug(i18n.expand("DEBUG_SUPPLE_HOST_RUN")) |