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 | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 11 | $ make |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 12 | $ su |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 13 | $ make install |
| 14 | |
| 15 | This will install cgit.cgi and cgit.css into "/var/www/htdocs/cgit". |
| 16 | |
| 17 | Note: The initial "make" will create a submodule 'git' and clone the git |
| 18 | repository at git://git.kernel.org/pub/scm/git/git.git in it. If you |
| 19 | already have a local git git repository that you want to use as origin |
| 20 | for the submodule, run |
| 21 | |
| 22 | $ git clone -s <path-to-git-repo> git |
| 23 | $ ./submodules.sh -u |
| 24 | |
| 25 | before running "make". |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 26 | |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 27 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 28 | Dependencies |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 29 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 30 | -git (1.5.2-rc0 or newer, due to git submodule) installed |
| 31 | -zip lib |
| 32 | -crypto lib |
| 33 | -openssl lib |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 34 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 35 | |
| 36 | Apache configuration |
| 37 | |
| 38 | A new Directory-section must probably be added for cgit, possibly something |
| 39 | like this: |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 40 | |
| 41 | <Directory "/var/www/htdocs/cgit/"> |
| 42 | AllowOverride None |
| 43 | Options ExecCGI |
| 44 | Order allow,deny |
| 45 | Allow from all |
| 46 | </Directory> |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 47 | |
| 48 | |
| 49 | Runtime configuration |
| 50 | |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 51 | The file /etc/cgitrc is read by cgit before handling a request. In addition |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 52 | to runtime parameters, this file also contains a list of the repositories |
Lars Hjemli | c52e841 | 2007-02-04 23:57:34 +0100 | [diff] [blame] | 53 | displayed by cgit. |
| 54 | |
| 55 | A template cgitrc is shipped with the sources, and all parameters and default |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 56 | values are documented in this file. |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 57 | |
| 58 | |
| 59 | The cache |
| 60 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 61 | When cgit is invoked it looks for a cachefile matching the request and |
| 62 | 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] | 63 | the content for the request is written into the proper cachefile before the |
| 64 | file is returned. |
| 65 | |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 66 | 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] | 67 | 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] | 68 | throughput over page freshness. |
Lars Hjemli | 25105d7 | 2006-12-10 22:31:36 +0100 | [diff] [blame] | 69 | |
Lars Hjemli | 66414b6 | 2007-01-28 13:18:23 +0100 | [diff] [blame] | 70 | The generated content contains the complete response to the client, including |
| 71 | the http-headers "Modified" and "Expires". |
Lars Hjemli | 5a217ed | 2007-05-11 12:13:15 +0200 | [diff] [blame^] | 72 | |
| 73 | |
| 74 | The mis(sing) features |
| 75 | |
| 76 | Submodule links in the directory listing page have a fixed format per |
| 77 | repository. This should probably be extended to a generic map between |
| 78 | submodule path and url. |
| 79 | |
| 80 | |
| 81 | The end. |