aboutsummaryrefslogtreecommitdiff
path: root/services/docker/git-server/git-lighttpd.conf
blob: 44e0fd66f8286c7269869a9584319dc572310aa2 (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
server.modules += ("mod_accesslog")
server.modules += ("mod_auth", "mod_authn_file", "mod_access")
server.modules += ("mod_alias", "mod_setenv", "mod_cgi")

server.port = 3636
server.document-root = "/var/www/html/"
accesslog.filename = "/dev/fd/3"

$HTTP["url"] =^ "/git" {
    mimetype.assign = ( ".css" => "text/css" )

    $HTTP["url"] =^ "/git/private" {
        include "git-auth.conf"
    }

    $HTTP["url"] =~ "^/git/.*/(HEAD|info/refs|objects/info/[^/]+|git-(upload|receive)-pack)$" {
        $HTTP["querystring"] =~ "service=git-receive-pack" {
            include "git-auth.conf"
        }
        $HTTP["url"] =~ "^/git/.*/git-receive-pack$" {
            include "git-auth.conf"
        }
        alias.url += ( "/git/private" => "/usr/lib/git-core/git-http-backend/private" )
        alias.url += ( "/git" => "/usr/lib/git-core/git-http-backend/public" )
        setenv.add-environment = (
            "GIT_PROJECT_ROOT" => "/git/repos",
            "GIT_HTTP_EXPORT_ALL" => ""
        )
        cgi.assign = ("" => "")
    }
    else $HTTP["url"] =~ "^/git/.*/((objects/[0-9a-f]{2}/[0-9a-f]{38})|(pack/pack-[0-9a-f]{40}.(pack|idx)))$" {
        alias.url += (
            "/git/private" => "/git/repos/private",
            "/git" => "/git/repos/public",
        )
    }
    else $HTTP["url"] =^ "/git/static" {
        alias.url += (
            "/git/static" => "/usr/share/cgit",
        )
    }
    else {
        alias.url += (
            "/git" => "/usr/lib/cgit/cgit.cgi",
        )
        cgi.assign = ("" => "")
    }
}