summaryrefslogtreecommitdiff
path: root/gitserver.conf
blob: c230ed3f2b4c70d7e17f0365bd89988ab86f5b3c (plain)
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
Listen 5000
ErrorLog /tmp/logpipe
TransferLog /tmp/logpipe
ServerName git.terceiro.eu

########################################################################
# git-http-backend
########################################################################
SetEnv GIT_PROJECT_ROOT /data/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch \
	"(?x)^/(.*/(HEAD | \
	info/refs | \
	objects/(info/[^/]+ | \
			[0-9a-f]{2}/[0-9a-f]{38} | \
			pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
	git-(upload|receive)-pack))$" \
	/usr/lib/git-core/git-http-backend/$1
# allow CGI execution
<Directory "/usr/lib/git-core">
	Options ExecCGI Indexes
	Order allow,deny
	Allow from all
	Require all granted
</Directory>
# access control for pushes
<LocationMatch "^/.*/git-receive-pack$">
	Order Deny,Allow
        AuthType Basic
        AuthName "Git Access"
	AuthUserFile /data/.htpasswd
        Require valid-user
</LocationMatch>
# private repositories
<LocationMatch "^/private/.*$">
	Order Deny,Allow
        AuthType Basic
        AuthName "Git Access"
	AuthUserFile /data/.htpasswd
        Require valid-user
</LocationMatch>

########################################################################
# cgit
########################################################################
Alias /cgit-css "/usr/share/cgit/"
ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
<Directory "/usr/lib/cgit/">
	AllowOverride None
	Options ExecCGI FollowSymlinks
	Require all granted
</Directory>

# vim: ft=apache