Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've read an enormous amount of articles but I seem to sidetrack more and more the more I try.

I'm trying to serve mercurial repos through HTTP. I'm using it together with redmine.

I've installed mercurial-server. I've set up a repo that I can't connect to from the outside. When I try to browse to that address I can see the index.html I put in the directory but when I use TortoiseHg and browse to the same address I get a 404. Am I supposed to point to a specific file? I've only tried pointing to the directory like so "http://www.example.com/hg/repo/".

Right now I'm only trying to pull the repo but I'd like to be able to push through HTTP temporarily if that is possible.

How will I set up user push access (through HTTPS) to the repo? Do the users have to exist on the linux machine? This is where the articles and tutorials confuse me as some mention "mercurial users" and others create own users on the machine serving the repo. I'd like to use the simplest scenario possible..

Please be as detailed as possible.. I'll greatly appreciate any help on the subject!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

in the following working example you need a valid authentification to pull (see Require valid-user) and a valid authentication with a user of the group private to push (see Limit directive).

<Directory /var/www/sources.XXXXXXXXx/www/private/>
RewriteEngine on
        RewriteBase /private
        RewriteRule ^$ hgwebdiri.cgi  [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule (.*) hgwebdir.cgi/$1  [QSA,L]
        Options FollowSymLinks +ExecCGI
        AddHandler cgi-script .cgi
        DirectoryIndex hgwebdir.cgi
        AllowOverride None
#       Order allow,deny
#       Allow from all
        AuthUserFile /etc/mercurial/hgweb.htpasswd
        AuthGroupFile /etc/mercurial/hgweb.htgroup
        AuthName "XXXXXXXXXXXXXx private sources"
        AuthType Basic
        Require valid-user
    <Limit POST PUT>
                Require group private
        </Limit>
</Directory>
share|improve this answer

Don't forget to put 'allow_push' in either the global hgrc or the hosted repo's hgrc file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.