summary refs log tree commit diff
path: root/OpenBSD/www/cgit-pink/pkg/README
blob: 816ad9e8a0da91834a97515768b4aeb931f381aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
$OpenBSD: README,v 1.5 2018/09/04 12:46:24 espie Exp $

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

Cgit config
===========
By default, the cgitrc config file is searched in ${PREFIX}/conf/cgitrc.
Refer to cgitrc(5) for the syntax.

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

OpenBSD httpd
-------------
server "default" {
	listen on egress 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
<Location "/cgit">
	AllowOverride None
	Options +ExecCGI
	Order allow,deny
	Allow from all
</Location>


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