In order to publish the source code for the personal finance scripts I’ve been working on, I needed to set up a git repository. I don’t want to use a proprietary service like Github to publish my libre software. So until the project is popular enough to justify inclusion into an umbrella project like GNU or Kolab, I figured I’d host it myself on my inexpensive Scaleway ARM server.
I like content addressable networks, and it would be really neat to host the git repository on something like IPFS. But my experience to date with IPFS is that it’s not production ready. So for now, cgit via HTTP seems to be the path of least resistance.
The process of setting up cgit on a Debian server wasn’t as well documented as I had hoped. So here is a brief, after-the-fact writeup to hopefully improve the available documentation. I wasn’t exact in recording my steps, so there may be typos or omissions. Please let me know if you find any and I’ll try to quickly fix them.
First, I installed Apache and cgit. (If both were equally easy to deploy, I might prefer nginx to Apache, but the cgit Debian package ships an Apache configuration file, making it the easier-to-deploy option.)
sudo apt-get install apache2 cgit
Next, I needed to enable CGI. This is an essential step that I didn’t see documented in many of the blog howtos that my searches found, but it was mentioned on the excellent Arch Wiki article.
cd /etc/apache2/mods-enabled ln -s ../mods-available/cgi.load
The last essential configuration step was to enable the cgit configuration file.
cd /etc/apache2/conf-enabled ln -s ../conf-available/cgit.conf
This is optional, but I edited the default configuration to use
/git/ instead of
/cgit/. Restarting Apache was necessary to have the configuration changes take effect.
service apache2 restart
Here is the result: http://18.104.22.168/git/. I may try to set up covlibre.net DNS to point to that one day, but the static IP should suffice for now.