Moving to cgit

Earlier this year I wrote a blog post on how to set up gitweb in order to be able to view your repositories in a browser. Originally my intent for using gitweb was not for my own personal use but more to be able to share my code with the world. Personally I'll just use SSH to clone my repos and view them locally, but I don't want anyone else to have SSH access to my servers. Gitweb, however, doesn't seem to have any sort of pretty URLs for cloning projects, which makes it challenging for others to pull my code and modify it for their own use or submit patches back to me.

In my search for an alternative, I considered GitLab, but the community edition has too many restrictions for my taste, I'm not interested in paying yet another monthly subscription (especially for something that I'd be self-hosting), there are way too many features, and it requires too many resources (namely RAM). I also looked at BitBucket but I prefer FOSS and anything that isn't written in Java, so I looked at Gitea, which is actually pretty lightweight but again has too many features for my taste. I wanted something super simple and bare-bones so that it's not another security risk I have to constantly keep track of.

Just this weekend I happened to stumble upon cgit, which is actually what the Linux kernel itself uses for a web interface to the repositories. cgit checks all of my boxes: fast, low resource usage, few features, and HTTP cloning for repositories. You can still get some nice things like markdown READMEs and syntax highlighting too, without having to deal with all the other extras usually bolted onto server-side git repos. I'm quite content with this arrangement, so much so that I started working on a dockerized version of it, which ~~I'm hosting on my own personal public instance~~ I used to host myself, where I intent to publish all FOSS that I work on from now on. I'll probably migrate many of my existing projects over here as well, and mirror them to GitHub or GitLab so I don't break any existing links to my work.

If anyone would like to contribute to my docker image for cgit, or has any tips on how it could be improved, please don't hesitate to get in touch via email and/or send me a patch file!

Update May 2022: I actually stopped self-hosting my git repos. I have taken a more pragmatic approach that I wrote about here