Merge branch 'jc/daemon-access-hook'
authorJunio C Hamano <gitster@pobox.com>
Mon, 3 Sep 2012 22:54:03 +0000 (15:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Sep 2012 22:54:03 +0000 (15:54 -0700)
Allow an external command to tell git-daemon to decline service
based on the client address, repository path, etc.

* jc/daemon-access-hook:
daemon: --access-hook option

1  2 
Documentation/git-daemon.txt
index e8f757704c7fcf93e8e19f66c34557b8887ef29a,c3ba4d79769ddea71fa48cf2674a8ebe094e35c0..7e5098a95e48bbe0a82630e2ca5d4cebec6c3112
@@@ -16,6 -16,7 +16,7 @@@ SYNOPSI
             [--reuseaddr] [--detach] [--pid-file=<file>]
             [--enable=<service>] [--disable=<service>]
             [--allow-override=<service>] [--forbid-override=<service>]
+            [--access-hook=<path>]
             [--inetd | [--listen=<host_or_ipaddr>] [--port=<n>] [--user=<user> [--group=<group>]]
             [<directory>...]
  
@@@ -171,6 -172,21 +172,21 @@@ the facility of inet daemon to achieve 
        errors are not enabled, all errors report "access denied" to the
        client. The default is --no-informative-errors.
  
+ --access-hook=<path>::
+       Every time a client connects, first run an external command
+       specified by the <path> 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.
  <directory>::
        A directory to add to the whitelist of allowed directories. Unless
        --strict-paths is specified this will also include subdirectories
@@@ -204,7 -220,7 +220,7 @@@ receive-pack:
        can push anything into the repository, including removal
        of refs).  This is solely meant for a closed LAN setting
        where everybody is friendly.  This service can be
 -      enabled by `daemon.receivepack` configuration item to
 +      enabled by setting `daemon.receivepack` configuration item to
        `true`.
  
  EXAMPLES