I've published my repositories using the command "hg serve --webdir-conf
/var/hg/hgwebdir.config" and I can see all my repositories on <ip
address>:8000. I would like to add authentication so that users will have to
enter their username and password before they can see the repositories.
After some Googling, I see that I need to create a .htacess file that is to
be placed in the folder where the html files are, a .htpasswd that contains
the username and password, and modify the /etc/httpd/conf/httpd.conf file.
My questions are:
1) Where should I put the .htaccess file? I don't know where the html files
are located at.
2) I'm not sure where to modify the httpd.conf file. I know I have to
include the following lines:
AuthName “Authorized Users Only.”
AuthType Basic
AuthUserFile <path>/.htpasswd
<Limit GET POST>
require valid-user
</Limit>
But where do I add these lines?
Please advise.
Thank you.
--
View this message in context: http://mercurial.808500.n3.nabble.com/Adding-authentication-to-hg-serve-tp2166270p2166270.html
Sent from the General mailing list archive at Nabble.com.
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial
'hg serve' does not (and will never) support any form of authentication.
We are intentionally avoiding turning 'hg serve' into a full-featured
web server as so many already exist. So if you want a feature that 'hg
serve' doesn't have (like authentication, proper SSL, virtual hosting,
etc.), you need to use a proper web server.
--
Mathematics is the supreme nostalgia of our time.
Right. hg serve uses Mercurial's built-in webserver, and has nothing at
all to do with Apache or its configuration.
> What is the Apache alternative to hg serve, then?
It's called 'hgweb'. Start here:
http://mercurial.selenic.com/wiki/PublishingRepositories
--
Mathematics is the supreme nostalgia of our time.
> Hi,
>
> I've published my repositories using the command "hg serve --webdir-conf
> /var/hg/hgwebdir.config" and I can see all my repositories on <ip
> address>:8000. I would like to add authentication so that users will have to
> enter their username and password before they can see the repositories.
As Matt writes, there is no built-in support for authentication in 'hg
serve'. However, Henrik Stuart has made an extension for this:
https://bitbucket.org/hstuart/hg-textauth
I have not tried it recently, but please give it a go and let us know
what you think of it.
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/
I included the extension, textauth, in my repo hgrc file.
When I did a hg authedit -c username, I get an error "no authentication file
is specified".
Is this the right command to create the authentication file?
What are the steps after this?
Please advise. Thank you.
--
View this message in context: http://mercurial.808500.n3.nabble.com/Adding-authentication-to-hg-serve-tp2166270p2170800.html
Sent from the General mailing list archive at Nabble.com.
> Hi,
>
> I included the extension, textauth, in my repo hgrc file. When I did a
> hg authedit -c username, I get an error "no authentication file is
> specified". Is this the right command to create the authentication
> file? What are the steps after this?
Yeah, that is a bit cryptic... The error means that you have to setup
textauth.file -- that is, put
[textauth]
file = /some/path/to/my/password/file
into the .hg/hgrc file. See 'hg help textauth' after enabling the
extension.
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/