diff options
Diffstat (limited to 'services/docker/git-server')
| -rw-r--r-- | services/docker/git-server/Dockerfile | 7 | ||||
| -rw-r--r-- | services/docker/git-server/app/git/gitconfig | 3 | ||||
| -rwxr-xr-x | services/docker/git-server/app/git/hooks/update (renamed from services/docker/git-server/hooks/update) | 0 | ||||
| -rwxr-xr-x | services/docker/git-server/app/lighttpd-wrapper.bash | 9 | ||||
| -rw-r--r-- | services/docker/git-server/app/lighttpd/auth.conf (renamed from services/docker/git-server/git-auth.conf) | 0 | ||||
| -rw-r--r-- | services/docker/git-server/app/lighttpd/lighttpd.conf (renamed from services/docker/git-server/git-lighttpd.conf) | 19 | ||||
| -rw-r--r-- | services/docker/git-server/gitconfig | 6 | ||||
| -rwxr-xr-x | services/docker/git-server/lighttpd-wrapper.bash | 8 | 
8 files changed, 28 insertions, 24 deletions
diff --git a/services/docker/git-server/Dockerfile b/services/docker/git-server/Dockerfile index 274ba6a..867021c 100644 --- a/services/docker/git-server/Dockerfile +++ b/services/docker/git-server/Dockerfile @@ -5,12 +5,9 @@ RUN apt-get update && apt-get install -y \      rm -rf /var/lib/apt/lists/*  RUN groupadd -g 1000 git && useradd -m -u 1000 -g 1000 -s /usr/bin/bash git -ENV GIT_CONFIG_SYSTEM=/etc/gitconfig GIT_CONFIG_GLOBAL=/git/private/gitconfig - -ADD gitconfig /etc/gitconfig -ADD hooks/* /etc/git/hooks/ -ADD git-lighttpd.conf git-auth.conf lighttpd-wrapper.bash /app/ +ENV GIT_CONFIG_SYSTEM=/app/git/gitconfig GIT_CONFIG_GLOBAL=/git/gitconfig +ADD app /app  USER git:git  VOLUME [ "/git" ]  CMD [ "tini", "--", "/app/lighttpd-wrapper.bash" ] diff --git a/services/docker/git-server/app/git/gitconfig b/services/docker/git-server/app/git/gitconfig new file mode 100644 index 0000000..5cc41dd --- /dev/null +++ b/services/docker/git-server/app/git/gitconfig @@ -0,0 +1,3 @@ +[core] +	autocrlf = false +	hooksPath = /app/git/hooks/ diff --git a/services/docker/git-server/hooks/update b/services/docker/git-server/app/git/hooks/update index d6bfc1a..d6bfc1a 100755 --- a/services/docker/git-server/hooks/update +++ b/services/docker/git-server/app/git/hooks/update diff --git a/services/docker/git-server/app/lighttpd-wrapper.bash b/services/docker/git-server/app/lighttpd-wrapper.bash new file mode 100755 index 0000000..54079ad --- /dev/null +++ b/services/docker/git-server/app/lighttpd-wrapper.bash @@ -0,0 +1,9 @@ +#!/usr/bin/bash + +set -e + +[[ -f /git/user-info ]] || touch -a /git/user-info + +exec 3>&1 +exec 4>&1 +exec lighttpd -D -f /app/lighttpd/lighttpd.conf diff --git a/services/docker/git-server/git-auth.conf b/services/docker/git-server/app/lighttpd/auth.conf index d643659..d643659 100644 --- a/services/docker/git-server/git-auth.conf +++ b/services/docker/git-server/app/lighttpd/auth.conf diff --git a/services/docker/git-server/git-lighttpd.conf b/services/docker/git-server/app/lighttpd/lighttpd.conf index 44e0fd6..a96a778 100644 --- a/services/docker/git-server/git-lighttpd.conf +++ b/services/docker/git-server/app/lighttpd/lighttpd.conf @@ -1,27 +1,33 @@  server.modules += ("mod_accesslog") +server.modules += ("mod_rewrite")  server.modules += ("mod_auth", "mod_authn_file", "mod_access")  server.modules += ("mod_alias", "mod_setenv", "mod_cgi")  server.port = 3636  server.document-root = "/var/www/html/"  accesslog.filename = "/dev/fd/3" +server.breakagelog = "/dev/fd/4"  $HTTP["url"] =^ "/git" {      mimetype.assign = ( ".css" => "text/css" )      $HTTP["url"] =^ "/git/private" { -        include "git-auth.conf" +        include "auth.conf"      }      $HTTP["url"] =~ "^/git/.*/(HEAD|info/refs|objects/info/[^/]+|git-(upload|receive)-pack)$" { +        url.rewrite-once = ( +            "^/git/private"  => "$0", +            "^/git(.*)" => "/git/public$1" +        ) +          $HTTP["querystring"] =~ "service=git-receive-pack" { -            include "git-auth.conf" +            include "auth.conf"          }          $HTTP["url"] =~ "^/git/.*/git-receive-pack$" { -            include "git-auth.conf" +            include "auth.conf"          } -        alias.url += ( "/git/private" => "/usr/lib/git-core/git-http-backend/private" ) -        alias.url += ( "/git" => "/usr/lib/git-core/git-http-backend/public" ) +        alias.url += ( "/git" => "/usr/lib/git-core/git-http-backend" )          setenv.add-environment = (              "GIT_PROJECT_ROOT" => "/git/repos",              "GIT_HTTP_EXPORT_ALL" => "" @@ -43,6 +49,9 @@ $HTTP["url"] =^ "/git" {          alias.url += (              "/git" => "/usr/lib/cgit/cgit.cgi",          ) +        setenv.add-environment = ( +            "CGIT_CONFIG" => "/app/cgit/cgitrc" +        )          cgi.assign = ("" => "")      }  } diff --git a/services/docker/git-server/gitconfig b/services/docker/git-server/gitconfig deleted file mode 100644 index 0019ba9..0000000 --- a/services/docker/git-server/gitconfig +++ /dev/null @@ -1,6 +0,0 @@ -[core] -	autocrlf = false -	hooksPath = /etc/git/hooks/ - -[receive] -	advertisePushOptions = true diff --git a/services/docker/git-server/lighttpd-wrapper.bash b/services/docker/git-server/lighttpd-wrapper.bash deleted file mode 100755 index a33015a..0000000 --- a/services/docker/git-server/lighttpd-wrapper.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/bash - -set -e - -touch -a /git/user-info - -exec 3>&1 -exec lighttpd -D -f /app/git-lighttpd.conf  | 
