4

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!

Martin Geisler
  • 1,271
  • 9
  • 23
Phil
  • 183
  • 11

2 Answers2

2

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>
aligot
  • 318
  • 1
  • 7
1

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

thinice
  • 4,676
  • 20
  • 38