octobus/mercurial-mirror

By octobus

Updated over 2 years ago

Mercurial repositories mirroring based on mercurial-http-server

Image

197

Mercurial mirror HTTP server

This image is based on mercurial-http-server and adds basic utilities to mirror some upstream repositories.

It can connect to upstream repositories over HTTP(S) and SSH (see below for SSH configuration).

How to persist the served repositories

This is exactly as for mercurial-http-server, from which this image is derived.

How to configure the repositories to mirror

These are specified in the conf/mirror_repos.txt file. You can customize it as other files in this directory, see mercurial-http-server

How to init or refresh the mirrors

Assuming you have a container named hg-mirror running this image, like this:

docker exec -it hg-mirror /usr/bin/python check_repo.py

This applies both to the case where you have new upstream repositories to mirror or to refresh the server's repositories with new changeset from upstream.

It is typical usage to run this command from a crontab or a systemd timer or whatever periodic job runner is available. In other words, the scheduling itself is not provided by this image.

How to configure SSH

In some cases, it is useful to mirror upstream repositories that are accessible through SSH only, but that requires populating the .ssh directory with config and keys.

In that case, the simplest is probably to make your own dependent Docker image with a Dockerfile along the lines of

FROM octobus/mercurial-mirror:latest

USER root

COPY ssh_dir /home/mercurial/.ssh

RUN chown -R mercurial:mercurial /home/mercurial/.ssh && \
    chmod -R o-w /home/mercurial/.ssh && \
    chmod -R g-w /home/mercurial/.ssh

USER mercurial

How to tune the web server

Nothing special, see the documentation of mercurial-http-server

Docker Pull Command

docker pull octobus/mercurial-mirror