From 85a2a330f729d70dfce1b81dc69ec15436a3d44c Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Mon, 4 May 2026 09:40:42 -0500 Subject: Initial clean commit --- forgejno.html | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 99 +++++++++++++++++++++++++++++++++++++++ prose.css | 119 ++++++++++++++++++++++++++++++++++++++++++++++ style.css | 32 +++++++++++++ writing.html | 18 +++++++ 5 files changed, 416 insertions(+) create mode 100644 forgejno.html create mode 100644 index.html create mode 100644 prose.css create mode 100644 style.css create mode 100644 writing.html diff --git a/forgejno.html b/forgejno.html new file mode 100644 index 0000000..71246e7 --- /dev/null +++ b/forgejno.html @@ -0,0 +1,148 @@ + + + + + + You don't need Forgejo + + + + + + + +
+ +
+ +
+

You Don't Need Forgejo

+

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 + directory of a normal git repository.

+

This is called a bare repository.

+ +

What is cgit?

+

cgit is essentially just a web-based frontend for these bare repos.

+

While full-on software forges (like GitHub or Forgejo) give you many extra features, cgit is just the read-only frontend, with nothing else included.

+

Interested?

+ +

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 ;)

+ +

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

+ +

fcgiwrap

+

cgit is served as a cgi application.

+

A long time ago in a galaxy far far away, web servers had builtin support for cgi, but now its often delegated to fcgiwrap.

+

So our first step will be setting up fcgiwrap.

+ +
    +
  1. Install fcgiwrap with a package manager. This will create two systemd files: fcgiwrap.service and fcgiwrap.socket.

  2. +
  3. Open fcgiwrap.service in a text editor ($ systemctl edit fcgiwrap.service) and set the User and Group to be our "git" user.

  4. +
  5. 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)

  6. +
+ +

cgit

+

Since cgit is a cgi application, it does not run as its own service. It is simply a script that gets executed by Caddy and piped into fcgiwrap. As such, the setup is pretty simple:

+
    +
  1. Install cgit with a package manager. This will place the cgit files at /var/www/htdocs/cgit

  2. +
  3. +

    Make sure that location is owned by "git", but is readable by all users:

    +

    $ chown -R git /var/www/htdocs/cgit && chmod -R 764 /var/www/htdocs/cgit

    +
  4. +
+ +

Caddy

+

To complete the set up, add this block to the Caddyfile to serve cgit.

+
git.my.tld {
+    @assets path /cgit.css /cgit.js /favicon.svg /robots.txt
+    handle @assets {
+        root * /var/www/htdocs/cgit
+        file_server
+    }
+
+    reverse_proxy unix//run/fcgiwrap-cgit.sock {
+        transport fastcgi {
+            env SCRIPT_FILENAME /var/www/htdocs/cgit/cgit.cgi
+        }
+    }
+}
+ +

Lock down SSH access

+

Using git-shell + blocks normal shell access and allows only git-style SSH commands.

+
    +
  1. Create an SSH directory for the git + user: $ install -d -o git -g git -m 700 /var/lib/cgit/.ssh

  2. +
  3. Add your public key to /var/lib/cgit/.ssh/authorized_keys + with mode 600.

  4. +
+ +

Create some repos

+

Create a bare repository:

+

$ sudo -u git git init --bare /var/lib/cgit/example

+

Push to it from your local machine:

+
$ git remote add origin git@git.my.tld:example
+$ git push -u origin main
+ +

cgitrc

+

A clean default /etc/cgitrc file might look like this:

+
css=/cgit.css
+logo=
+virtual-root=/
+
+enable-index-owner=0
+enable-http-clone=1
+scan-path=/var/lib/cgit
+
+root-title=git.my.tld
+root-desc=Personal git repositories
+snapshots=tar.gz zip
+ +

Tradeoffs

+

You lose integrated issues, pull requests, built-in CI, orgs, and a social graph.

+

In 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.

+
+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..5a7ac62 --- /dev/null +++ b/index.html @@ -0,0 +1,99 @@ + + + + + + Collin Williams + + + + + +
+ +
+

Collin Williams

+
+ Bluesky + Tangled + Writing +
+
+ + diff --git a/prose.css b/prose.css new file mode 100644 index 0000000..a9f6dc1 --- /dev/null +++ b/prose.css @@ -0,0 +1,119 @@ +@import url('https://fonts.googleapis.com/css2?family=Gelasio:ital,wght@0,400..700;1,400..700&display=swap'); + +html, +body { + overflow-x: hidden; + overflow-y: auto; +} + +body { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 75ch) minmax(0, 1fr); + align-items: start; + column-gap: 2rem; + padding: 2rem 1.25rem 4rem; +} + +.toc { + grid-column: 1; + width: min(17rem, 22vw); + position: fixed; + top: 32px; + left: max(0.75rem, calc(50vw - 37.5ch - 20rem)); + max-height: calc(100vh - 2rem); + overflow-y: auto; + padding-right: 0.75rem; + z-index: 1; +} + +.toc ul { + margin: 0; + padding-left: 1rem; +} + +.toc li { + margin-bottom: 0.35rem; +} + +.content { + grid-column: 2; + width: 100%; + margin: 0 auto; + padding: 0 0 2rem; + max-width: 75ch; + height: auto; + flex-grow: 0; + flex-shrink: 1; + overflow: visible; +} + +p { + color: #e6e6e6; + font-family: 'Gelasio'; + line-height: 1.3; + font-size: 1.1rem; +} + +a { + color: #4DA3FF; + transition: color 0.2s ease, background-color 0.2s ease; +} + +a:hover { + background-color: #4DA3FF; + color: #121212; + text-decoration: none; +} + +li::marker { + color: #e6e6e6; +} + +h1 { + color: #e6e6e6; + line-height: 1; + margin-bottom: 0; + font-family: 'Gelasio'; + font-weight: 600; +} + +h2 { + color: #e6e6e6; + line-height: 1; + margin-top: 3rem; + margin-bottom: 0; + font-family: 'Gelasio'; + font-weight: 600; +} + +h3 { + color: #e6e6e6; + line-height: 1; + margin-top: 2rem; + margin-bottom: 0; + font-family: 'Gelasio'; + font-weight: 600; +} + +p.comment { + color: #888; +} + +@media (max-width: 1000px) { + body { + display: block; + padding: 1rem 1rem 3rem; + } + + .toc { + position: static; + width: auto; + max-height: none; + margin-bottom: 1.25rem; + padding-right: 0; + } + + .content { + padding: 0; + } +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..43a6973 --- /dev/null +++ b/style.css @@ -0,0 +1,32 @@ +@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap'); + +*, *::before, *::after { + box-sizing: border-box; +} + +html, body { + background-color: #121212; + margin: 0; + padding: 0; + min-height: 100vh; + overflow: hidden; +} + +body { + display: flex; + justify-content: center; + align-items: flex-start; +} + +h1 { + font-family: 'Roboto Mono'; + color: #e6e6e6; + line-height: 1; + margin: 0; + margin-bottom: 1.5rem; +} + +p { + font-family: 'Roboto Mono'; + color: #e6e6e6; +} diff --git a/writing.html b/writing.html new file mode 100644 index 0000000..d95ba16 --- /dev/null +++ b/writing.html @@ -0,0 +1,18 @@ + + + + + + Writing + + + + + +
+ +
+ + -- cgit v1.3.1