Setting Up A Source Control Server with Domino LDAP : Part 7

By now you have your Mercurial Source Control server up and running, If you go to http://yourserver/admin and log in you should be able to create a new repository. Go ahead and create a test repository and then load up Domino Designer.

Before you can use Source Control in Domino Designer you will need to make sure that you have installed the Source Control Enablement Plugin for Domino Designer V8.5.2. ( if you are on the 8.5.3 Managed Beta this plugin is already installed for you however as it is a beta this capability may not be present in the final 8.5.3 release. The Source Control abilities in 8.5.3 were announced at Lotusphere 2011 with the same disclaimer.). Download the plugin and install it as per the instructions on the OpenNTF website.

The Source Control Enablement Plugin is only half of the solution, all it does is convert the .NSF file into an on-disk project that can be seen by your Eclipse source control system. Once you have installed this plugin you still need to install your Source Control plugin. As we are running a Mercurial Source Control server we’ll need a Mercurial Source Control plugin. Here I recommend MercurialEclipse which is easy to install. Just click on the File – Application – Install menu option in Domino Designer and select the option to search for new features to install. Then in the next dialog box create a new Update Site that points to http://cbes.javaforge.com/update and then click next. Select the new features and install them and restart Domino Designer when prompted. You now have Domino Designer setup for Source Control, in the next section I’ll show you how to link an NSF to your Mercurial server.

As a side note, you can install multiple Source Control solutions in your Domino Designer client, so if you need Mercurial Source Control for one project but need SVN Source Control for another project then this is no problem, you just need to install both Eclipse plugins.

Tagged with: , , ,
Posted in None

Setting Up A Source Control Server with Domino LDAP : Part 6

So now we need to configure phphgadmin so it will work with our Mercurial server. lets start by editing the configuration file.

sudo vi /var/www/wordpress/admin/application/config/phphgadmin.php

There are quite a few edits that we need to do to this file to get everything working. First we need to set the base URL so find the line starting $config[‘base_url’] and set the value to something like

$config[‘base_url’] = “http://yourserver/admin/”

When you create a new repository your can have a number of default values preset by changing the following lines. I suggest setting allowpull to ‘true’ to allow people to clone the repositories and push_ssl to false to allow contributors to push changes to the repository over http. the allow_read should be set to * to allow anybody, including anonymous, to clone the repository and the allow_push can either be * to allow all authenticated users push changes back up to the repository or you can put in usernames to restrict it to specific people.

$config[‘default_hgrc’][‘general’][‘paths’][‘default’] = ‘%1$s%2$s’;
$config[‘default_hgrc’][‘general’][‘web’][‘allow_archive’] = ”;
$config[‘default_hgrc’][‘general’][‘web’][‘allow_push’] = ‘*’;
$config[‘default_hgrc’][‘general’][‘web’][‘allowpull’] = ‘true’;
$config[‘default_hgrc’][‘general’][‘web’][‘allow_read’] = ‘*’;
$config[‘default_hgrc’][‘general’][‘web’][‘contact’] = ‘your@email.address’;
$config[‘default_hgrc’][‘general’][‘web’][‘description’] = ”;
$config[‘default_hgrc’][‘general’][‘web’][‘name’] = ‘%2$s’;
$config[‘default_hgrc’][‘general’][‘web’][‘push_ssl’] = ‘false’;
$config[‘default_hgrc’][‘general’][‘web’][‘style’] = ‘monoblue’;
Next scroll down through the file till you find the lines starting with $config[‘profile’][‘default’] and edit the lines to read as follows, making sure to change the url to your servers url.
$config[‘profile’][‘default’][‘ini’] = ‘/var/hg/hgweb.config’;
$config[‘profile’][‘default’][‘default_repo_dir’] = ‘/var/hg/repos/’;
$config[‘profile’][‘default’][‘hgserve_url’] = ‘http://yourserver/hg/’;
$config[‘profile’][‘default’][‘default_hgrc’] = $config[‘default_hgrc’][‘general’];

You should also delete the 4 lines that start with $config[‘profile’][‘test’] as we don’t need them.

Save the file and then perform the following commands to enable the Apache Rewrite module and restart the apache server. You also need to give special permissions to a lock directory for phphgadmin.

sudo chown www-data:www-data /var/www/wordpress/admin/lock
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

