git On A Soekris 4501

Contents

Introduction

In a previous article, we installed cgit on a Soekris 4501 fractional horsepower server, and we left off with pointing the browser at our shiny new install showing a “No repositories found” message. Not a big surprise, since we don’t have git installed, and there are no repositories to browse.

In this tutorial, we’ll go over the very simple steps required to install and configure git, and we’ll be setting up a repository as well. If it all works, you’ll be running git on your Soekris 4501 in about 15 minutes.

One thing to note is that the Soekris 4501 is a pretty old bit of hardware, and has no hard drive. I got around this by doing an nfs mount of a directory on my DLink DNS-323 NAS box. This article assumes you have some basic Linux skills and can set up nfs if I tell you where git expects to put its repositories on the Soekris 4501.

Resources

Installing git On The Soekris 4501

This really could not be easier. We’re not using apt-get directly because we want to avoid using up valuable space on the CF card that the Soekris 4501 uses. Here’s the basic recipe using wget:

That’s it for the install portion of the tutorial – next we’ll configure git

Configuring git On The Soekris 4501

The first thing we need to do is set up a user called git on this machine.

We’d like to be able to log in as git over ssh, and the best way to do that is to use
with a shared key mechanism. It’s best if you have one public/private key pair
for your userid on all the machines you use. For every account you plan to use to access
the git server from, you’ll need to get the public key of that account on to the
git server.

As noted in the script above, you’ll need to figure out how to get your public key
into the authorize_keys file. That way it’s up to you to decide on the
most secure way of doing it.

Creating a Bare git Repository

That’s just about all there is to it, except for a recipe to create a bare repository. This
little script creates a repository (you can change the name) in /var/www/git/repos
and initializes it.

Now point your browser at this address (yours might be a bit different)

192.168.xx.yy/cgit

.. and this time you’ll see the default myrepo repository. There’s nothing in it yet, so
the next step is to set up a client to allow us to interact with our repository.