aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiederick de Vries <diederick@diederickdevries.net>2020-06-20 11:20:36 +0200
committerDiederick de Vries <diederick@diederickdevries.net>2020-06-20 11:20:36 +0200
commit17cf8276872434973e6ec7776feabf863fee90b6 (patch)
tree5492361f40ddf132b0c46673ce92b8c9c98bacce
downloadcgit-docker-17cf8276872434973e6ec7776feabf863fee90b6.tar.gz
cgit-docker-17cf8276872434973e6ec7776feabf863fee90b6.tar.bz2
cgit-docker-17cf8276872434973e6ec7776feabf863fee90b6.zip
chore:initial commit
-rw-r--r--cgit-docker32
-rw-r--r--cgit.conf12
-rw-r--r--cgitrc23
3 files changed, 67 insertions, 0 deletions
diff --git a/cgit-docker b/cgit-docker
new file mode 100644
index 0000000..18ccc3d
--- /dev/null
+++ b/cgit-docker
@@ -0,0 +1,32 @@
1cgit
2
3Doel:
4
5Docker container, gebaseerd op archlinux, met cgit en lighttpd.
6Publiceert op poort 80 (root)
7Volumes:
8 Repos op /srv/git
9 Logs in /var/log/lighttpd
10
11Nice-to-haves:
12 - Syntax highlighting in blobs
13 - Logo en css in volume
14
15run als:
16
17docker run -d --name cgit -p8093:80 -v /mnt/data/git:/srv/git gitrc
18
19Stappen:
20
21git pull archlinux
22cp cgitrc /etc/
23cp cgit.conf /etc/lighttpd/conf.d/
24cp logging.conf /
25pacman --noconfirm -Syu
26pacman --noconfirm -S cgit lighttpd
27cat /logging.conf >> /etc/lighttpd/lighttpd.conf
28echo 'include "conf.d/cgit.conf"' >> /etc/lighttpd/lighttpd.conf
29systemctl enable --now lighttpd
30
31
32
diff --git a/cgit.conf b/cgit.conf
new file mode 100644
index 0000000..9584d9b
--- /dev/null
+++ b/cgit.conf
@@ -0,0 +1,12 @@
1server.modules += ( "mod_cgi", "mod_rewrite" )
2
3$SERVER["socket"] == ":80" {
4 server.name = "localhost"
5 server.document-root = "/usr/share/webapps/cgit/"
6
7 index-file.names = ( "cgit.cgi" )
8 cgi.assign = ( "cgit.cgi" => "" )
9 url.rewrite-once = (
10 "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2",
11 )
12}
diff --git a/cgitrc b/cgitrc
new file mode 100644
index 0000000..ea23ad4
--- /dev/null
+++ b/cgitrc
@@ -0,0 +1,23 @@
1#
2# cgit config
3#
4
5css=/cgit.css
6logo=/cgit.png
7
8# Following lines work with the above Lighttpd config
9#css=/cgit/cgit.css
10#logo=/cgit/cgit.png
11
12# Allow http transport git clone
13enable-http-clone=0
14
15# if you do not want that webcrawler (like google) index your site
16robots=noindex, nofollow
17
18# if cgit messes up links, use a virtual-root. For example, cgit.example.org/ has this value:
19virtual-root=/
20
21# Scan repos here
22scan-path=/srv/git/
23