1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Pygitweb
Gitweb reimplementation using **Python**, **FastAPI**, and **Pygit2**, ported from `git/gitweb/gitweb.perl`.
## Setup
```bash
cd pygitweb
python3 -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
```
## Run
```bash
cd pygitweb
.venv/bin/uvicorn pygitweb.main:app --reload --host 0.0.0.0 --port 8000
```
Or:
```bash
cd pygitweb && .venv/bin/python -m pygitweb.main
```
## Config
Set environment variables (or use a Python config file via `GITWEB_CONFIG`):
- `GITWEB_PROJECTROOT` — absolute path to directory containing git repositories (default: `/pub/scm`)
- `GITWEB_LIST` — same path or path to a project-list file
- `GITWEB_EXPORT_OK` — filename that must exist to allow export (e.g. `git-daemon-export-ok`); empty = no check
- `GITWEB_SITENAME` — site name in titles
## Routes
See [ROUTES.md](ROUTES.md) for more detail.
**No-project routes**
- `GET /` — project list
- `GET /index` — plain text project index (path, owner)
- `GET /opml` — OPML feed list
**Project-scoped actions (implemented)**
- `GET /{project}` or `a=summary` — project summary (description, owner, HEAD, tree link)
- `GET /{project}?a=forks` — forks of project
- `GET /{project}?a=tree&h=...&f=...` — directory listing (tree)
- `GET /{project}?a=blob&h=...&f=...` — file view (HTML)
- `GET /{project}?a=blob_plain&h=...&f=...` — raw file download
- `GET /{project}?a=log&h=...` — commit log
- `GET /{project}?a=shortlog&h=...` — shortlog
- `GET /{project}?a=history&h=...&f=...` — history of a file or path
**Project-scoped actions (stub only)**
These actions are accepted but return a minimal placeholder page. Add handlers in `main.py` to implement: `blame`, `blame_incremental`, `blame_data`, `blobdiff`, `blobdiff_plain`, `commit`, `commitdiff`, `commitdiff_plain`, `heads`, `patch`, `patches`, `remotes`, `rss`, `atom`, `search`, `search_help`, `tag`, `tags`, `snapshot`, `object`.