diff -r 719ced1ac5c3 -r 3f7b202af99e deb/apache-register-hg.bash --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deb/apache-register-hg.bash Sun May 07 11:16:52 2023 +0300 @@ -0,0 +1,52 @@ +#!/bin/bash + +set -x + +mkdir -p /srv/hg +chown user:user /srv/hg + +cat </srv/hg/hgweb.cgi +#!/usr/bin/env python +# See also https://mercurial-scm.org/wiki/PublishingRepositories + +# Path to repo or hgweb config to serve (see 'hg help hgweb') +config = "/srv/hg/hgweb.config" + +from mercurial import demandimport; demandimport.enable() +from mercurial.hgweb import hgweb, wsgicgi +application = hgweb(config) +wsgicgi.launch(application) +EOF +chmod a+xr /srv/hg/hgweb.cgi + +cat </srv/hg/hgweb.config +[paths] +/ = /srv/hg/* + +[web] +style = gitweb +encoding = "UTF-8" + +baseurl = / + +deny_push = * +allow_archive = bz2, gz, zip +EOF +chmod a+r /srv/hg/hgweb.config + +cat </etc/apache2/sites-available/hg.conf + + DocumentRoot /srv/hg + + ScriptAliasMatch ^/(.*) /srv/hg/hgweb.cgi$1 + + + Options ExecCGI FollowSymLinks + Require all granted + AllowOverride None + + +EOF + +a2ensite hg +# service apache2 restart