#+TITLE: Deploying ogit * 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 #+begin_src sh useradd --system --shell /usr/sbin/nologin --home-dir /nonexistent ogit #+end_src Ensure the =ogit= user can read your git repositories: #+begin_src sh usermod -aG git ogit # if repos are group-readable by 'git' #+end_src 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: #+begin_src sh mkdir /srv/git/repo.git/tmp chown git:git /srv/git/repo.git/tmp #+end_src ** 2. Install the binary #+begin_src sh cp dist/ogit /usr/local/bin/ogit chmod 755 /usr/local/bin/ogit #+end_src ** 3. Install the configuration #+begin_src sh mkdir -p /etc/ogit cp deploy/config.toml /etc/ogit/config.toml #+end_src 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 #+begin_src sh cp deploy/ogit.service /etc/systemd/system/ogit.service systemctl daemon-reload systemctl enable --now ogit #+end_src ** 5. Verify #+begin_src sh curl http://127.0.0.1:8081/ systemctl status ogit #+end_src * Updating #+begin_src sh systemctl stop ogit cp dist/ogit /usr/local/bin/ogit systemctl start ogit #+end_src * Logs #+begin_src sh journalctl -u ogit -f #+end_src