Gitsune (vosjedev.net)
login
To clone locally:
$ git clone https://betagit.vosjedev.net/git/gitsune.git
Last commit: 3e0e1c817443 [html+css] revise the menubar to make the logo larger[checkout]
NameSizeMode
.gitignore21B100644
Dockerfile701B100644
README.md7.05KiB100644
container-entry.sh2.57KiB100755
example-gitolite.rc7.05KiB100644
gen_nerdfont_mappings.py2.56KiB100644
poetry.lock42.51KiB100644
pyproject.toml627B100644
scripts/-040000
src/-040000
tests/-040000
README.md

Gitsune

I present to the general public: gitsune!

Gitsune is a git forge based on top of gitolite and git. It was written due to me wanting some software that does the following:

This lead to the following featureset:

The name

The name, Gitsune, is a combination of the name of the kitsune, a japanese mythical fox creature, and our favorite version control system, git.

Notes (READ THIS before deploying)

Setup

If you are using the docker container, you can skip this (unless you're migrating an existing install).

Docker

The image has been only tested on podman. If you encounter any bugs using docker, feel free to report them. Note the build instructions will apply to podman.

Building the container is quite straightforward: podman build -t gitsune .. You can now deploy this, for example using a compose.yml:

-
services:
  gitsune:
    image: gitsune
    volumes:
      - ./gitsune.toml:/var/lib/git/gitsune.toml
      - ./git:/var/lib/git/
    #environment:
    #  - DEBUG=10 # do not enable DEBUG in prod :)
    ports:
      - "8080:8080"
      - "22:22"

If you encounter an error while building that there is no pyproject.toml, explicitly mount the repo with the z flag: podman build -t gitsune -v $PWD:/source:z .

To do development using this image, mount the repo root at /gitsune, optionally read-only:

-
1
podman create --name gitsune -e DEBUG=10 -v $PWD:/gitsune:ro -v /tmp/admin.pub:/admin.pub:z -p8080:8080 -p8022:22 gitsune

KNOWN BUGS:

LOGLEVELS:

Set the loglevel with the DEBUG env. Do not enable this in production.

  1. stuff that happens often but not always
  2. expansion of 1
  3. very verbose logging
  4. the secret loglevel that unlocks even more logmessages

TODO

fastauth

Before the fastauth plugin, gitsune spawned a new gitolite process every time it wanted to check a permission (so at least once per request, for most plugins). This took a lot of time. fastauth (for fast authorisation) optimises this by using gitolite access in batch mode. This does require a patch to be applied to gitolite at the moment. Since gitolite v3.6.16, my patch has been included in the release. In case you are on an older version, continue reading. If you are on at least v3.6.16, simply enabling the fastauth plugin should be enough.

I recommend patching the specific file and putting it in your local code:

-
1
2
3
4
5
6
GITSUNE=/path/to/gitsune/ # set this to the root of the gitsune repo
LOCAL_CODE="$(gitolite query-rc LOCAL_CODE)"; echo $? # if this fails, you have work to do.
mkdir -p "$LOCAL_CODE/commands"
curl -L https://codeberg.org/sitaramc/gitolite/raw/branch/master/src/commands/access -o "$LOCAL_CODE/commands/access"
chmod +x "$LOCAL_CODE/commands/access"
patch "$LOCAL_CODE/commands/acces" "$GITSUNE/gitolite-access.patch" # this does the heavy work

Afterwards, don't forget to add the fastauth plugin to the add_plugins config entry.

The other option, in case you are building gitolite from source, is to git apply the patch file on that. I use that method.