blob: 9f2695971002438679d393f3d0e4bf1821342ef8 [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
41 $ make LUA_IMPLEMENTATION=JIT
42
43for using the LuaJIT project. Or:
44
45 $ make LUA_IMPLEMENTATION=VANILLA
46
47for the mainline Lua project. If you specify neither implementation, it will
48be auto-detected, preferring LuaJIT if both are present.
49
50
Lukas Fleischere2416252014-01-08 19:45:29 +010051Dependencies
52------------
Lars Hjemlic52e8412007-02-04 23:57:34 +010053
Lukas Fleischerd523dac2014-01-09 19:44:27 +010054* libzip
55* libcrypto (OpenSSL)
56* libssl (OpenSSL)
Jason A. Donenfeldea7210b2014-01-18 00:45:01 +010057* optional: luajit or lua, most reliably used when pkg-config is available
Lars Hjemli5a217ed2007-05-11 12:13:15 +020058
59Apache configuration
Lukas Fleischere2416252014-01-08 19:45:29 +010060--------------------
Lars Hjemli5a217ed2007-05-11 12:13:15 +020061
Lukas Fleischere2416252014-01-08 19:45:29 +010062A new `Directory` section must probably be added for cgit, possibly something
Lars Hjemli5a217ed2007-05-11 12:13:15 +020063like this:
Lars Hjemlic52e8412007-02-04 23:57:34 +010064
Lukas Fleischere2416252014-01-08 19:45:29 +010065 <Directory "/var/www/htdocs/cgit/">
66 AllowOverride None
67 Options +ExecCGI
68 Order allow,deny
69 Allow from all
70 </Directory>
Lars Hjemli66414b62007-01-28 13:18:23 +010071
72
73Runtime configuration
Lukas Fleischere2416252014-01-08 19:45:29 +010074---------------------
Lars Hjemli66414b62007-01-28 13:18:23 +010075
Lukas Fleischere2416252014-01-08 19:45:29 +010076The file `/etc/cgitrc` is read by cgit before handling a request. In addition
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000077to runtime parameters, this file may also contain a list of repositories
Lukas Fleischere2416252014-01-08 19:45:29 +010078displayed by cgit (see `cgitrc.5.txt` for further details).
Lars Hjemli66414b62007-01-28 13:18:23 +010079
80The cache
Lukas Fleischere2416252014-01-08 19:45:29 +010081---------
Lars Hjemli66414b62007-01-28 13:18:23 +010082
Lukas Fleischere2416252014-01-08 19:45:29 +010083When cgit is invoked it looks for a cache file matching the request and
84returns it to the client. If no such cache file exists (or if it has expired),
85the content for the request is written into the proper cache file before the
Lars Hjemli66414b62007-01-28 13:18:23 +010086file is returned.
87
Lukas Fleischere2416252014-01-08 19:45:29 +010088If the cache file has expired but cgit is unable to obtain a lock for it, the
89stale cache file is returned to the client. This is done to favour page
Lars Hjemlidcef2572006-12-13 02:06:29 +010090throughput over page freshness.
Lars Hjemli25105d72006-12-10 22:31:36 +010091
Lars Hjemli66414b62007-01-28 13:18:23 +010092The generated content contains the complete response to the client, including
Lukas Fleischere2416252014-01-08 19:45:29 +010093the HTTP headers `Modified` and `Expires`.
Lars Hjemli5a217ed2007-05-11 12:13:15 +020094
Lars Hjemli2a0c9dc2011-06-13 13:24:46 +000095Online presence
Lukas Fleischere2416252014-01-08 19:45:29 +010096---------------
Lars Hjemli5a217ed2007-05-11 12:13:15 +020097
Jason A. Donenfeldcd42ded2013-05-27 21:56:57 +020098* The cgit homepage is hosted by cgit at <http://git.zx2c4.com/cgit/about/>
Lars Hjemli5a217ed2007-05-11 12:13:15 +020099
Lukas Fleischere2416252014-01-08 19:45:29 +0100100* Patches, bug reports, discussions and support should go to the cgit
Jason A. Donenfeld72f89912013-05-13 14:00:50 +0200101 mailing list: <cgit@lists.zx2c4.com>. To sign up, visit
102 <http://lists.zx2c4.com/mailman/listinfo/cgit>