[OCaml] Mobile-friendly clone of cgit.
Deploying ogit
Table of Contents
Prerequisites
- Debian 11 (or similar) x86_64 VPS
- Nginx configured as a reverse proxy (not covered here)
- Bare git repositories under a common root (e.g.
/srv/git)
Steps
1. Create the service user
useradd--system--shell/usr/sbin/nologin--home-dir/nonexistentogit
Ensure the ogit user can read your git repositories:
usermod-aGgitogit # 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
chowngit:git/srv/git/repo.git/tmp
2. Install the binary
cpdist/ogit/usr/local/bin/ogit
chmod755/usr/local/bin/ogit
3. Install the configuration
mkdir-p/etc/ogit
cpdeploy/config.toml/etc/ogit/config.toml
Edit /etc/ogit/config.toml to match your environment:
- user — displayed in the footer copyright
- git_project_root — path to the directory containing your bare repos
- host — bind address (keep 127.0.0.1 when behind Nginx)
- port — port Nginx will proxy to
4. Install and start the service
cpdeploy/ogit.service/etc/systemd/system/ogit.service
systemctldaemon-reload
systemctlenable--nowogit
5. Verify
curlhttp://127.0.0.1:8081/
systemctlstatusogit
Updating
systemctlstopogit
cpdist/ogit/usr/local/bin/ogit
systemctlstartogit
Logs
journalctl-uogit-f