summaryrefslogtreecommitdiff
path: root/git-daemon/README
blob: 97edd702ca263f51690a3c635ea09f9e73ef6ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
userv-git-daemon is a replacement for the standard git daemon,
which provides anonymous remote access to git repositories.

It uses userv to invoke the service requested by the client, and users
can configure it to map git:// URLs to repositories and enable and
disable services as they see fit, without intervention from the system
administrator.


To install:
-----------

Adjust the paths in ../settings.make as necessary.
userv-git-daemon uses $(libuserv), $(etcuserv), and $(services).

Type make install.

Create a "userv-git" user that will run the outer part of the git-daemon.
Ensure your /etc/services contains a line like "git 9418/tcp".

Insert the inetd.conf fragment into your /etc/inetd.conf
and tell inetd to reload.

As a test user, create a 'public-git' directory, and copy a bare git
repository into it, e.g.
	git clone --bare git://dotat.at/unifdef.git public-git/unifdef.git

This repository should now be visible:
	git ls-remote git://localhost/~test/unifdef.git


Operation:
----------

The userv-git-daemon is invoked by inetd which also tells it where to
find its global git-urlmap config.

The git-daemon parses the request from the network and uses the global
git-urlmap config to determine which user will run the requested
service.  It invokes userv for the request to be performed.  The most
common service is git-upload-pack, which is confusingly named: it
uploads from the repository to the network; other services supported
by git are git-upload-archive and git-receive-pack.

The git-daemon will pass any service beginning git- to userv.  The
userv configuration determines which services may be requested. This
package includes example git-upload-pack service configurations.

The service configuration uses the git-service script to run the
service.  It passes the global and per-user git-urlmap configs to the
git-service script to determine where in the filesyetem the requested
repository is.  Later urlmap entries override the choices made by
earlier ones.

If a repository is located, the git-service script runs the requested
service, which is simply the git program with the same name.


Configuration:
--------------

See "git-urlmap" for syntax description and an example.


----------------------------------------------
This was written by Tony Finch <dot@dotat.at> and subsequently
heavily modified by Ian Jackson <ijackson@chiark.greenend.org.uk>
http://creativecommons.org/publicdomain/zero/1.0/