index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff
gitrs / README.md
-rw-r--r-- blob 634d3c1ed647f8890a58f1c1836ec7f7cfb06397 2022 bytes (plain)
1
# git-rs
2
3
A fast, minimal web interface for self-hosted Git repositories, inspired by `cgit` and written in Rust using Actix Web, `gix` (gitoxide), and Askama templates.
4
5
![Repositories index](docs/screenshots/repos_page.png)
6
[*Demo*](https://git.y2w8.online)
7
8
## Features
9
10
- Browse repositories, branches, tags, commit logs, and file trees
11
- Unified diffs with diffstat bars and raw `.patch` export (`git am` compatible)
12
- Download `.tar.gz` snapshots of any branch, tag, or commit
13
- Read-only HTTP smart protocol support (`git clone` / `git pull`)
14
- Automatic filesystem watcher (`notify`) that picks up new or removed repositories in `/srv/git` without restarting the server
15
- Markdown rendering for repository `README` files
16
- Static assets and templates compiled directly into a single binary
17
18
More screenshots are available in [`docs/screenshots/`](docs/screenshots/).
19
20
## Usage
21
22
By default, `git-rs` reads bare repositories from `/srv/git` and listens on `127.0.0.1:80`:
23
24
```sh
25
git-rs --url 0.0.0.0 --port 80 --repos-dir /srv/git
26
```
27
28
### Options
29
30
| Flag | Default | Description |
31
| :--- | :--- | :--- |
32
| `-u, --url <URL>` | `127.0.0.1` | Bind address |
33
| `-p, --port <PORT>` | `80` | Port to listen on |
34
| `-r, --repos-dir <DIR>` | `/srv/git` | Directory containing bare Git repositories |
35
36
## Repository Metadata
37
38
For each bare repository in `/srv/git/<repo>`:
39
40
- **Description:** Write a plain-text description to `/srv/git/<repo>/description`
41
- **Owner:** Set `gitweb.owner` in the repository config:
42
  ```sh
43
  git -C /srv/git/<repo> config gitweb.owner "your-name"
44
  ```
45
46
## Installation
47
48
Install from crates.io or directly from the repository:
49
50
```sh
51
# From crates.io
52
cargo install git-rs
53
54
# Or from a local checkout
55
cargo install --path .
56
```
57
58
To install and start the `systemd` service:
59
60
```sh
61
sudo $(which git-rs) --install-service --url 0.0.0.0 --port 80 --repos-dir /srv/git
62
sudo systemctl daemon-reload
63
sudo systemctl enable --now git-rs
64
```
65
66
## License
67
68
Licensed under the [GPL-3.0](LICENSE) license.