diff options
Diffstat (limited to 'docker/git-server/git-lighttpd.conf')
-rw-r--r-- | docker/git-server/git-lighttpd.conf | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/docker/git-server/git-lighttpd.conf b/docker/git-server/git-lighttpd.conf new file mode 100644 index 0000000..5d946bc --- /dev/null +++ b/docker/git-server/git-lighttpd.conf @@ -0,0 +1,41 @@ +server.modules += ("mod_accesslog") +server.modules += ("mod_auth", "mod_authn_file") +server.modules += ("mod_setenv", "mod_cgi", "mod_alias") + +server.document-root = "/var/www/html/" +accesslog.filename = "/dev/fd/3" + +$HTTP["url"] =^ "/git" { + mimetype.assign = ( ".css" => "text/css" ) + + $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" => "/usr/lib/git-core/git-http-backend" ) + setenv.add-environment = ( + "GIT_PROJECT_ROOT" => "/git", + "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" => "/git", + ) + } + else $HTTP["url"] =^ "/git/static" { + alias.url += ( + "/git/static" => "/usr/share/cgit", + ) + } + else { + alias.url += ( + "/git" => "/usr/lib/cgit/cgit.cgi", + ) + cgi.assign = ("" => "") + } +} |