+ People + ditching + GitHub after + recent issues + are looking to self-hosting Forgejo as an alternative. +
Despite some (poorly disclosed) security issues, I think there's a more fundemental reason why you shouldn't use Forgejo.
If you're just a single person trying to publish your independent coding projects, why do you need: CI, Issue Tracking, Pull Requests, Multi-user account management, etc?
just use cgit.
+ +How do git forges (like GitHub) even work?
A git forge is basically just a directory of git repositories, served over http or ssh, with a fancy web frontend.
On the server, since the repos don't need to store mutable state (local commits, staged files, etc) they're stored in a special format that's basically just the .git
@@ -32,10 +36,10 @@
cgit Setup Guide
The cgit setup process is fairly involved, but if you were planning on self-hosting Forgejo, then you can handle it.
-I'll be using Caddy as the webserver for this setup, but I'll link tutorials for NGINX and Apache if prefer xml configuration files and manual https certificates ;)
+I'll be using Caddy as the webserver for this setup, but this could be modified for NGINX and Apache if you prefer xml configuration files and manual https certificates ;)
To keep everything organized, I'll run cgit under a user called "git". Our git repos will be stored in this directory.
-$ useradd -r -d /var/lib/cgit -s /usr/bin/git-shell git
+ $ useradd -r -d /var/lib/cgit -s /usr/bin/git-shell git
fcgiwrap
cgit is served as a cgi application.
@@ -45,7 +49,7 @@Install fcgiwrap with a package manager. This will create two systemd files: fcgiwrap.service and fcgiwrap.socket.
Open fcgiwrap.service in a text editor (
$ systemctl edit fcgiwrap.service) and set the User and Group to be our "git" user.
- Open fcgiwrap.socket (
$ systemctl edit fcgiwrap.socket) and add "SocketUser=caddy" and "SocketGroup=caddy" under the [Socket] section. (replace with the correct Caddy user for your system)
+ Open fcgiwrap.socket (
$ systemctl edit fcgiwrap.socket) and add "SocketUser=caddy" and "SocketGroup=caddy" under the[Socket]section. (replace with the correct Caddy user for your system)
cgit
@@ -108,8 +112,10 @@ snapshots=tar.gz zipIn return, you get a tiny stack, fewer moving parts, lower attack surface, lower resource use, and a setup you can understand.
For my personal projects, that trade is acceptable.
--
Discuss on Bluesky
-