blob: faf18512d2acf98c284d8128798c91187687a132 [file] [log] [blame]
Lukas Fleischere2416252014-01-08 19:45:29 +01001cgit - CGI for Git
2==================
Lars Hjemli25105d72006-12-10 22:31:36 +01003
Lukas Fleischere2416252014-01-08 19:45:29 +01004This is an attempt to create a fast web interface for the Git SCM, using a
5built-in cache to decrease server I/O pressure.
Lars Hjemli25105d72006-12-10 22:31:36 +01006
Lars Hjemli66414b62007-01-28 13:18:23 +01007Installation
Lukas Fleischere2416252014-01-08 19:45:29 +01008------------
Lars Hjemli66414b62007-01-28 13:18:23 +01009
Lukas Fleischere2416252014-01-08 19:45:29 +010010Building cgit involves building a proper version of Git. How to do this
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020011depends on how you obtained the cgit sources:
12
13a) If you're working in a cloned cgit repository, you first need to
Lukas Fleischere2416252014-01-08 19:45:29 +010014initialize and update the Git submodule:
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020015
Lukas Fleischere2416252014-01-08 19:45:29 +010016 $ 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 Hjemlibd8e8a32007-09-04 11:49:40 +020019
20b) If you're building from a cgit tarball, you can download a proper git
21version like this:
22
Lukas Fleischere2416252014-01-08 19:45:29 +010023 $ make get-git
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020024
25When either a) or b) has been performed, you can build and install cgit like
26this:
27
Lukas Fleischere2416252014-01-08 19:45:29 +010028 $ make
29 $ sudo make install
Lars Hjemli5a217ed2007-05-11 12:13:15 +020030
Lukas Fleischere2416252014-01-08 19:45:29 +010031This will install `cgit.cgi` and `cgit.css` into `/var/www/htdocs/cgit`. You
32can configure this location (and a few other things) by providing a `cgit.conf`
Lars Hjemlibd8e8a32007-09-04 11:49:40 +020033file (see the Makefile for details).
Lars Hjemli66414b62007-01-28 13:18:23 +010034
Jason A. Donenfeld027e88a2014-01-14 03:48:23 +010035If you'd like to compile without Lua support, you may use:
36
37 $ make NO_LUA=1
38
39And if you'd like to specify a Lua implementation, you may use:
40
Natanael Copa44ccae42014-01-22 13:15:08 +010041 $ make LUA_PKGCONFIG=lua5.1
Jason A. Donenfeld027e88a2014-01-14 03:48:23 +010042
Natanael Copa44ccae42014-01-22 13:15:08 +010043If this is not specified, the Lua implementation will be auto-detected,
44preferring LuaJIT if many are present. Acceptable values are generally "lua",
45"luajit", "lua5.1", and "lua5.2".
Jason A. Donenfeld027e88a2014-01-14 03:48:23 +010046
47
Lukas Fleischere2416252014-01-08 19:45:29 +010048Dependencies
49------------
Lars Hjemlic52e8412007-02-04 23:57:34 +010050
Lukas Fleischerd523dac2014-01-09 19:44:27 +010051* libzip
52* libcrypto (OpenSSL)
53* libssl (OpenSSL)
Jason A. Donenfeldea7210b2014-01-18 00:45:01 +010054* optional: luajit or lua, most reliably used when pkg-config is available
Lars Hjemli5a217ed2007-05-11 12:13:15 +020055
56Apache configuration
Lukas Fleischere2416252014-01-08 19:45:29 +010057--------------------
Lars Hjemli5a217ed2007-05-11 12:13:15 +020058
Lukas Fleischere2416252014-01-08 19:45:29 +010059A new `Directory` section must probably be added for cgit, possibly something
Lars Hjemli5a217ed2007-05-11 12:13:15 +020060like this:
Lars Hjemlic52e8412007-02-04 23:57:34 +010061
Lukas Fleischere2416252014-01-08 19:45:29 +010062 <Directory "/var/www/htdocs/cgit/">
63 AllowOverride None
64 Options +ExecCGI
65 Order allow,deny
66 Allow from all
67 </Directory>
Lars Hjemli66414b62007-01-28 13:18:23 +010068
69
70Runtime configuration
Lukas Fleischere2416252014-01-08 19:45:29 +010071---------------------
Lars Hjemli66414b62007-01-28 13:18:23 +010072
Lukas Fleischere2416252014-01-08 19:45:29 +010073The file `/etc/cgitrc` is read by cgit before handling a request. In addition
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000074to runtime parameters, this file may also contain a list of repositories
Lukas Fleischere2416252014-01-08 19:45:29 +010075displayed by cgit (see `cgitrc.5.txt` for further details).
Lars Hjemli66414b62007-01-28 13:18:23 +010076
77The cache
Lukas Fleischere2416252014-01-08 19:45:29 +010078---------
Lars Hjemli66414b62007-01-28 13:18:23 +010079
Lukas Fleischere2416252014-01-08 19:45:29 +010080When cgit is invoked it looks for a cache file matching the request and
81returns it to the client. If no such cache file exists (or if it has expired),
82the content for the request is written into the proper cache file before the
Lars Hjemli66414b62007-01-28 13:18:23 +010083file is returned.
84
Lukas Fleischere2416252014-01-08 19:45:29 +010085If the cache file has expired but cgit is unable to obtain a lock for it, the
86stale cache file is returned to the client. This is done to favour page
Lars Hjemlidcef2572006-12-13 02:06:29 +010087throughput over page freshness.
Lars Hjemli25105d72006-12-10 22:31:36 +010088
Lars Hjemli66414b62007-01-28 13:18:23 +010089The generated content contains the complete response to the client, including
Lukas Fleischere2416252014-01-08 19:45:29 +010090the HTTP headers `Modified` and `Expires`.
Lars Hjemli5a217ed2007-05-11 12:13:15 +020091
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000092Online presence
Lukas Fleischere2416252014-01-08 19:45:29 +010093---------------
Lars Hjemli5a217ed2007-05-11 12:13:15 +020094
Jason A. Donenfeldcd42ded2013-05-27 21:56:57 +020095* The cgit homepage is hosted by cgit at <http://git.zx2c4.com/cgit/about/>
Lars Hjemli5a217ed2007-05-11 12:13:15 +020096
Lukas Fleischere2416252014-01-08 19:45:29 +010097* Patches, bug reports, discussions and support should go to the cgit
Jason A. Donenfeld72f89912013-05-13 14:00:50 +020098 mailing list: <cgit@lists.zx2c4.com>. To sign up, visit
99 <http://lists.zx2c4.com/mailman/listinfo/cgit>