gitweb as docker service, initial commit master
authorChristoph Helma <helma@in-silico.ch>
Mon, 8 Jul 2019 14:06:42 +0000 (16:06 +0200)
committerChristoph Helma <helma@in-silico.ch>
Mon, 8 Jul 2019 14:06:42 +0000 (16:06 +0200)
Dockerfile [new file with mode: 0644]
gitweb.conf [new file with mode: 0644]
lighttpd.conf [new file with mode: 0644]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..28d267a
--- /dev/null
@@ -0,0 +1,14 @@
+FROM alpine:latest
+MAINTAINER Christoph Helma <helma@in-silico.ch>
+
+RUN apk update
+RUN apk add lighttpd git-gitweb git-daemon perl-cgi
+RUN rm -rf /var/cache/apk/*
+
+COPY gitweb.conf /etc/gitweb.conf
+COPY lighttpd.conf /etc/lighttpd/lighttpd.conf
+
+EXPOSE 80
+VOLUME /var/git
+
+CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf","2>&1"]
diff --git a/gitweb.conf b/gitweb.conf
new file mode 100644 (file)
index 0000000..3e818a7
--- /dev/null
@@ -0,0 +1,6 @@
+our $projectroot = "/var/git";
+our $site_name = "in silico toxicology git repositories";
+our $omit_owner = 1;
+our $default_projects_order = "age";
+$base_url = "https://git.in-silico.ch/";
+@git_base_url_list = ("https://git.in-silico.ch");
diff --git a/lighttpd.conf b/lighttpd.conf
new file mode 100644 (file)
index 0000000..3d546dc
--- /dev/null
@@ -0,0 +1,45 @@
+server.modules = (
+  "mod_rewrite",
+  "mod_alias",
+  "mod_access",
+  "mod_setenv",
+  "mod_cgi",
+  "mod_accesslog"
+)
+
+include "mime-types.conf"
+
+server.username      = "lighttpd"
+server.groupname     = "lighttpd"
+server.pid-file      = "/run/lighttpd.pid"
+server.document-root = "/usr/share/gitweb/"
+static-file.exclude-extensions = ( ".cgi" )
+
+$HTTP["url"] !~ "^/static" { # gitweb assets (js, css, png)
+
+       dir-listing.activate = "disable"
+       cgi.assign = ( ".cgi" => "" )
+       $HTTP["url"] =~ "^/.*/(HEAD|info/refs|objects/info/|git-(upload|receive)-pack)" { # git over http
+               cgi.assign = ("" => "")
+               alias.url += ( "/" => "/usr/libexec/git-core/git-http-backend/" )
+               setenv.add-environment = (
+                       "GIT_PROJECT_ROOT" => "/var/git",
+                       "GIT_HTTP_EXPORT_ALL" => ""
+               )
+       }
+       else $HTTP["url"] =~ "^/(?!gitweb.cgi)" { # gitweb
+               server.indexfiles = ( "gitweb.cgi" )
+               alias.url += ( "/" => "/usr/share/gitweb/" )
+               url.rewrite-once = ( "^/(.*)" => "/gitweb.cgi/$1" )
+       }
+}
+
+setenv.add-environment = (
+  "GITWEB_CONFIG" => "/etc/gitweb.conf",
+  "PATH" => env.PATH
+)
+
+#debug.log-request-header   = "enable"
+#debug.log-response-header  = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found   = "enable"