raphting.dev

Self-Hosting a Static Git Frontend

GitHub was a nice code hosting and showcasing platform, before it became an AI powered developer platform. I need a simple, read-only showcase for my source code. I didn’t need a full-blown Git forge; I needed a lightweight, self-hosted frontend, something akin to a modern cgit.

After a quick search for alternatives, I settled on legit. It’s a minimal static site generator written in Go that creates a clean, browsable HTML interface for a directory of Git repositories. It lets you inspect files, view commit history, and read diffs, all without any client-side JavaScript or backend database.

I made one minor patch to the template. By default, it rendered author email addresses from the commit logs directly into the HTML. To prevent exposure to spam scrapers, I removed that field from the output.

When creating a server-side git repository with git init --bare, there’s a file description which legit uses to print the description next to the repository name in the rendered HTML. I wrote a script to automate this setup on my server, so I don’t need to log in and do this setup manually.

The result is now live at code.raphting.dev.

I’ve added two repositories for now and will push more projects when it makes sense.

By Raphael Sprenger