pcd6623
pcd6623

Reputation: 746

How to setup a Mercurial "server" that allows for authenticated push without apache?

I'm trying to propose switching from CVS and SVN to Mercurial at work. Before I do, I'd like to have any foreseeable questions answered.

How can I set up a repository to allow push and authenticate users?

I'm more familiar with administering SVN, and in SVN it was just a few lines like:

[users]
userA = passwordA
userB = passwordB

And then for permissions it was like:

[general]
userA = write
userB = read

I would really like something like svnserve that allowed me to circumvent using a full-blown apache, since all I need is a central location for pushing change sets. I know that Mercurial doesn't necessarily require a central location, but I think it would be convenient in my workplace.

Thanks!

Upvotes: 4

Views: 2213

Answers (4)

Martin Geisler
Martin Geisler

Reputation: 73748

You can try the textauth extension. Please give it a go and send some feedback to Mercurial mailing list, then perhaps you will see it integrated into a coming release of Mercurial.

Upvotes: 0

Andrey Vlasovskikh
Andrey Vlasovskikh

Reputation: 16838

As @nlucaroni mentioned in the comment, one option is using SSH authentication. It allows authenticated pull and push. We use it in our company together with Apache-hosted HTTP access for anonymous pull-only repositories. See the "ssh" solution at the Publishing Mercurial Repositories.

Upvotes: 1

Brian Chavez
Brian Chavez

Reputation: 8573

Try using SCM Manager. It works well for Mercurial. It has a built-in HTTP/HTTPS server and allows you to manage authentication. The only requirement is Java.

http://www.scm-manager.org
https://bitbucket.org/sdorra/scm-manager

Briefly, to setup Mercurial with authentication:

  1. Follow the Getting Started Guide here. If you're using Windows, be sure to use
    scm-server\bin\scm-server.bat to start SCM Manager.

  2. Click on Repository Types > Mercurial Settings > Start Configuration Wizard > Select: Download and Install to install the Mercurial plugin for SCM Manager.

  3. Be patient, downloading takes a while.

  4. When it's finished installing, the screen will go back to the Repository Config window. Restart SCM Manager. After you restart and you should now be able to create and host Mercurial repositories over HTTP.

  5. Double check security:
    General > Config and uncheck Allow Anonymous Access.
    Security > Users and deactivate anonymous.

You can also use SCM Manager to host Git and SVN repositories as well.

Upvotes: 3

RyanWilcox
RyanWilcox

Reputation: 13972

Mercurial Server is an awesome solution, which I've used on a few occasions.

Upvotes: 1

Related Questions