Much to my
surprise
vicious
became very popular in just over a month. About a dozen people grab
the code every day, and they should be able to preview the repo and
browse trough it - so I decided to serve it
with cgit, a fast web
interface for git. Connecting it to lighttpd
revealed some quirks, so I'll describe my setup in short.
On my web server all web sites are served from "/var/www" so
when building cgit I decided to install it in
"/var/www/cgit":
$ make CGIT_SCRIPT_PATH=/var/www/cgitCgit binary, default css style sheet and logo will be stored there, configuration file is "/etc/cgitrc" and cache (if enabled later) is stored in "/var/cache/cgit".
# {{{ git.webhost.tld $HTTP["host"] == "git.webhost.tld" { ## - force redirect HTTP to HTTPS #$HTTP["scheme"] == "http" { # url.redirect = ("" => "https://${url.authority}${url.path}${qsa}") #} server.document-root = "/var/www/cgit" index-file.names = ( "cgit.cgi" ) cgi.assign = ( "cgit.cgi" => "/var/www/cgit/cgit.cgi" ) url.rewrite-once = ( # - main Cgit worker that maps repositories and commits "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2", )} # }}}Before restarting lighttpd I did some quick changes on the default cgitrc. Since web sites are stored in "/var/www" I decided to keep public git repos in "/var/git" (as you might notice from the example repo below). Here are only the most relevant parts. Pay attention to the virtual-root which, together with the above rewrite line, fixes the cgit cache - otherwise it would constantly serve one and the same page.
# URL used as root for all cgit links # - fixes caching with the above rewrite virtual-root=/ # Specify some default clone prefixes # - repos are served only trough http(s) clone-prefix=http://git.sysphere.org # Specify the css url css=/cgit.css # Use a custom logo #logo=https://sysphere.org/images/cgit.png logo=/cgit.png # Set a custom footer message instead of default "generated by..." footer=footer.html ## List of repositories repo.url=myproject repo.path=/var/git/myproject.git repo.desc=my project that does something interesting repo.owner=user repo.readme=README.htmlServing it this way, beside the cache problem, had other quirks. The png logo cgit tried to serve as yet another repo. I had to link to it directly. The css file on the other hand was OK, custom footer too.