Hello everyone! Welcome to another one of my blogs. Today, I will talk about how I set up a so far, almost functioning git server/listing in a container. I wasn't(and still am not) sure, why did I do it, since I can already use ftp for my projects, but I felt that I kindof wanted to have some kind of git server setup, but gitea felt too heavy, and a little too easy for my liking, so I decided, for better or for worse, to setup git-daemon(builtin git server that is readonly and supposed to be to termporarilly hosted on LAN to share projects quickly), with cgit(a lightweight git frontend, kindof like what you'd see with many gnu project websites), and I decided to host it all on an alpine container, so it would all be nice and portable. And so with little reasearch, I started like all my docker hosted services, writing a simple dockerfile. I began with raw alpine:latest, added git, cgit and git-daemon, creates a volume mountpoint for the repositories, and copied+ran a wrapper.sh file, which is what I normally use when running multiple commands in one container. Openrc exists, but is just way too stupid to bother with for a container. So next thing you know, I look up hosting cgit on alpine, and who would've guessed, there is a guide on how to do it from alpine's website. And while this guide did point me in the right direction, because up to this point I didn't relaise that cgit wasn't a webserver by itself, but rather a CGI program that had to be hosted on some kind of webserver. So, I followed the guide for a bit, and foolishly, I decided to choose lighhpd for hosting the cgit cgi. By the way you can also see how similiar these 2 names are, and it made it rather confusing to search. Anways, I tried the guides lighttpd config, and unsuprisingly, it didn't work at all. Next thing, I tried to change up/make this config myself, but the fact that I have never interacted with CGI/FCGI programs before made it milddly confusing, and I didn't even manage to set it up enough to see that my cgit wasn't actually running at all, atleast not yet. So, I decided to use nginx, that I always get back to with these kinds of things, I still don't really know why it works at everything so well. I loaded up nginx(alpine) docker image, and tried to connect with the config to the cgit, not really trusting the guide anymore, but still choosing to keep an eye on it and occasionally try following it, and unsuprisingly, I got another error. Turns out the cgit server isn't a server listening at an address at all, which I expected from it, but turns out it needed fcgiwrap and spawn-fcgi, helpfully pointed out by the guide. So now, with fcgiwrap, nginx, I finally got the cgit homepage. Now, time to set up git daemon. For some reason, its not really easy to setup git daemon as a service or with a config file for that manner, so you have to provide everything via the program arguments. So, I started with a simple config: /usr/bin/git daemon /repos --enable=receive-pack --informative-errors --verbose --base-path=/repos --port 9418 --export-all & Now, it did start(after relaising i set the wrong passtrough docker port and was passing 9148 instead of 9418), but suprisingly, atleast to me, I couldn't clone any repositories. I couldn't clone them with repo/.git, repo.git, repo, and I was starting to wonder if I messed up some permissions, or if the repo was corrupted somehow, especially when the stdout logs of git daemon were saying the git repo was not recognized or somthing in that sence. But when I started messing with the argument order a little bit, the issue became clear, the --port needed a equal sign. So after I sorted that out, it was finally working. I won't make it public yet; I didn't figure out how will I be doing the whole authentication thing which git daemon appears to be missing. Anyways, thats all I have for you all today guys, enjoy the rest of your century, peace.