From 874979fc3fc70137b2569eca363c87696f9477d3 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Tue, 3 Nov 2026 12:18:39 -1000 Subject: Turn the setup notes into a quick start --- README.txt | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'README.txt') diff --git a/README.txt b/README.txt index 1d7b833..e36fd42 100644 --- a/README.txt +++ b/README.txt @@ -77,16 +77,36 @@ every page until the setting is taken out of cgitrc. make test builds this variant as well, into build/nolua, and checks it the same way. -Setup ------ - -cgit is a CGI program. Complete, commented configurations for nginx, Apache and -lighttpd live in custom/servers/, each explaining how that server routes -requests to the binary and serves the static assets off disk. - -At runtime cgit reads /etc/cgitrc for its options and for the list of -repositories to display. A fully commented starting point with every option at -its default is in custom/cgitrc, and MANUAL.txt documents each option in full. +Quick start +----------- + +cgit is a CGI program that reads its options and its list of repositories from +/etc/cgitrc. custom/cgitrc is a fully commented starting point with every option +at its default, and MANUAL.txt documents each option in full. With cgit +installed as above, copy custom/cgitrc to /etc/cgitrc and point it at the +repositories, with scan-path for every repository below one directory or a +repo.url and a repo.path line for each. They have to be readable by the account +the web server runs cgit as, www-data on Debian, since a scanned repository it +cannot read is left off the index with only a line in the error log. + +Complete, commented configurations for nginx, Apache and lighttpd live in +custom/servers/, each explaining how that server routes requests to the binary +and serves the static assets off disk. Install the one for your server. + +The cache is off until cache-size is set above 0, as in cache-size=1000 placed +above scan-path. Its directory has to exist first, owned by the same account +and closed to the others. + + $ sudo install -d -o www-data -m 0700 /var/cache/cgit + +From a shell, --version names the build and whether it has Lua. --nohttp +--query= prints the page for a query string, reading /etc/cgitrc or the file +CGIT_CONFIG names, and --scan-path= prints what a scan of a directory finds as +cgitrc lines, without reading cgitrc. Run as the web server's account, a page +meets its permissions and prints on stderr what the error log would get. + + $ /usr/lib/cgit/cgit.cgi --version + $ sudo -u www-data /usr/lib/cgit/cgit.cgi --nohttp --query=url=demo/log Customisation -- cgit 2.12.1