Commit | Line | Data |
---|---|---|
e9fec26a TF |
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 script. | |
37 | ||
38 | The git-daemon parses the request from the network and uses the global | |
39 | git-urlmap script 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 scripts to the | |
51 | git-service script to determine where in the filesyetem the requested | |
52 | repository is. Later urlmap scripts override the choices made by | |
53 | earlier ones. See the sample git-urlmap script for details of the | |
54 | variables they can examine and set. | |
55 | ||
56 | If a repository is located, the git-service script runs the requested | |
57 | service, which is simply the git program with the same name. | |
58 | ||
59 | ||
60 | ---------------------------------------------- | |
61 | This was written by Tony Finch <dot@dotat.at> | |
62 | You may do anything with it, at your own risk. | |
63 | http://creativecommons.org/publicdomain/zero/1.0/ |