summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2019-07-08 16:06:42 +0200
committerChristoph Helma <helma@in-silico.ch>2019-07-08 16:06:42 +0200
commit9e007eb7de831bb6e8542d7edab51c839533bda8 (patch)
tree17268961dc65adf1e8858c624e08ed35009050eb
gitweb as docker service, initial commitHEADmaster
-rw-r--r--Dockerfile14
-rw-r--r--gitweb.conf6
-rw-r--r--lighttpd.conf45
3 files changed, 65 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..28d267a
--- /dev/null
+++ b/Dockerfile
@@ -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
index 0000000..3e818a7
--- /dev/null
+++ b/gitweb.conf
@@ -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
index 0000000..3d546dc
--- /dev/null
+++ b/lighttpd.conf
@@ -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"