From 93741e4a915fc33a00e6facff88cd27565d10f82 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 14 Aug 2012 11:37:51 -0700 Subject: daemon: --access-hook option The --access-hook option to "git daemon" specifies an external command to be run every time a client connects, with - service name (e.g. "upload-pack", etc.), - path to the repository, - hostname (%H), - canonical hostname (%CH), - ip address (%IP), - tcp port (%P) as its command line arguments. The external command can decide to decline the service by exiting with a non-zero status (or to allow it by exiting with a zero status). It can also look at the $REMOTE_ADDR and $REMOTE_PORT environment variables to learn about the requestor when making this decision. The external command can optionally write a single line to its standard output to be sent to the requestor as an error message when it declines the service. Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- Documentation/git-daemon.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Documentation/git-daemon.txt') diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index 31b28fc29f..c3ba4d7976 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -16,6 +16,7 @@ SYNOPSIS [--reuseaddr] [--detach] [--pid-file=] [--enable=] [--disable=] [--allow-override=] [--forbid-override=] + [--access-hook=] [--inetd | [--listen=] [--port=] [--user= [--group=]] [...] @@ -171,6 +172,21 @@ the facility of inet daemon to achieve the same before spawning errors are not enabled, all errors report "access denied" to the client. The default is --no-informative-errors. +--access-hook=:: + Every time a client connects, first run an external command + specified by the with service name (e.g. "upload-pack"), + path to the repository, hostname (%H), canonical hostname + (%CH), ip address (%IP), and tcp port (%P) as its command line + arguments. The external command can decide to decline the + service by exiting with a non-zero status (or to allow it by + exiting with a zero status). It can also look at the $REMOTE_ADDR + and $REMOTE_PORT environment variables to learn about the + requestor when making this decision. ++ +The external command can optionally write a single line to its +standard output to be sent to the requestor as an error message when +it declines the service. + :: A directory to add to the whitelist of allowed directories. Unless --strict-paths is specified this will also include subdirectories -- cgit v1.2.3