From 0063bf9d2b2c416a6317cf45f68847b5720aab49 Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Sun, 10 May 2026 14:46:07 -0500 Subject: updates and new post: 'Summer of PLT' --- forgejno.html | 51 ++++++++------------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) (limited to 'forgejno.html') diff --git a/forgejno.html b/forgejno.html index 71246e7..a413440 100644 --- a/forgejno.html +++ b/forgejno.html @@ -7,42 +7,9 @@ - - + - -
- -
- +

You Don't Need Forgejo

People @@ -69,7 +36,7 @@

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

+ $ useradd -r -d /var/lib/cgit -s /usr/bin/git-shell git

fcgiwrap

cgit is served as a cgi application.

@@ -88,7 +55,7 @@
  • Install cgit with a package manager. This will place the cgit files at /var/www/htdocs/cgit

  • 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

    + $ chown -R git /var/www/htdocs/cgit && chmod -R 764 /var/www/htdocs/cgit
  • @@ -109,24 +76,22 @@ }

    Lock down SSH access

    -

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

    +

    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. Create an SSH directory for the git user: $ install -d -o git -g git -m 700 /var/lib/cgit/.ssh

    4. Add your public key to /var/lib/cgit/.ssh/authorized_keys with mode 600.

    Create some repos

    Create a bare repository:

    -

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

    + $ 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:

    +

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

    css=/cgit.css
     logo=
     virtual-root=/
    -- 
    cgit v1.3.1