Skip to content

[WiP] cGit or the way to host your own git

   

Disclaimer !

I enjoyed my Gitlab setup, some years ago … my machine slightly less !
I loved and still love to host my own tools but definitely, Gitlab was getting huge and huge - and for sure not because I was pushing lot of code - and update / upgrade became more and more painfully even if the .deb usage gave me a lot of comfort but well, for my usage, Gitlab was and is still too huge. I don’t want to promote non-OSS software so depending 100% on Github was not an option. GitHub is cool to show you have balls and a dick and you know how to use it but that’s not my cup of tea to promote my sexual life publicly and also, I want to keep my data free from any obscure clause. And recent bought of GitHub by Microsoft gave me confirmation that GH is not a safe place. So I ended up last year ( 2017 ) to setup my own frontend for git. I was looking at a light one. I’ve seen the classic Gitweb and a small bunch of PHP ones but did not fall in love with any … And I found cGit and it was a match !
cGit is not a replacement for Gitlab or Github like ( or Gogs OSS effort to implement a GH clone ). No you have a lightweight CGI binary written in pure C acting as a proxy for git command expose the spider web via a HTTP CGI server.

Big picture

Let see how it is articulate :

Depend if you hit cGit via https or ssh URL scheme, before reaching the repo you will have to pass though NGinx or OpenSSH. Both have the same features. You can clone, push, delete what ever you want as far as you have credentials for that. Both are tricky ( in my setup ) so this article is split in two main part :

  • Setup for Web stack
  • Setup for OpenSSH

Web stack

NGinx

Apache CGI

cGit

OpenSSH

OpenLDAP

chroot

NGinx

Well, conclusion now ?

The result is visible on https://git.creamen.net . It’s not that impressive but I love it. I have scripts for provisioning and via ssh command line I can even create a new project - ReST API will come later … Adding an account is quite easy and I hope to be able to add PGP sign feature - even if it not depends on cGit itself.
I mainly mirror some projects I enjoy to work with and keep my stuff locally - Docker files and Bash scripts - and use a git hook to push it back to Github - to show my dick to whoever have interest in it !
I am happy and - more importantly - independent !

LLAP - David-san