Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 1 | cgit - CGI for Git |
| 2 | ================== |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 3 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 4 | This is an attempt to create a fast web interface for the Git SCM, using a |
| 5 | built-in cache to decrease server I/O pressure. |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 6 | |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 7 | Installation |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 8 | ------------ |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 9 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 10 | Building cgit involves building a proper version of Git. How to do this |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 11 | depends on how you obtained the cgit sources: |
| 12 | |
| 13 | a) If you're working in a cloned cgit repository, you first need to |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 14 | initialize and update the Git submodule: |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 15 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 16 | $ git submodule init # register the Git submodule in .git/config |
| 17 | $ $EDITOR .git/config # if you want to specify a different url for git |
| 18 | $ git submodule update # clone/fetch and checkout correct git version |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 19 | |
| 20 | b) If you're building from a cgit tarball, you can download a proper git |
| 21 | version like this: |
| 22 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 23 | $ make get-git |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 24 | |
| 25 | When either a) or b) has been performed, you can build and install cgit like |
| 26 | this: |
| 27 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 28 | $ make |
| 29 | $ sudo make install |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 30 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 31 | This will install `cgit.cgi` and `cgit.css` into `/var/www/htdocs/cgit`. You |
| 32 | can configure this location (and a few other things) by providing a `cgit.conf` |
Lars Hjemli | bd8e8a3 | 2007-09-04 11:49:40 +0200 | [diff] [blame] | 33 | file (see the Makefile for details). |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 34 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 35 | Dependencies |
| 36 | ------------ |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 37 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 38 | * git 1.7.4 |
| 39 | * zip lib |
| 40 | * crypto lib |
| 41 | * openssl lib |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 42 | |
| 43 | Apache configuration |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 44 | -------------------- |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 45 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 46 | A new `Directory` section must probably be added for cgit, possibly something |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 47 | like this: |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 48 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 49 | <Directory "/var/www/htdocs/cgit/"> |
| 50 | AllowOverride None |
| 51 | Options +ExecCGI |
| 52 | Order allow,deny |
| 53 | Allow from all |
| 54 | </Directory> |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 55 | |
| 56 | |
| 57 | Runtime configuration |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 58 | --------------------- |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 59 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +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 |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 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 | The cache |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 65 | --------- |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 66 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 67 | When cgit is invoked it looks for a cache file matching the request and |
| 68 | returns it to the client. If no such cache file exists (or if it has expired), |
| 69 | the content for the request is written into the proper cache file before the |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 70 | file is returned. |
| 71 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 72 | If the cache file has expired but cgit is unable to obtain a lock for it, the |
| 73 | stale cache file 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 |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 77 | the HTTP headers `Modified` and `Expires`. |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 78 | |
Lars Hjemli | 2a0c9dc | 2011-06-13 13:24:46 +0000 | [diff] [blame] | 79 | Online presence |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 80 | --------------- |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 81 | |
Jason A. Donenfeld | cd42ded | 2013-05-27 21:56:57 +0200 | [diff] [blame] | 82 | * The cgit homepage is hosted by cgit at <http://git.zx2c4.com/cgit/about/> |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame] | 83 | |
Lukas Fleischer | e241625 | 2014-01-08 19:45:29 +0100 | [diff] [blame^] | 84 | * Patches, bug reports, discussions and support should go to the cgit |
Jason A. Donenfeld | 72f8991 | 2013-05-13 14:00:50 +0200 | [diff] [blame] | 85 | mailing list: <cgit@lists.zx2c4.com>. To sign up, visit |
| 86 | <http://lists.zx2c4.com/mailman/listinfo/cgit> |