aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiederick de Vries <diederick@diederickdevries.net>2020-06-20 16:05:46 +0200
committerDiederick de Vries <diederick@diederickdevries.net>2020-06-20 16:05:46 +0200
commit880d0ab438e77ea75083e03b5bfbe5af054f1ee8 (patch)
treeefc19a8a96b02b48b436c7ae22422c617af4e5a7
parentd18edbe5b1ef66be0018f06e2b0005ba02c8b247 (diff)
downloadcgit-docker-880d0ab438e77ea75083e03b5bfbe5af054f1ee8.tar.gz
cgit-docker-880d0ab438e77ea75083e03b5bfbe5af054f1ee8.tar.bz2
cgit-docker-880d0ab438e77ea75083e03b5bfbe5af054f1ee8.zip
refactor:use pre-created lighttpd config
-rw-r--r--cgit-docker15
-rw-r--r--cgit.conf12
-rw-r--r--lighttpd.conf41
-rw-r--r--logging.conf7
4 files changed, 49 insertions, 26 deletions
diff --git a/cgit-docker b/cgit-docker
index 18ccc3d..c12d45b 100644
--- a/cgit-docker
+++ b/cgit-docker
@@ -14,19 +14,20 @@ Nice-to-haves:
14 14
15run als: 15run als:
16 16
17docker run -d --name cgit -p8093:80 -v /mnt/data/git:/srv/git gitrc 17docker run -d --name cgit -p8093:80 \
18 -v /mnt/data/git:/srv/git \
19 -v /mnt/data/cgit/log:/var/log/ \
20 --restart unless-stopped
21 cgit
18 22
19Stappen: 23Stappen:
20 24
21git pull archlinux 25git pull archlinux
26pacman --noconfirm -Syu
27pacman --noconfirm -S cgit lighttpd
22cp cgitrc /etc/ 28cp cgitrc /etc/
23cp cgit.conf /etc/lighttpd/conf.d/ 29cp cgit.conf /etc/lighttpd/conf.d/
24cp logging.conf / 30cp logging.conf /
25pacman --noconfirm -Syu
26pacman --noconfirm -S cgit lighttpd
27cat /logging.conf >> /etc/lighttpd/lighttpd.conf 31cat /logging.conf >> /etc/lighttpd/lighttpd.conf
28echo 'include "conf.d/cgit.conf"' >> /etc/lighttpd/lighttpd.conf 32echo 'include "conf.d/cgit.conf"' >> /etc/lighttpd/lighttpd.conf
29systemctl enable --now lighttpd 33/bin/lighttpd -f /etc/lighttpd/lighttpd.conf
30
31
32
diff --git a/cgit.conf b/cgit.conf
deleted file mode 100644
index 9584d9b..0000000
--- a/cgit.conf
+++ /dev/null
@@ -1,12 +0,0 @@
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/lighttpd.conf b/lighttpd.conf
new file mode 100644
index 0000000..4a71f67
--- /dev/null
+++ b/lighttpd.conf
@@ -0,0 +1,41 @@
1# This is a minimal example config
2# See /usr/share/doc/lighttpd
3# and http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions
4
5server.port = 80
6server.username = "http"
7server.groupname = "http"
8server.document-root = "/srv/http"
9dir-listing.activate = "enable"
10index-file.names = ( "index.html" )
11mimetype.assign = (
12 ".html" => "text/html",
13 ".txt" => "text/plain",
14 ".css" => "text/css",
15 ".js" => "application/x-javascript",
16 ".jpg" => "image/jpeg",
17 ".jpeg" => "image/jpeg",
18 ".gif" => "image/gif",
19 ".png" => "image/png",
20 "" => "application/octet-stream"
21 )
22server.modules += (
23 "mod_access",
24 "mod_accesslog",
25)
26
27server.errorlog = "/var/log/lighttpd/error.log"
28accesslog.filename = "/var/log/lighttpd/access.log"
29server.modules += ( "mod_cgi", "mod_rewrite" )
30
31$SERVER["socket"] == ":80" {
32 server.name = "localhost"
33 server.document-root = "/usr/share/webapps/cgit/"
34
35 index-file.names = ( "cgit.cgi" )
36 cgi.assign = ( "cgit.cgi" => "" )
37 url.rewrite-once = (
38 "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2",
39 )
40}
41
diff --git a/logging.conf b/logging.conf
deleted file mode 100644
index 4807284..0000000
--- a/logging.conf
+++ /dev/null
@@ -1,7 +0,0 @@
1server.modules += (
2 "mod_access",
3 "mod_accesslog",
4)
5
6server.errorlog = "/var/log/lighttpd/error.log"
7accesslog.filename = "/var/log/lighttpd/access.log"