dgit: Djmoch's Git Viewer
Djmoch's Git Viewer
DGit is a fast, template-driven Git repository viewer
written in pure Go. Being written in pure Go, it is possible to
statically-link the resulting command-line interface with all of its
dependencies, including templates and static files. When this is
achieved, its only external requirements are the Git repositories
themselves. This makes DGit suitable for dropping into a chroot or
other restricted environment.
This Go http.Hanlder module is imported as djmo.ch/dgit.
To use, initialize DGit with a config.Config object specifying, among
other things, an io/fs.FS containing your HTML templates, drop this
Handler into your site's http.ServeMux and start viewing Git
The DGit handler supports both [Git HTTP transfer] protocols, so
read-only repository operations, such as cloning and fetching, are
[Git HTTP transfer]: https://git-scm.com/docs/gitprotocol-http
CLI Reference Implementation
The command line interface (CLI) in this repository is a reference
implementation and, as such, is not suitable for general use. It does,
however, run the maintainer's Git website
(https://git.danielmoch.com). It has been made publicly available to
demonstrate how to incorporate DGit into your website.
ISC. See the LICENSE file in this repository for full copyright and
Contributions are welcome. Full details on how to engage with the
maintainer and other developers are in the CONTRIBUTING file.