Brandon Invergo

Setting up Fossil repository hosting

Following up from a previous news item, and continuing in my effort to reduce my dependency on external web services, I have once again moved my code. I had previously (mostly) switched from Github to Gitorious. The reasoning was that Gitorious offered better project organization and also that it was based on free software. Ultimately, I didn't use the organization very much like I had originally intended. Furthermore, Gitorious lacked other features that I wanted, such as a bug tracker.

So, I've made yet another change. Now, all of my code is hosted here at repos.invergo.net (note that the site uses a self-signed certificate, so your browser will give you a warning that you can safely ignore (if you trust me); just add a security exception in your browser as instructed) using Fossil. Fossil offered several advantages in my mind. It consists of just a single, statically linked binary, meaning there's just one thing to download there's nothing to properly install. The binary includes a web server, a wiki, and a bug-tracker, in addition to the usual version control system.

With Fossil, I was able to simply put the binary in my PATH on my shared web server, without having to do any complicated install process. I put all of my repositories (.fossil files) in a single directory on my server. I then set up a simple, two-line CGI script, to serve all of the repos:

#!/path/to/fossil
directory: /path/to/fossil-repos/
notfound: http://repos.invergo.net/index.html

The last line serves up a default page if a non-existant repository is specified. In this case, I serve up an index of the existing repos.

So, now the grotesque.fossil repository is automatically served from https://repos.invergo.net/grotesque with no further effort on my part, aside from a bit of .htaccess work:

<Files fossil>
       SetHandler cgi-script
</Files>
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/fossil/
    RewriteCond %{REQUEST_URI} !^/index.html
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST} ^(www\.)?repos.invergo\.

    RewriteRule ^(.*)$ https://repos.invergo.net/fossil/ [L]
</IfModule>

This rule also makes sure that any visit is automatically rewritten to use HTTPS. Since one can log into these repos, and since I have to send login information when I'm syncing with the repo from my local copy, I set up access via SSL. That way the login information is encrypted.

What's nice is that, once a project reaches some amount of maturity and I want to give it its own subdomain, such as Grotesque at http://grotesque.invergo.net, I can serve it up from the same Fossil repository. So, that subdomain has its own CGI script that is just serving from the Grotesque repository. Unfortunately, my SSL certificate only covers the https://repos.invergo.net subdomain, so access to the main Grotesque site is not secure.

As mentioned previously, each repository has a built-in wiki and bug tracker, which is great. They look a bit "bare-boned" but they are certainly functional. Anonymous login is provided, meaning that the user does not need an account just to file a bug report. When you have a personal, local clone of the repository, it includes the wiki and the bug tracker. Thus, both of these features are also under version control (though in a slightly different manner from the code that you check in; they have to commit versions, for example). You can do all the usual stuff, such as automatically referring to commits in bug reports and vice versa.

It also can't be stressed enough that it is nice to get away from the unnecessary complication of git. I'm sure that it comes in handy for big projects but, let's be honest, the vast majority of free software projects never grow beyond a couple of developers, for which git is complete overkill. Not to mention, if you're interested in hosting your own repositories, it's not so simple to set up git, particularly on a shared web server. That said, the one feature of git that I miss is the cheap branching. In Fossil, one works with branches in the more traditional way of creating the branch and then checking out that branch in another directory.

To anyone who is working on software projects who is interested in hosting their own repositories, I cannot give Fossil a higher recommendation. It gives you a nicely integrated set of tools for maintaining your software projects. It's easier to get up and running than git (or hg or bzr) and separate wiki and bug-tracking tools or a full service like Gitorious, particularly on shared servers where you don't have root access. Unlike using 3rd-party services like Github, Gitorious or Bitbucket, you are in control of your own repositories. And of course, unlike Github and Bitbucket, it's free software.

Creative Commons License
Setting up Fossil repository hosting by Brandon Invergo is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.