cgit On A Soekris 4501

Contents

Introduction

In this tutorial we’ll be building cgit – a web frontend for git repositories. As usual, the build will happen on the Voyage SDK VM, and from there it will be installed to the Soekris 4501 server. The Soekris 4501 is a 486 class machine with 64 MB of RAM and boots from a CF card. It’s an example of a fractional horsepower server.

Although you don’t strictly need git already installed on your build machine, it helps. The reason is that cgit needs the git source, and of course you need to have git installed to retrieve it.

We’ll walk through installing and configuring git on the Voyage SDK VM. After that, we’ll download and build cgit on the Voyage SDK VM, and then install it as a Debian package on the Soekris 4501.

In another tutorial, we’ll install git on the Soekris 4501 so that it can be our own remote git server.

Resources

Installing git On The Voyage SDK Machine

OK, this one is pretty easy – it’s just a matter of:

For now, that’s all we need to do. In another article we’ll discuss setting up the Soekris 4501 as a git host and then we’ll set up the git client.

Building cgit On The Voyage SDK Machine

The cgit Installation and Build instructions are the best reference for what we’re going to do next, so there’s no point duplicating them here, but I’ll give the basic recipe for retrieving the source tree to get us started:

This results in a git directory under projects that is a complete repository of the current cgit development. From there, it’s a simple matter of following the instructions on the cgit site.

When building cgit from source, there are two choices. Either initialize the git module in the cgit repository, or use make get-git to retrieve the latest compatible git source. I prefer the second option because it’s a bit faster.

To retrieve the git source, you’ll need to install the curl package on the Voyage SDK machine, and building cgit requires development versions of some libraries so that we can use the C header files. Here’s the recipe to get the rest of cgit‘s dependencies in place before building:

Once that’s done we could install cgit right away, but the destination is actually the Soekris 4501. And unfortunately there’s no easy way to make a Debian package for cgit. But we can easily deal with the few files that cgit actually installs by looking in the Makefile to figure out what the install target does. Here’s the original contents:

Not too bad. It creates three directories, then copies three files and a directory to them.

What we’ll do is copy these files and directories to – you guessed it – an nfs share along with a little shell script to install them in the right places when the script runs on the Soekris 4501. This part assumes you already have an nfs share at /home/nfs/Soekris4501/packages. Just copy the script and paste it into your shell to run it.

OK, that’s the hard part – next we install and configure cgit and Hiawatha on the Soekris 4501.

Installing cgit On The Soekris4501

From this point forward, we’ll be working as root on the Soekris 4501 – remember to remountrw or you won’t be able to save your changes. The rest of the tutorial assumes that you’ve got an nfs share mounted on the Soekris 4501 at /var/www – that’s the standard place for a Debian web server to keep its files.

In my case, that’s a DLink DNS232 – not the fastest NAS around, but it’s cheap and reliable.

Navigate to the nfs share at /home/nfs/Soekris4501/packages/cgit that we have set up in other tutorials on the Voyage SDK machine. You should see the cgit install files plus the install.sh that was created when we ran the script at the end of the previous section.

After a bit of whirring and clicking on the NAS the files should all be in their correct places. Now all we need to do is install the Hiawatha and cgit config files and we’re ready to roll.

Here is a script to write out my current Hiawatha config file (comments stripped out). It will create a backup before overwriting your existing file.

Here is a script to write out my current cgitrc config file (comments stripped out). It will create a backup before overwriting your existing file.

That’s it – you should be able to point your browser at the following URL and at least see the cgit logo and a “No repositories found” message. Your IP address might be different:

192.168..xx.yy/cgit

Next, we’ll tackle installing and configuring git repositories on the Soekris 4501, as well as dealing with authentication.