Introduction

For the longest time as I have ventured deeper into and grown the various number of self-hosted services, I struggled with on principle task the most: version control. How could I track various configuration files or scripts that I knew worked? How could I track this website as it grows?

Previous me would have just had layers of versions of files: configv1, configv1.1, configv2, etc. Technically this could work, but there is definitely a better way. A few years ago I stumbled upon Git. Remember that I am not a software developer by any stretch of the imagination and my coding/computer skills have mostly been self taught. I am sure just about every college grad doing any sort of coding would immediately know what it was and how to use it. Me on the other hand… not so much. I really struggled to learn the various commands and how it could be of use early on.

I mostly stuck to the default command line git early on. Those repositories were mostly on my local on my machine. They were additional files I had to purposely go out of my way to backup. What I wanted was a good way to maintain these with some sort of GUI that would centrally manage them allowing for access from any machine on my network. I could leverage Github, but I tend to want to self host as much as possible.

My Setup

One day I will outline my home networking setup, but the core server I run at home is Unraid. There are a variety of reasons why I have settled on Unraid for my home use, but I will save those for another day. One feature I use for most of my services is Docker. This allows me to store the data on the array in a central location and easily manage new applications and services in a central location. I have used Gitlab before as part of my day job. Once I discovered Gitlab has a Community Edition that you can self host, I gave it a shot. Unfortunately, I ran into multiple issues that I was unable to debug in trying to field the Docker image on my Unraid server.

After a few months of tinkering and eventually giving up on Gitlab, I ran across a new package called Gitea. Thanks to the folks over at the Self Hosted Podcast for this shoutout. Check this episode out at https://selfhosted.show/72.

Gitea installed VERY easily and was much smaller than the Gitlab images. I am currently on wireless internet, so any bandwidth savings is a massive blessing. One gotcha running Gitea in a Docker container is making sure that the internal URL is set correctly. From the installation instructions:

Notice: if using a non-3000 port on http, change app.ini to match LOCAL_ROOT_URL = http://localhost:3000/.

This was the only gotcha I ran into. I chose a MYSQL database in the initial setup GUI that you can access once you first start the Docker container. I already have a MYSQL container running for a number of other services, so this was an easy choice. I have had a lot of issues with services that run internal MYSQLITE databases, so I tend to migrate to other options when available.

Gitea makes it really easy (just as easy as Gitlab) to create repositories and get to work. For those newbies to git, I highly recommend taking this route to help learn the command line. Setup a repository in Gitea, initialize a remote repository on your computer, and point the local remote repository to your new Gitea master repo. Now you can change your files around, commit changes, and track them with a GUI front end to help you see what is actually going on.

Now that I have Gitea up and running, I find myself pushing all sorts of different coding projects, configuration files, and more to it just as a nice central place that I can work from. I highly recommend you check it out!

-Russ