Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joseluisq/alpine-cgit
Multi-Arch Docker images for the hyperfast web frontend for Git repositories on top of Alpine and Nginx.
https://github.com/joseluisq/alpine-cgit
386 alpine-linux amd64 arm arm64 cgit docker docker-image git git-web nginx powerpc64le s390x self-hosted x86-64
Last synced: about 2 months ago
JSON representation
Multi-Arch Docker images for the hyperfast web frontend for Git repositories on top of Alpine and Nginx.
- Host: GitHub
- URL: https://github.com/joseluisq/alpine-cgit
- Owner: joseluisq
- License: apache-2.0
- Created: 2021-03-15T23:04:32.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T21:58:27.000Z (10 months ago)
- Last Synced: 2024-04-22T14:23:11.469Z (8 months ago)
- Topics: 386, alpine-linux, amd64, arm, arm64, cgit, docker, docker-image, git, git-web, nginx, powerpc64le, s390x, self-hosted, x86-64
- Language: Dockerfile
- Homepage:
- Size: 76.2 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Alpine CGit [![devel](https://github.com/joseluisq/alpine-cgit/actions/workflows/devel.yml/badge.svg)](https://github.com/joseluisq/alpine-cgit/actions/workflows/devel.yml) [![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/joseluisq/alpine-cgit/latest)](https://hub.docker.com/r/joseluisq/alpine-cgit/) [![Docker Image Size (tag)](https://img.shields.io/docker/image-size/joseluisq/alpine-cgit/latest)](https://hub.docker.com/r/joseluisq/alpine-cgit/tags) [![Docker Image](https://img.shields.io/docker/pulls/joseluisq/alpine-cgit.svg)](https://hub.docker.com/r/joseluisq/alpine-cgit/)
> The hyperfast web frontend for [Git](https://git-scm.com/) repositories on top of [Alpine](https://alpinelinux.org/) and [Nginx](https://nginx.org/).
[CGit](https://git.zx2c4.com/cgit/about/) is a web interface ([cgi](https://tools.ietf.org/html/rfc3875)) for [Git](https://git-scm.com/) repositories, written in C.
## CGit features
- Basic repository browsing (logs, diffs, trees...).
- Caching of generated HTML.
- Cloneable URLs (implements dumb HTTP transport).
- Commit feeds (atom format).
- Discovery of Git repositories.
- On-the-fly archives for tags and commits.
- Plugin support e.g. syntax highlighting.
- Side-by-side diffs.
- Simple time/author statistics.
- Simple virtual hosting support (macro expansion).
- Understands GitWeb project-lists.
- Understands `gitweb.owner` in Git config files.
- Has an extensive filtering framework using scripts or a built-in Lua interpreter.See [CGit project](https://git.zx2c4.com/cgit/about/) for more details.
## Usage
```sh
docker run --rm -it \
-p 8787:80 \
-v /my/repos/:/srv/git/ \
joseluisq/alpine-cgit:2
```**Dockerfile**
```Dockerfile
FROM joseluisq/alpine-cgit:2
```## Key container paths
- `/etc/cgitrc`: Default CGit configuration file.
- `/srv/git`: Default directory for Git repositories scanned by CGit.
- `/var/cache/cgit`: Default CGit caching directory of generated HTML.Note that all these paths can be overwritten via [Bind Mounts](https://docs.docker.com/storage/bind-mounts/) or [Docker Volumes](https://docs.docker.com/storage/volumes/).
## Settings via environment variables
CGit Docker image can be configured via environment variables. This is the default behavior.
- `CGIT_TITLE`: Website title.
- `CGIT_DESC`: Website description.
- `CGIT_VROOT`: Virtual root directory.
- `CGIT_SECTION_FROM_STARTPATH`: How many path elements from each repo path to use as a default section name.
- `CGIT_MAX_REPO_COUNT`: Number of entries to list per page on the repository index page.## Settings via custom configuration file
By default, this Docker image will use a template file located at [cgit/cgit.conf](./cgit/cgit.conf) which is replaced with the env settings (mentioned above) at start-up time.
However, if you want to use a custom `/etc/cgitrc` file then follow these steps:
1. Provide the env variable `USE_CUSTOM_CONFIG=true` to prevent using the default config file.
2. Provide the custom config file as a [Bind Mount](https://docs.docker.com/storage/bind-mounts/) or [Docker Volume](https://docs.docker.com/storage/volumes/). For example `--volume my-config-file:/etc/cgitrc`
3. Provide the `cache-root` option in your config file. For example `cache-root=/var/cache/cgit`
4. Provide the `scan-path` option in your config file. For example `scan-path=/srv/git`
5. Provide the repositories folder as a [Bind Mount](https://docs.docker.com/storage/bind-mounts/) or [Docker Volume](https://docs.docker.com/storage/volumes/). For example `--volume my-repos:/srv/git`See [`cgitrc` man page](https://linux.die.net/man/5/cgitrc) for more detailed information.
## Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.
Feel free to send some [Pull request](https://github.com/joseluisq/alpine-cgit/pulls) or file an [issue](https://github.com/joseluisq/alpine-cgit/issues).
## License
This work is primarily distributed under the terms of both the [MIT license](LICENSE-MIT) and the [Apache License (Version 2.0)](LICENSE-APACHE).
© 2021-present [Jose Quintana](https://joseluisq.net)