forked from iconoeugen/docker-gitweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git.conf
49 lines (38 loc) · 1.42 KB
/
git.conf
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
AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/www/git/$1
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1
ScriptAliasMatch \
"(?x)^/git/(.*/(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/libexec/git-core/git-http-backend/$1
SetEnv GIT_PROJECT_ROOT /var/lib/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
<Directory /usr/libexec/git-core>
Require all granted
</Directory>
Alias /git /var/www/git
<Directory /var/www/git>
# Let anyone see our repositories (for now)
Require all granted
# Enable CGI in this directory
Options +ExecCGI
# Run .cgi files using mod_cgi
AddHandler cgi-script .cgi
# Use gitweb.cgi for directory listings. This takes care of
# requests to /git and /git/
DirectoryIndex gitweb.cgi
# This tells gitweb.cgi where to find its config file
# By default it looks in /etc/gitweb.conf, so if you place
# your config file somewhere else you should specify this.
#SetEnv GITWEB_CONFIG /etc/gitweb.conf
# Enable mod_rewrite
RewriteEngine on
# Rewrite /git/repo.git URIs to be /git/gitweb.cgi/repo.git
# This assumes your repository names end with '.git'. I don't
# know if that is always a safe assumption.
RewriteRule ^([^.]+\.git.*)$ /git/gitweb.cgi/$0 [L,PT]
</Directory>