diff options
Diffstat (limited to 'Documentation/git-daemon.txt')
-rw-r--r-- | Documentation/git-daemon.txt | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index e8f757704c..bfb106cccd 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -3,7 +3,7 @@ git-daemon(1) NAME ---- -git-daemon - A really simple server for git repositories +git-daemon - A really simple server for Git repositories SYNOPSIS -------- @@ -16,17 +16,18 @@ SYNOPSIS [--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>...] DESCRIPTION ----------- -A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT" +A really simple TCP Git daemon that normally listens on port "DEFAULT_GIT_PORT" aka 9418. It waits for a connection asking for a service, and will serve that service if it is enabled. It verifies that the directory has the magic file "git-daemon-export-ok", and -it will refuse to export any git directory that hasn't explicitly been marked +it will refuse to export any Git directory that hasn't explicitly been marked for export this way (unless the '--export-all' parameter is specified). If you pass some directory paths as 'git daemon' arguments, you can further restrict the offers to a whitelist comprising of those. @@ -36,7 +37,7 @@ By default, only `upload-pack` service is enabled, which serves from 'git fetch', 'git pull', and 'git clone'. This is ideally suited for read-only updates, i.e., pulling from -git repositories. +Git repositories. An `upload-archive` also exists to serve 'git archive'. @@ -50,7 +51,7 @@ OPTIONS --base-path=<path>:: Remap all the path requests as relative to the given path. - This is sort of "GIT root" - if you run 'git daemon' with + This is sort of "Git root" - if you run 'git daemon' with '--base-path=/srv/git' on example.com, then if you later try to pull 'git://example.com/hello.git', 'git daemon' will interpret the path as '/srv/git/hello.git'. @@ -72,7 +73,7 @@ OPTIONS whitelist. --export-all:: - Allow pulling from all directories that look like GIT repositories + Allow pulling from all directories that look like Git repositories (have the 'objects' and 'refs' subdirectories), even if they do not have the 'git-daemon-export-ok' file. @@ -146,6 +147,13 @@ OPTIONS Giving these options is an error when used with `--inetd`; use the facility of inet daemon to achieve the same before spawning 'git daemon' if needed. ++ +Like many programs that switch user id, the daemon does not reset +environment variables such as `$HOME` when it runs git programs, +e.g. `upload-pack` and `receive-pack`. When using this option, you +may also want to set and export `HOME` to point at the home +directory of `<user>` before starting the daemon, and make sure any +Git configuration files in that directory are readable by `<user>`. --enable=<service>:: --disable=<service>:: @@ -171,6 +179,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=<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 |