Repositories / gitweb2.git
service
Clone (read-only): git clone http://git.guha-anderson.com/git/gitweb2.git
| .. | tree |
| gitweb2.service | blob |
| README.md | blob |
README.md
# gitweb2 on homebox
User systemd unit for this machine only: [`gitweb2.service`](gitweb2.service).
Build the binary first (`dune build` from the repo root; binary is
`_build/install/default/bin/gitweb2`), then:
```sh
mkdir -p ~/.config/systemd/user
cp service/gitweb2.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now gitweb2.service
```
Check status and logs:
```sh
systemctl --user status gitweb2.service
journalctl --user-unit gitweb2.service -f
```
The unit listens on **0.0.0.0:8002**, serves **`/home/git/repos`**, and uses this checkout at **`/media/external0/arjun/repos/homebox/gitweb2`**. **`ExecStart`** goes through **`bash -c`** so the **`--pygments`** command stays a single argument (systemd splits unquoted strings). Edit the unit file if any of that moves.
For a repository with key `<repo>`, the URLs on this host are:
- HTML viewer: `http://homebox:8002/repo/<repo>`
- Read-only clone: `git clone http://homebox:8002/git/<repo>`
If the service is reached publicly through a port-forward or reverse proxy at
a different host or scheme, append `--public-url <url>` to the `ExecStart`
line so the clone command shown on each repo page reflects the public URL
(e.g. `--public-url https://git.example.com`).
Without [lingering](https://www.freedesktop.org/software/systemd/man/latest/loginctl.html), the user service stops when you log out (`loginctl enable-linger "$USER"` to keep it).