Options For Self-Hosting Code Repositories
I’m considering something that some might say is stupid: I’m looking at options for self-hosting my personal code repositories.
I’m coming around to the idea of having my own domain for things like Go packages. It’ll provide more opportunities for adding some structure to my repos, rather than having them all hang off a single github.com/lmika
namespace. Plus, my personal code management system is reasonably good at the moment so, naturally, the time has come to change all that 😛.
One option is to setup something myself. An idea I have is to get Forgejo running in a VPS managed by Hetzner. I had a go setting up Forgejo up to run on an empty Ubuntu server with PostgreSQL, but I didn’t get very far as I’d also have to setup things like a non-root user account, Nginx reverse proxies, and SSL certificate provisioning — stuff I can do, but all very tedious. Also, Forgejo’s installation guide is pretty incomplete. Good instructions for download it and setting up the database, but very little after that (where were the instructions about requiring a non-root account? That would have been nice to tell me).
I also tried getting the Docker image running it with Dokku. That took care of the reverse proxy and user account, and I managed to log into the frontend, but I couldn’t get Git to checkout a test repo using SSH. I suspect the SSH listener in the Docker container will need to be on a separate port to the SSH listener on the host; and both the container and host will need separate domain names, since I’d probably need to setup different SSH configs to use Git for both of them. Anyway, I haven’t completely written this approach off, and I may have another go at it if I want to host it myself.
One other thing I’d like to get working is a CI/CD pipeline. I got quite used to having GitHub Actions run the tests when I push commits, and having something similar would be really nice. It looks like Forgeio is building an integrated CI/CD pipeline which is exciting. But the question becomes where the runners should go. Separate host? That’ll start to make things a little expensive. I guess I can start without them, at least for the moment.
Another option is Gna, which offers managed instances of Forgejo and Woodpecker CI. It’s €10.00 /month, which is a decent price for something managed. But I do have questions about the company. Not that I’m worried about them snooping or anything, and the fact that they’re charging me means they have a business plan. But will they be around in 5 years? Granted these feelings are coming from visiting their website, but it does feel a little slapped together. Hmm.
The third option is going with GitLab. Hetzner seems to offer that as a one-click option, as does Digital Ocean (well, the Enterprise edition), and yeah that might work. I did create a GitLab instance for a hackathon once, so it’s something I could probably manage. But I don’t really love GitLab’s UI. I don’t know why I’m put off by it; after all, it’s not like Gitea’s UI is particularly special (I’m sorry, but everything looks so amateur. Please work on the padding of your elements). Maybe I can learn to love it if it means administering the thing would be easier.
Anyway, that’s the current feeling. We’ll see if I go through with any of this.