scripts/
static/
templates/
.gitignore
30 B
.gitsigners
112 B
AGENTS.md
7.5 KiB
LICENSE
89 B
README.md
1.9 KiB
deploy
723 B
discuss.go
16.7 KiB
git.go
3.5 KiB
git_cli.go
16.0 KiB
git_http.go
1.9 KiB
go.mod
572 B
go.sum
1.9 KiB
handler.go
11.3 KiB
handler_test.go
69.0 KiB
main.go
5.2 KiB
template.go
8.9 KiB
watch
272 B
README.md
raw
| 1 | # Radiant Forge |
| 2 | |
| 3 | A self-hosted git repository browser, similar to CGit. Single Go binary, |
| 4 | static HTML, no JavaScript. |
| 5 | |
| 6 | ## Build |
| 7 | |
| 8 | go build . |
| 9 | |
| 10 | ## Usage |
| 11 | |
| 12 | ./forge [flags] |
| 13 | |
| 14 | Flags: |
| 15 | |
| 16 | -scan-path <path> Directory containing bare git repos (default ".") |
| 17 | -listen <addr> Listen address (default ":8080") |
| 18 | -title <string> Site title (default "radiant code repositories") |
| 19 | -base-url <string> Base URL prefix, e.g. "/git" (default "") |
| 20 | -non-bare Also scan for non-bare repos (dirs containing .git) |
| 21 | -username <string> HTTP basic auth username (requires -password) |
| 22 | -password <string> HTTP basic auth password (requires -username) |
| 23 | |
| 24 | The server scans `scan-path` for bare repositories (directories containing |
| 25 | `HEAD`, `objects/`, and `refs/`). Repo names are derived from directory |
| 26 | names with the `.git` suffix stripped. |
| 27 | |
| 28 | Repositories are **private by default**. A repo is only served if a `public` |
| 29 | file exists in its Git directory. |
| 30 | |
| 31 | ## Example |
| 32 | |
| 33 | Set up some bare repos and start the server: |
| 34 | |
| 35 | git init --bare /srv/git/example.git |
| 36 | touch /srv/git/example.git/public |
| 37 | ./forge -scan-path /srv/git -listen :8080 |
| 38 | |
| 39 | Then open http://localhost:8080 in a browser. |
| 40 | |
| 41 | ## URL scheme |
| 42 | |
| 43 | / Repository index |
| 44 | /:repo/ Summary (file tree + README) |
| 45 | /:repo/refs All branches and tags |
| 46 | /:repo/log/:ref Commit log (paginated, default: HEAD) |
| 47 | /:repo/tree/:ref/path... Tree/file browser |
| 48 | /:repo/commit/:hash Commit detail with diff |
| 49 | /:repo/raw/:ref/path... Raw file download |
| 50 | |
| 51 | ## Repository metadata |
| 52 | |
| 53 | The server reads optional metadata files from each bare repo: |
| 54 | |
| 55 | - `description` -- shown on the index and summary pages |
| 56 | - `owner` -- shown on the index page |
| 57 | - `public` -- must exist for the repo to be served (can be empty) |
| 58 | |
| 59 | ## License |
| 60 | |
| 61 | Copyright (c) 2025-2026 Radiant Computer (https://radiant.computer) |
| 62 | All rights reserved. |