chiark / gitweb /
116a6b35cec0d090efd1ae4dd2e4a765db6443a3
[userv-utils.git] / git-daemon / README
1 userv-git-daemon is a replacement for the standard git daemon,
2 which provides anonymous remote access to git repositories.
3
4 It uses userv to invoke the service requested by the client, and users
5 can configure it to map git:// URLs to repositories and enable and
6 disable services as they see fit, without intervention from the system
7 administrator.
8
9
10 To install:
11 -----------
12
13 Adjust the paths in ../settings.make as necessary.
14 userv-git-daemon uses $(libuserv), $(etcuserv), and $(services).
15
16 Type make install.
17
18 Create a "git" user that will run the outer part of the git-daemon.
19 Ensure your /etc/services contains a line like "git 9418/tcp".
20
21 Insert the inetd.conf fragment into your /etc/inetd.conf
22 and tell inetd to reload.
23
24 As a test user, create a 'public-git' directory, and copy a bare git
25 repository into it, e.g.
26         git clone --bare git://dotat.at/unifdef.git public-git/unifdef.git
27
28 This repository should now be visible:
29         git ls-remote git://localhost/~test/unifdef.git
30
31
32 Operation:
33 ----------
34
35 The userv-git-daemon is invoked by inetd which also tells it where to
36 find its global git-urlmap config.
37
38 The git-daemon parses the request from the network and uses the global
39 git-urlmap config to determine which user will run the requested
40 service.  It invokes userv for the request to be performed.  The most
41 common service is git-upload-pack, which is confusingly named: it
42 uploads from the repository to the network; other services supported
43 by git are git-upload-archive and git-receive-pack.
44
45 The git-daemon will pass any service beginning git- to userv.  The
46 userv configuration determines which services may be requested. This
47 package includes example git-upload-pack service configurations.
48
49 The service configuration uses the git-service script to run the
50 service.  It passes the global and per-user git-urlmap configs to the
51 git-service script to determine where in the filesyetem the requested
52 repository is.  Later urlmap entries override the choices made by
53 earlier ones.
54
55 If a repository is located, the git-service script runs the requested
56 service, which is simply the git program with the same name.
57
58
59 Configuration:
60 --------------
61
62 See "chiark-urlmap" for an example.
63
64 Each line is one of:
65
66     single-user <vhost>[/<subpath>] <user> [<directory>]
67           matching requests will be handled by <user>
68           and unless overridden by <user> handled by
69           serving subdirectories of <directory>
70
71     multi-user <vhost>[/<subpath>] <directory>
72           matching requests are only those those next
73           path element starts with ~<user>.  The
74           request will be handled by <user> and unless
75           overridden by <user> will be handled by
76           serving subdirectories of <directory>
77           (<directory> must be a relative path)
78
79     repo-regexp <regexp>
80           For per-user service.  Subrepos must match this
81           regexp, which must contain a single matching
82           group which is the filesystem pathname inside
83           the <directory>.  The default is (Tcl syntax):
84     repo-regexp {^(\w[-+._0-9A-Za-z]*)$}
85
86     [no-]require-git-daemon-export-ok
87           For per-user service.  Default is no-.
88
89 Last match, or last setting, wins.
90 <subpath>s may start with ~
91
92
93 ----------------------------------------------
94 This was written by Tony Finch <dot@dotat.at> and subsequently
95 heavily modified by Ian Jackson <ijackson@chiark.greenend.org.uk>
96 http://creativecommons.org/publicdomain/zero/1.0/