View raw

Deploying ogit

Table of Contents

Prerequisites

Steps

1. Create the service user

useradd --system --shell /usr/sbin/nologin --home-dir /nonexistent ogit

Ensure the ogit user can read your git repositories:

usermod -aG git ogit  # if repos are group-readable by 'git'

Note: the Git library requires a tmp/ directory inside each repository's git directory to open a store, so ogit tries to create it on each visit. When the ogit user has no write access — the group-readable setup above — that attempt fails, and a repository without tmp/ cannot be opened at all. Create the directory once per repository:

mkdir /srv/git/repo.git/tmp
chown git:git /srv/git/repo.git/tmp

2. Install the binary

cp dist/ogit /usr/local/bin/ogit
chmod 755 /usr/local/bin/ogit

3. Install the configuration

mkdir -p /etc/ogit
cp deploy/config.toml /etc/ogit/config.toml

Edit /etc/ogit/config.toml to match your environment:

4. Install and start the service

cp deploy/ogit.service /etc/systemd/system/ogit.service
systemctl daemon-reload
systemctl enable --now ogit

5. Verify

curl http://127.0.0.1:8081/
systemctl status ogit

Updating

systemctl stop ogit
cp dist/ogit /usr/local/bin/ogit
systemctl start ogit

Logs

journalctl -u ogit -f