Skip to content

Instantly share code, notes, and snippets.

@md1023
Created May 5, 2016 06:25
Show Gist options
  • Save md1023/5f7e80f6f2321755e526e6b5194f4e1c to your computer and use it in GitHub Desktop.
Save md1023/5f7e80f6f2321755e526e6b5194f4e1c to your computer and use it in GitHub Desktop.
Mercurial example configuration
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
os.environ['HGENCODING'] = 'utf-8'
from mercurial import extensions, ui as uimod
ui = uimod.ui()
ui.readconfig("/etc/mercurial/hgrc")
extensions.loadall(ui)
from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
application = hgwebdir("/hg/hgwebdir.conf", baseui=ui)
Listen 8008
<VirtualHost *:8008>
ServerAdmin m-nikolaev@inwin405a17
DocumentRoot /hg/
# use default-push with ssh
# SSLEngine on
# SSLCertificateFile "/hg/srv69.crt"
# SSLCertificateKeyFile "/hg/srv69.key"
WSGIProcessGroup hg
WSGIDaemonProcess hg
WSGIScriptAliasMatch ^(.*) /hg/hgwebdir.wsgi$1
ErrorLog /var/log/apache2/mercurial.log
<Directory /hg>
Options ExecCGI FollowSymlinks
AddHandler wsgi-script .wsgi
Order allow,deny
Allow from all
Require all granted
Satisfy Any
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName 192.168.0.69
Redirect "/hg" "http://192.168.0.69:8008"
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment