From 9e007eb7de831bb6e8542d7edab51c839533bda8 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 8 Jul 2019 16:06:42 +0200 Subject: gitweb as docker service, initial commit --- Dockerfile | 14 ++++++++++++++ gitweb.conf | 6 ++++++ lighttpd.conf | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 Dockerfile create mode 100644 gitweb.conf create mode 100644 lighttpd.conf 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 + +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" -- cgit v1.2.3