Allow HTTP Push with Mercurial Server

By  on  

I have always loved git but my present work at Mozilla requires me to use mercurial.  If you weren't already aware, Firefox code is managed through mercurial!  I was recently tasked with standing up a mercurial server within a docker container and ran into an issue:  mercurial rejected pushes to the local docker container via HTTP.  Since HTTPS wasn't configured for the docker container locally, I needed to figure out how to get mercurial to allow HTTP pushes.

To allow HTTP pushes to a mercurial repo, modify the mercurial server's hgweb.conf configuration file to include:

[web]
allow_push = *
push_ssl = false

This configuration will allow you to push to your mercurial repository without SSL.  If you don't run your mercurial server with a specific hgweb.conf now, you can run mercurial server with a special config via:

exec hg serve --web-conf path/to/hgweb.conf

HTTPS is the way to go these days but for local development it shouldn't be a requirement.  I hope this helps someone!

Recent Features

  • By
    Welcome to My New Office

    My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...

  • By
    Camera and Video Control with HTML5

    Client-side APIs on mobile and desktop devices are quickly providing the same APIs.  Of course our mobile devices got access to some of these APIs first, but those APIs are slowly making their way to the desktop.  One of those APIs is the getUserMedia API...

Incredible Demos

  • By
    Styling CSS Print Page Breaks

    It's important to construct your websites in a fashion that lends well to print. I use a page-break CSS class on my websites to tell the browser to insert a page break at strategic points on the page. During the development of my...

  • By
    Create a Brilliant Sprited, CSS-Powered Firefox Animation

    Mozilla recently formally announced Firefox OS and its partners at Mobile World Congress and I couldn't be more excited.  Firefox OS is going to change the lives of people in developing countries, hopefully making a name for itself in the US as well.  The...

Discussion

  1. Josh

    This is useful.
    With the impending BitBucket deletion of mercurial repos I’m looking to migrate to a private server on my intranet.
    I’d like to stand up a docker container for this, but struggling to find an official container. What did you use?

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!