About Mercurial HeadQuarter
Mercurial HeadQuarter is a web service to manage Mercurial repositories. It allows to:
- define contact name
- define project description
- setup right access (read and write)
- set which type of archives is allowed
- define encoding charset
- hide/unhide a project
- set the presentation style
- redirect access and error logs to files
- manage user access (only for password file)
Screen-shots
Initial view
Repository list
Repository creation
Repository property edition
General configuration
User management
Download
Source packages
Debian packages
Requirements
To install Mercurial HeadQuarter, one need a functional Apache configuration with a decent PHP module enable and also a working Mercurial command.
There's two ways to install Mercurial and Mercurial HeadQuarter on a system which depend on your ability to modify Apache configuration.
Install with Apache configuration modifications
Install a Mercurial web service
One first need to change the ownership of the whole Mercurial tree to the Apache user (www-data on Debian system). Usually, this tree is located into /var/lib/hg, and this can be done with a simple shell command:
chown -R www-data /var/lib/hg
Then, files hgweb.cgi and hgweb.config from directory hgweb need to be placed into Mercurial tree base, using such command:
cp hgweb/hgweb.* /var/lib/hg
At last, Apache configuration file need to include apache-hg.conf and the authentication section need to be adapted.
Actually, it assumes that accounts are stored into the file /etc/mercurial/password and htpasswd is required to add a user:
hgpasswd /etc/mercurial/password new_user password
LDAP authentication is also detailed in comments but it must be adapted to the local company LDAP server.
If the Mercurial tree base is not /var/lib/hg, the file hgweb.config and also the Apache configuration file needs to be adapted.
Install Mercurial HeadQuarter
To install Mercurial HeadQuarter, one need to copy config.inc.php, favicon.ico, func.php, index.html, script.js, and style.css to an Apache reachable directory (such as /usr/local/share/hghq) and modify the Apache configuration file to include apache-hghq.conf.
A makefile also can help to install properly files and documentation into local directories.
If the install location is not /usr/local/share/hghq, the Apache configuration file needs to be adapted.
Configuration Mercurial HeadQuarter
The configuration is set by config.inc.php:
- HGREPOS must set to the Mercurial tree base (default /var/lib/hg)
- LOGLEVEL defines the log level
- _LOG_NOLOG_ stands for no log message
- _LOG_ERROR_ stands for only error messages
- _LOG_WARN_ stands for error and warning messages
- _LOG_DEBUG_ stands for all messages (even debugging messages)
- LOGFILE defines the file name where logs will be stored
Install without any Apache configuration modification
In a readable and writable Apache director, one needs to copy config.inc.php, favicon.ico, func.php, index.html, script.js, and style.css. Then, open a web browser and go to the index.html, a tab named "config" will help you to configure a Mercurial web service:
- "Root repository" is the directory name where all Mercurial repositories will be stored. It must be owned by Apache user.
- "Base URL name" is base name of the Mercurial URL.
- "Log file" is the name of the file where HgHq will store all messages. To desactivate logging, one can let is empty.
- "Log level" can be 0 for no log, 1 for error messages only, 2 for error and warning messages, and 3 for all logs even debugging informations.
- "Authentification type" could be file or ldap.
- "Authentification file" defines the file where password will be stored.
- "LDAP host name" and "LDAP base request" are relative to the LDAP configuration.
- "Administrators" set the list of users that can log in the HgHq interface.
A minimal apache configuration file shows which permission are needed assuming that hghq is installed in /usr/share/hghq and that mercurial root is /var/lib/hg. Default authentification is ensure by file and admin passsword is 'admin'.
Hints
- By default, all users can read a project but none can write on it
- Usually, one need to read and to write on a project, so one need to do same settings on allow_read and allow_push (respectively deny_read and deny_push).
Changelogs
HgHq 1.6 (Wed, 5 Sep 2012 23:40:07 +0200)
- Add inline documentations
- Add new feature; user management
- Add lock on authentification file
HgHq 1.4 (Tue, 26 Jun 2012 14:14:08 +0200)
- Switch file and ldap fields depending of selected value
- Fix issue with webkit browsers
- Add access control in hghq main directory
- Sort repository list
HgHq 1.2 (Thu, 21 Jun 2012 17:58:48 +0200)
- Add configuration tab
- Correct apache configuration file
- Remove group references as it does not work
- Clean footer
HgHq 1.0 (Fri Jun 15 17:23:36 2012 +0200)
- Initial version