blob: 5a7bdf855ec556c917f75a141f3df5dd22b2a983 [file] [log] [blame]
Lars Hjemli25105d72006-12-10 22:31:36 +01001
Lars Hjemlidcef2572006-12-13 02:06:29 +01002 cgit - cgi for git
Lars Hjemli25105d72006-12-10 22:31:36 +01003
4
Lars Hjemli66414b62007-01-28 13:18:23 +01005This is an attempt to create a fast web interface for the git scm, using a
6builtin cache to decrease server io-pressure.
Lars Hjemli25105d72006-12-10 22:31:36 +01007
Lars Hjemli25105d72006-12-10 22:31:36 +01008
Lars Hjemli66414b62007-01-28 13:18:23 +01009Installation
10
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020011Building cgit involves building a proper version of git. How to do this
12depends on how you obtained the cgit sources:
13
14a) If you're working in a cloned cgit repository, you first need to
15initialize and update the git submodule:
16
17 $ git submodule init # register the git submodule in .git/config
18 $ $EDITOR .git/config # if you want to specify a different url for git
19 $ git submodule update # clone/fetch and checkout correct git version
20
21b) If you're building from a cgit tarball, you can download a proper git
22version like this:
23
24 $ make get-git
25
26
27When either a) or b) has been performed, you can build and install cgit like
28this:
29
Lars Hjemli5a217ed2007-05-11 12:13:15 +020030 $ make
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020031 $ sudo make install
Lars Hjemli5a217ed2007-05-11 12:13:15 +020032
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020033This will install cgit.cgi and cgit.css into "/var/www/htdocs/cgit". You can
34configure this location (and a few other things) by providing a "cgit.conf"
35file (see the Makefile for details).
Lars Hjemli66414b62007-01-28 13:18:23 +010036
Lars Hjemlic52e8412007-02-04 23:57:34 +010037
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020038Dependencies:
Lars Hjemlib9025b52011-03-05 14:21:47 +010039 -git 1.7.4
Lars Hjemli5a217ed2007-05-11 12:13:15 +020040 -zip lib
41 -crypto lib
42 -openssl lib
Lars Hjemlic52e8412007-02-04 23:57:34 +010043
Lars Hjemli5a217ed2007-05-11 12:13:15 +020044
45Apache configuration
46
47A new Directory-section must probably be added for cgit, possibly something
48like this:
Lars Hjemlic52e8412007-02-04 23:57:34 +010049
50 <Directory "/var/www/htdocs/cgit/">
51 AllowOverride None
Kamil Kaminski49d09d42010-10-10 23:58:30 -050052 Options +ExecCGI
Lars Hjemlic52e8412007-02-04 23:57:34 +010053 Order allow,deny
54 Allow from all
55 </Directory>
Lars Hjemli66414b62007-01-28 13:18:23 +010056
57
58Runtime configuration
59
Lars Hjemlic52e8412007-02-04 23:57:34 +010060The file /etc/cgitrc is read by cgit before handling a request. In addition
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000061to runtime parameters, this file may also contain a list of repositories
62displayed by cgit (see cgitrc.5.txt for further details).
Lars Hjemli66414b62007-01-28 13:18:23 +010063
64
65The cache
66
Lars Hjemli5a217ed2007-05-11 12:13:15 +020067When cgit is invoked it looks for a cachefile matching the request and
68returns it to the client. If no such cachefile exist (or if it has expired),
Lars Hjemli66414b62007-01-28 13:18:23 +010069the content for the request is written into the proper cachefile before the
70file is returned.
71
Lars Hjemli5a217ed2007-05-11 12:13:15 +020072If the cachefile has expired but cgit is unable to obtain a lock for it, the
Lars Hjemli66414b62007-01-28 13:18:23 +010073stale cachefile is returned to the client. This is done to favour page
Lars Hjemlidcef2572006-12-13 02:06:29 +010074throughput over page freshness.
Lars Hjemli25105d72006-12-10 22:31:36 +010075
Lars Hjemli66414b62007-01-28 13:18:23 +010076The generated content contains the complete response to the client, including
77the http-headers "Modified" and "Expires".
Lars Hjemli5a217ed2007-05-11 12:13:15 +020078
79
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000080Online presence
Lars Hjemli5a217ed2007-05-11 12:13:15 +020081
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000082* The cgit homepage is hosted by cgit at http://hjemli.net/git/cgit/about
Lars Hjemli5a217ed2007-05-11 12:13:15 +020083
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000084* Patches, bugreports, discussions and support should go to the cgit
85 mailing list: cgit@hjemli.net