aboutsummaryrefslogtreecommitdiffstats
path: root/services/cgit/readme.md
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-11 21:00:52 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-12 14:56:15 +0100
commit6c22a6e48e8ff49a69434eca7a7b78158576cb7b (patch)
tree2648d665bf9c27166da052fe2aa8281b56ceb498 /services/cgit/readme.md
downloadnet_services-6c22a6e48e8ff49a69434eca7a7b78158576cb7b.tar.gz
net_services-6c22a6e48e8ff49a69434eca7a7b78158576cb7b.zip
Initial import
Diffstat (limited to 'services/cgit/readme.md')
-rw-r--r--services/cgit/readme.md73
1 files changed, 73 insertions, 0 deletions
diff --git a/services/cgit/readme.md b/services/cgit/readme.md
new file mode 100644
index 0000000..bef4b9b
--- /dev/null
+++ b/services/cgit/readme.md
@@ -0,0 +1,73 @@
+# cgit
+
+This project is a [cgit](https://git.zx2c4.com/cgit/about/) docker image.
+
+It aims to be as simple as possible. No authentication, no SSH, just browsing repositories on a web page. The container doesn't write to the repositories so they can be read-only.
+
+# Build
+
+```
+docker build --tag cgit .
+```
+
+# Run
+
+## cgit configuration and runtime
+
+Examples are provided in the `examples` directory.
+
+* `CGITRC`: Host directory containing a `cgitrc` configuration, see [cgitrc manual](https://manpages.debian.org/trixie/cgit/cgitrc.5.en.html).
+* `COMMIT_FILTER`: Host directory containing an executable `commit-filter.sh` script to format Git commit messages. See the `commit-filter` section of the [cgitrc manual](https://manpages.debian.org/trixie/cgit/cgitrc.5.en.html).
+* `ABOUT`: Host directory containing `about.md` for the front page "about" section.
+* `REPOSITORIES`: Host directory containing your Git repositories.
+
+## Run with `docker`
+
+```
+docker run \
+ --rm \
+ --name cgit \
+ --publish 8080:80 \
+ --mount type=bind,src=CGITRC,dst=/etc/cgit,ro \
+ --mount type=bind,src=COMMIT_FILTER,dst=/usr/local/lib/cgit/filters/commit \
+ --mount type=bind,src=ABOUT,dst=/srv/cgit,ro \
+ --mount type=bind,src=REPOSITORIES,dst=/srv/git,ro \
+ cgit
+```
+
+Browse the website [here](http://localhost:8080).
+
+## Run with `docker compose`
+
+*Example `compose.yaml`:*
+
+```
+services:
+ cgit:
+ build: .
+ image: cgit
+ container_name: cgit
+ ports:
+ - 8080:80
+ volumes:
+ - CGITRC:/etc/cgit:ro
+ - COMMIT_FILTER:/usr/local/lib/cgit/filters/commit
+ - ABOUT:/srv/cgit:ro
+ - REPOSITORIES:/srv/git:ro
+```
+
+Browse the website [here](http://localhost:8080).
+
+# Configuration
+
+## Repository specific `cgitrc`
+
+Add a `cgitrc` file at the root of a repository to configure it for cgit. Note that this only works with the `scan-path` setting.
+
+*Example `cgitrc`:*
+
+```
+desc=Repository description
+owner=Repository owner
+section=Repository section
+```