indefero/doc/syncmercurial.mdtext

65 lines
2.2 KiB
Plaintext
Raw Normal View History

# Plugin SyncMercurial by Benjamin Jorand
The SyncMercurial plugin allows the direct creation and synchronisation of
mercurial repositories with the InDefero database. The repositories will be
published by hgwebdir.cgi using HTTP. It also handles private repositories.
SyncMercurial is adapted from SyncSvn by Baptiste Michaud.
## To Contact the Author
Benjamin Jorand <benjamin.jorand@gmail.com>
## Apache configuration
The simple way to share Mercurial repositories is to publish them
using HTTP and `hgwebdir.cgi`.
It first requires a config file called hgweb.config in the same
directory where you put hgwebdir.cgi (for example,
`/home/indefero/scripts`):
[collections]
/home/indefero/repositories/mercurial/ = /home/indefero/repositories/mercurial/
Then configure a vhost this way :
ScriptAliasMatch ^/hg(.*) /home/indefero/scripts/hgwebdir.cgi$1
<Directory /home/indefero/scripts>
Options +ExecCGI
AuthName "Restricted"
AuthType Basic
AuthUserFile /home/indefero/auth/.htpasswd
<Limit PUT POST>
Require valid-user
</Limit>
</Directory>
Enable the authentification for private repositories :
Include /home/indefero/scripts/private_indefero.conf
## InDefero configuration
First, you need to install the File_Passwd PEAR package:
$ sudo pear install File_Passwd
Then, based on the paths provided in the Apache configuration, you
need to put the following lines in your configuration file:
$cfg['idf_plugin_syncmercurial_passwd_file'] = '/home/indefero/auth/.htpasswd';
$cfg['idf_plugin_syncmercurial_path'] = '/home/indefero/repositories/mercurial';
$cfg['idf_plugin_syncmercurial_private_include'] = '/home/indefero/scripts/private_indefero.conf';
$cfg['idf_plugin_syncmercurial_private_notify'] = '/home/indefero/tmp/notify.tmp';
$cfg['idf_plugin_syncmercurial_private_url'] = '/hg/%s';
## Cron configuration
As InDefero modifies the private_indefero.conf, apache needs to be reloaded.
Each time this file is modified, a temporary file is created.
*/5 * * * * /bin/sh /home/indefero/src/cron/SyncMercurial.sh
Edit this script and add correct values to `private_notify` and `reload_cmd`.