landry 89046c2316 Update to cgit 1.1, from Hiltjo Posthuma, thanks! 8 tahun lalu
..
DESCR 4384ef8d72 Import cgit 0.8.3.5: 14 tahun lalu
PLIST 32cc5a6202 Update to cgit 0.11.2, tested in "production" on 5.6. 10 tahun lalu
README 89046c2316 Update to cgit 1.1, from Hiltjo Posthuma, thanks! 8 tahun lalu

README

$OpenBSD: README,v 1.3 2017/03/22 20:23:52 landry Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

Cgit config
===========
By default, the cgitrc config file is searched in ${PREFIX}/conf/cgitrc.
Refer to http://git.zx2c4.com/cgit/tree/cgitrc.5.txt for the syntax.

Webserver config
================

OpenBSD httpd
-------------
ext_ip="0.0.0.0"
server "default" {
listen on $ext_ip port 80

# don't serve static files from cgit CGI: cgit.css and cgit.png
location "/cgit.*" {
root "/cgit"
no fastcgi
}
root "/cgi-bin/cgit.cgi"
fastcgi socket "/run/slowcgi.sock"
}

Nginx
-----
An example nginx config snippet is provided below, to run with
slowcgi:

server {
server_name cgit.example.com;
access_log logs/cgit-access main;
error_log logs/cgit-error warn;
location ~ /cgit.(png|css) {
root /var/www/htdocs;
}
location / {
rewrite /(.*) /cgi-bin/cgit.cgi/$1;
}
location /cgi-bin/ {
fastcgi_pass unix:run/slowcgi.sock;
fastcgi_split_path_info ^(/cgi-bin/[^/]+)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
}

Apache config
-------------

This config snippet works with Apache:

ScriptAlias /cgit /cgi-bin/cgit.cgi

AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all



snapshots
---------
Nginx and OpenBSD httpd use chroot(2).

For .tar.gz snapshot support a static binary in $chroot/bin/gzip is required.

cd /usr/src/usr.bin/compress
make clean && make LDFLAGS="-static -pie"
cp obj/compress $chroot/bin/gzip