You should now be able to go to http://yourserver/admin and be able to create new Mercurial repositories.

Tagged with: , , , , ,
Posted in Uncategorized

Setting Up A Source Control Server with Domino LDAP : Part 5

At this stage we now have a fully functioning Mercurial server but we have not created any repositories yet. A repository is where you sync your source code to, you need one for each application/NSF that you’ll be building. We could create them manually using the ‘hg init’ command but if you have a lot of projects then this can become a tedious process of having to log into the server every time somebody needs a new repository. Instead I’m going to install phpHGAdmin. It’s a PHP based management system for Mercurial. This step in the process is a little complex but once it’s complete you’ll find managing the system will be a lot easier.

First off we need to download the phpHGAdmin software. The command below will download the version current at the time of writing this entry but if it dosen’t work then you can find the latest version on https://bitbucket.org/joshjcarrier/phphgadmin/downloads and substitute the newer url in the command.

wget https://bitbucket.org/joshjcarrier/phphgadmin/downloads/phphgadmin-1.1.20100623.zip

Once it has downloaded we can unzip it using the unzip command. The unzip command if not installed by default on Ubuntu Server so before we can unzip the software we’ll need to install unzip.

sudo unzip phphgadmin-1.1.20100623.zip -d /var/www

The files have been unzipped into the /var/www folder and now we need to make Apache aware of the new folder and setup a couple of special Apache settings. Lets edit the /etc/apache2/sites-available/default file again and add in some special directives for phphgadmin.

sudo vi /etc/apache2/sites-available/default

and add the following lines below the section just above the ScriptAlias line, replace the ‘username’ in the ‘require user username’ line with the username of the person you want to have administrative rights to the system.

AllowOverride All
order deny,allow
allow from all

AuthBasicProvider ldap
AuthType Basic
AuthzLDAPAuthoritative off
AuthName “Mercurial Server”
require user username
AuthLDAPURL “ldap://yourserver.com:389/O=YourOrg?CN?sub?(objectClass=*)” NONE

Save the file once you are done. Before we restart Apache we need to enable the rewrite module. Here’s the command to turn that module on and then restart Apache.

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

At this stage Apache knows about the PHGHGAdmin application but if you go to http://yourserver/admin you will get an error message as we still have to configure the application. I’ll show you how to do this in the next part.

Tagged with: , , , , ,
Posted in Uncategorized

Setting Up A Source Control Server with Domino LDAP : Part 4

Now that we have our Apache server with Mercurial up and running its time to secure it. We are going to do this using LDAP pointing to our Domino server so make sure your running LDAP on your Domino server before going any further. Once you know your LDAP server is working fine go back to your Ubuntu server and edit the Apache default site with the following command ( again you can use pico in place of vi if you wish )

sudo vi /etc/apache2/sites-available/default

Find the group of lines that start with and add these lines into that group

AuthBasicProvider ldap
AuthType Basic
AuthzLDAPAuthoritative off
AuthName “Mercurial Server”
require valid-user
AuthLDAPURL “ldap://yourserver.com:389/O=YourOrg?CN?sub?(objectClass=*)” NONE

In the AuthLDAPURL line make sure you change it to use your LDAP server and root org. This particular LDAP setup uses the Common Name for the login user name. If you want to change it to shortname or email address you can adjust the CN part of the LDAP setup. Once you have made the changes go ahead and save the file.

We now need to enable the LDAP module in Apache and then restart the Apache server.

sudo a2enmod ldap
sudo a2enmod authnz_ldap
sudo /etc/init.d/apache2 restart

Now if you try to hit your Apache/Mercurial server using your web browser you should get prompted for a username and password. Try entering something that is not in your Domino Directory and the login should fail. Then try entering in something that is in your Domino Directory and you should be able to hit the Mercurial repositories list. If you have used CN for the login name as in the example above then dont forget you need to use the full common name like ‘Declan Sciolla-Lynch’ as the user name or the login will fail.

If everything is working then congratulations. You now have a Source Control Management server using Mercurial that is setup to use Domino LDAP as your authentication point…

But we are not finished yet. In the next few parts we will install a handy tool called phpHGAdmin which will make creating new Mercurial repositories on your server easier then having to learn Hg commands and having to edit the hgweb.config file manually all the time.

Tagged with: , , , , ,
Posted in Uncategorized
Archives