Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 1 | |
Lars Hjemli | dcef257 | 2006-12-13 02:06:29 +0100 | [diff] [blame] | 2 | cgit - cgi for git |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 3 | |
| 4 | |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 5 | This is an attempt to create a fast web interface for the git scm, using a |
| 6 | builtin cache to decrease server io-pressure. |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 7 | |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 8 | |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 9 | Installation |
| 10 | |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 11 | Building cgit involves building a proper version of git. How to do this |
| 12 | depends on how you obtained the cgit sources: |
| 13 | |
| 14 | a) If you're working in a cloned cgit repository, you first need to |
| 15 | initialize 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 | |
| 21 | b) If you're building from a cgit tarball, you can download a proper git |
| 22 | version like this: |
| 23 | |
| 24 | $ make get-git |
| 25 | |
| 26 | |
| 27 | When either a) or b) has been performed, you can build and install cgit like |
| 28 | this: |
| 29 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 30 | $ make |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 31 | $ sudo make install |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 32 | |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 33 | This will install cgit.cgi and cgit.css into "/var/www/htdocs/cgit". You can |
| 34 | configure this location (and a few other things) by providing a "cgit.conf" |
| 35 | file (see the Makefile for details). |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 36 | |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 37 | |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 38 | Dependencies: |
Lars Hjemli | b9025b5 | 2011-03-05 14:21:47 +0100 | [diff] [blame] | 39 | -git 1.7.4 |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 40 | -zip lib |
| 41 | -crypto lib |
| 42 | -openssl lib |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 43 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 44 | |
| 45 | Apache configuration |
| 46 | |
| 47 | A new Directory-section must probably be added for cgit, possibly something |
| 48 | like this: |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 49 | |
| 50 | <Directory "/var/www/htdocs/cgit/"> |
| 51 | AllowOverride None |
Kamil Kaminski | 49d09d4 | 2010-10-10 23:58:30 -0500 | [diff] [blame] | 52 | Options +ExecCGI |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 53 | Order allow,deny |
| 54 | Allow from all |
| 55 | </Directory> |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 56 | |
| 57 | |
| 58 | Runtime configuration |
| 59 | |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 60 | The file /etc/cgitrc is read by cgit before handling a request. In addition |
Lars Hjemli | 2a0c9dc | 2011-06-13 13:24:46 +0000 | [diff] [blame^] | 61 | to runtime parameters, this file may also contain a list of repositories |
| 62 | displayed by cgit (see cgitrc.5.txt for further details). |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 63 | |
| 64 | |
| 65 | The cache |
| 66 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 67 | When cgit is invoked it looks for a cachefile matching the request and |
| 68 | returns it to the client. If no such cachefile exist (or if it has expired), |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 69 | the content for the request is written into the proper cachefile before the |
| 70 | file is returned. |
| 71 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 72 | If the cachefile has expired but cgit is unable to obtain a lock for it, the |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 73 | stale cachefile is returned to the client. This is done to favour page |
Lars Hjemli | dcef257 | 2006-12-13 02:06:29 +0100 | [diff] [blame] | 74 | throughput over page freshness. |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 75 | |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 76 | The generated content contains the complete response to the client, including |
| 77 | the http-headers "Modified" and "Expires". |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 78 | |
| 79 | |
Lars Hjemli | 2a0c9dc | 2011-06-13 13:24:46 +0000 | [diff] [blame^] | 80 | Online presence |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 81 | |
Lars Hjemli | 2a0c9dc | 2011-06-13 13:24:46 +0000 | [diff] [blame^] | 82 | * The cgit homepage is hosted by cgit at http://hjemli.net/git/cgit/about |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 83 | |
Lars Hjemli | 2a0c9dc | 2011-06-13 13:24:46 +0000 | [diff] [blame^] | 84 | * Patches, bugreports, discussions and support should go to the cgit |
| 85 | mailing list: cgit@hjemli.net |