This document covers the configuration process for


  • hgsrht-periodic: The recommended configuration is */20 * * * * hgsrht-periodic.
  • hgsrht-clonebundles (optional): It is recommend to run this job daily.


Note: If was installed in a package, you may skip this section.

As a repository hosting service, requires a place for storing repositories (we recommend /var/lib/mercurial/). It also requires a hg user who has ownership over the repository storage location.

#SSH Dispatch

At the moment, uses's SSH dispatcher, which you need to set up as the system-wide SSH authorization hook. See's Configuration page for more information.

Once this is done, you need to make the authorization hook be part of the SSH dispatching, via the hgsrht-keys and hgsrht-shell scripts. See the [dispatch] section of your configuration for more details.

Authorization logs are written to hg-srht-shell.

#HTTP(S) Cloning does not do HTTP(S) cloning for you, so you'll need to set it up yourself in Nginx. Here's an example Nginx configuration:

location = /authorize {
		proxy_pass_request_body off;
		proxy_set_header Content-Length "";
		proxy_set_header X-Original-URI $request_uri;

location ~ ^/[~^][a-z0-9_]+/[a-zA-Z0-9_.-]+/\.hg.*$ {
		auth_request /authorize;
		root /var/lib/mercurial;

It is important that you set up the /authorize endpoint to enforce the privacy of private repositories.

About this wiki

commit b345d3de11bc0e7dbf344de75c30cf7e3620fa7b
Author: Conrad Hoffmann <>
Date:   2022-05-12T10:04:02+02:00

Add link to package installation instructions

Besides being a bit more convenient, it also adds a little emphasis to
this specific bullet point :)
Clone this wiki (read-only) (read/write)