lighttpd: Require HTTP auth for Brevidius git repositories.
authorMatthijs Kooijman <matthijs@stdin.nl>
Tue, 7 Dec 2010 18:44:19 +0000 (19:44 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Tue, 7 Dec 2010 18:44:19 +0000 (19:44 +0100)
This uses simple matching on the querystring to select
Brevidius-related repositories (which should be sufficient and perhaps
have a few false positives as well) and uses a htpasswd file for the
logins.

etc/lighttpd/vhosts/stderr-nl

index eb84556e2a6f2be0270ebd53e25c10f89a7da0ce..fd12de44c5401f904dd9b2315c236b9bfdf1151e 100644 (file)
@@ -19,6 +19,17 @@ $HTTP["host"] =~ ".stderr.nl$" {
                url.redirect += ("^/gitweb\?p=matthijs/projects/c.*ash\.git" => "/gitweb?p=matthijs/master-project/cλash.git")
                # Redirect / to gitweb
                url.redirect += ("^/$" => "/gitweb")
+               $HTTP["querystring"] =~ "/brevidius/" {
+                   auth.backend = "htpasswd"
+                   auth.backend.htpasswd.userfile = var.site-dir + "/conf/brevidius.user"
+                   auth.require = (
+                           "/" => (
+                                   "method"  => "basic",
+                                   "realm"   => "Brevidius",
+                                   "require" => "valid-user"
+                           )
+                   )
+               }
        }
 
        $HTTP["host"] =~ "hg.stderr.nl$" {