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
|
# gitpocket
gitpocket is a self hosted git server in one static Go binary that serves repositories over SSH and HTTPS with a web interface rendered on the server. It idles at about 25 MB resident so it fits comfortably on a 512 MB VPS next to the git processes it starts.
## Quick start
```
git clone https://gitpocket.io/~gitpocket/gitpocket && cd gitpocket
useradd -r -m -d /srv/gitpocket -s /bin/sh git
printf 'GITPOCKET_HOST=git.example.org\nGITPOCKET_UID=%s\nGITPOCKET_GID=%s\n' $(id -u git) $(id -g git) > deploy/.env
docker compose -f deploy/compose.yaml up -d
```
The web interface is then on `127.0.0.1:3200` and wants a reverse proxy with TLS in front of it. Sign up and then make yourself an administrator with `docker exec gitpocket gitpocket admin you`. [INSTALL.md](INSTALL.md) covers the Docker and binary installs, nginx, SSH, mail, backups and upgrades in order.
## Features
- Public, unlisted and private repositories under `~user/name`, with tree, log, blame, compare, history search and tar.gz or zip downloads of any ref
- Branches, a branch switcher on every file view and a notice when a branch with new commits was pushed that links straight to a new pull request
- Markdown in pull requests, issues and comments with a preview tab and images you paste, drop or attach
- Pull requests from a branch or a fork with inline review, range diffs between force pushes and merge, squash or rebase without a working tree
- Organisations, collaborators, issues, labels, stars, forks, branch protection and per owner disk quotas enforced during the push
- Profiles with a pinned repository list, an activity graph and a README from your `~you/you` repository
- SSH and PGP commit verification, TOTP, access tokens and Atom feeds for commits, issues and pull requests
- Site search over repositories and people with language facets
- Light and dark themes that follow the device or a choice saved under settings
- Open, invite only or closed registration and an `/admin` page for accounts, invites, the front page and storage
There is no wiki and no CI and neither is planned.
## Design
Every read of git data calls the plumbing with a thirty second timeout so a large repository costs exactly what git says it costs and nothing is parsed out of packfiles in process. Ref tables, trees, summaries and languages are cached against the mtime of the refs, which means one `stat` after a push invalidates them and deleting the cache loses nothing.
Pull requests fetch the source into `refs/pull/N/head` of the target. Merges are `merge-tree` and `commit-tree` followed by an `update-ref` that names the old value so a push racing the merge button makes the merge fail instead of being overwritten. SQLite comes from the pure Go modernc port which is why a `CGO_ENABLED=0` build needs nothing beside a system git.
## Usage
```
git clone https://git.example.org/~you/repo
git clone git@git.example.org:~you/repo
```
SSH pushes need a key added under settings and HTTPS pushes take an access token or your password. To contribute to something you do not own, fork it, push a branch to the fork and open a pull request from that branch.
## Development
```
go test ./...
```
The tests drive the real handler through `httptest` and cover each registration mode, cross site posts, private repositories, moved repositories, every merge strategy and Markdown injection payloads.
## Licence
MIT. KaTeX is MIT as well and Source Sans 3 is under the OFL with both notices kept beside the files.
|