diff options
Diffstat (limited to 'ansible/roles/trove-setup/templates/lighttpd')
-rw-r--r-- | ansible/roles/trove-setup/templates/lighttpd/git-httpd.conf | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ansible/roles/trove-setup/templates/lighttpd/git-httpd.conf b/ansible/roles/trove-setup/templates/lighttpd/git-httpd.conf index 8b4a22e..f2d61c9 100644 --- a/ansible/roles/trove-setup/templates/lighttpd/git-httpd.conf +++ b/ansible/roles/trove-setup/templates/lighttpd/git-httpd.conf @@ -10,6 +10,7 @@ server.modules = ( "mod_alias", "mod_compress", "mod_redirect", + "mod_rewrite", "mod_cgi", "mod_auth", "mod_setenv", @@ -61,6 +62,19 @@ $HTTP["url"] =~ "^/git/.*$" { ) } +# Avoid needlessly long cgit URLs. This must correspond with the +# 'virtual-root' setting in /etc/cgitrc. +url.rewrite-if-not-file = ( + "^/cgit/(.*)$" => "/cgi-bin/cgit.cgi/$1", +) + +# Allow /baserock and /delta, but redirect them to the proper /cgit/ path. +# Troves can contain arbitrary project names, so we can't do this for all +# projects, we just special-case the ones for git.baserock.org. +$HTTP["url"] =~ "^/(baserock|delta)(/.*)?$" { + url.redirect = ( "^/(.*)" => "/cgit/$1" ) +} + $HTTP["scheme"] == "https" { include "git-auth.conf" |