Cgit

SYNOPSYS

I do love cgit. Since this the old repo seems less usefull, This setup uses nginx as a frontend to lighttpd,

PROCEDURE

  • clone cgit
1
user@srv$ git clone http://git.zx2c4.com/cgit
  • build cgit
1
user@srv$ make get-git cgit
  • install cgit (edit Makefile)
1
2
3
4
...
CGIT_SCRIPT_PATH = /var/www/cgi-bin
CGIT_DATA_PATH = /var/www/public/cgit
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
# Specify some default clone prefixes
clone-prefix=git@srv:

# Use filters
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh
commiv-filter=/usr/lib/cgit/filters/commit-links.sh

# Build lovely urls
remove-suffix=1
virtual-root=/cgit

# Use gitolite projects list
project-list=/home/git/projects.list
scan-path=/home/git/repositories
enable-gitweb-owner=1
...
  • lighttpd
1
2
3
4
server.modules += ( "mod_cgi" )
$HTTP["url"] =~ "^/cgi-bin/" {
    cgi.assign = ( "" => "" )
}
  • nginx
1
2
3
4
location ~ ^/cgit {
    rewrite ^/cgit(.*) /cgi-bin/cgit$1 break;
    proxy_pass http://IP:port;
}
git