Basic auth with Lighttpd

Tane Piper digitalspaghetti at googlemail.com
Wed Jan 2 09:27:05 CST 2008


I managed to get this working.  I've added it to the Wiki page, but
also I have posted a blog entry here:

http://digitalspaghetti.me.uk/2008/01/02/getting-mercurial-push-to-work-with-lighttpd

On Jan 2, 2008 12:09 PM, Tane Piper <digitalspaghetti at googlemail.com> wrote:
> Hey folks,
>
> I am running my mercurial repo over at
> http://hg.digitalspaghetti.me.uk on Lighttpd and I am having issues
> with auth and pushing & viewing.
>
> At the moment, to make it publicly available I have no auth set up on
> the subdomain.  However when I try push my code I get abort:
> authorization failed
> So I enable auth like so:
>
> auth.backend               = "htpasswd"
> auth.backend.htpasswd.userfile = "/home/hg/repo/lighttpd-htpasswd.user"
>
> lighttpd-htpasswd.user being my .htpasswd file from my old apache
> server.  Then I enable the auth on the subdomain:
>
> $HTTP["host"] =~ "(^|\.)hg.digitalspaghetti\.me\.uk$" {
>         server.document-root = "/var/www/hg"
>         url.rewrite-once = (
>                 "^([/?].*)?$" => "/hgwebdir.cgi$1"
>         )
>
>         server.errorlog = "/var/log/lighttpd/pastemonkey/error.log"
>         accesslog.filename = "/var/log/lighttpd/pastemonkey/access.log"
>        server.error-handler-404 = "/e404.html"
>        auth.require = (   "" => (
>                    "method"  => "basic",
>                    "realm"   => "Mercuial Repo",
>                    "require" => "user=tane|user=bonus"
>                    )
>        )
> }
>
> This now makes pushing possible, however to now view the page you need
> a username and password.  I was thinking I could have 2 subdomains for
> the same repo, and have one with the auth on it for pushing, but that
> seems like a extra step I shouldn't need.
>
> Could anyone help with this?
>
> --
> Tane Piper
> Blog - http://digitalspaghetti.me.uk
> Wii: 4734 3486 7149 1830
>
> This email is: [ ] blogable [ x ] ask first [ ] private
>



-- 
Tane Piper
Blog - http://digitalspaghetti.me.uk
Wii: 4734 3486 7149 1830

This email is: [ ] blogable [ x ] ask first [ ] private


More information about the Mercurial mailing list