diff options
Diffstat (limited to 'services/docker/git-server/app')
| -rw-r--r-- | services/docker/git-server/app/cgit/common | 19 | ||||
| -rw-r--r-- | services/docker/git-server/app/cgit/private | 5 | ||||
| -rw-r--r-- | services/docker/git-server/app/cgit/public | 4 | ||||
| -rwxr-xr-x | services/docker/git-server/app/lighttpd-wrapper.bash | 10 | ||||
| -rw-r--r-- | services/docker/git-server/app/lighttpd/lighttpd.conf | 16 | 
5 files changed, 49 insertions, 5 deletions
diff --git a/services/docker/git-server/app/cgit/common b/services/docker/git-server/app/cgit/common new file mode 100644 index 0000000..90dda60 --- /dev/null +++ b/services/docker/git-server/app/cgit/common @@ -0,0 +1,19 @@ +css=/git/static/cgit.css +logo=/git/static/cgit.png +root-title=crupest Git Repos +source-filter=/usr/lib/cgit/filters/syntax-highlighting.py +about-filter=/usr/lib/cgit/filters/about-formatting.sh + +enable-http-clone=0 +enable-commit-graph=1 +enable-index-links=1 +enable-index-owner=0 +enable-log-filecount=1 +enable-log-linecount=1 +enable-git-config=1 +snapshots=tar.gz tar.bz2 zip + +readme=:README-repo.md +readme=:README.md +readme=:README +section-from-path=1 diff --git a/services/docker/git-server/app/cgit/private b/services/docker/git-server/app/cgit/private new file mode 100644 index 0000000..a5710b2 --- /dev/null +++ b/services/docker/git-server/app/cgit/private @@ -0,0 +1,5 @@ +cache-root=/var/cache/cgit/private +include=/app/cgit/common +strict-export=cgit-export +clone-url=$CRUPEST_ROOT_URL/git/private$CGIT_REPO_URL +scan-path=/git/repos/private diff --git a/services/docker/git-server/app/cgit/public b/services/docker/git-server/app/cgit/public new file mode 100644 index 0000000..022a333 --- /dev/null +++ b/services/docker/git-server/app/cgit/public @@ -0,0 +1,4 @@ +cache-root=/var/cache/cgit/public +include=/app/cgit/common +clone-url=$CRUPEST_ROOT_URL/git$CGIT_REPO_URL +scan-path=/git/repos/public diff --git a/services/docker/git-server/app/lighttpd-wrapper.bash b/services/docker/git-server/app/lighttpd-wrapper.bash index 54079ad..70055e7 100755 --- a/services/docker/git-server/app/lighttpd-wrapper.bash +++ b/services/docker/git-server/app/lighttpd-wrapper.bash @@ -1,8 +1,14 @@  #!/usr/bin/bash -set -e +set -e -o pipefail -[[ -f /git/user-info ]] || touch -a /git/user-info +die() { +  echo "$@" >&2 +  exit 1 +} + +[[ -n "$CRUPEST_ROOT_URL" ]] || die "CRUPEST_ROOT_URL is not set. It is needed to create clone url of repos." +[[ -f /git/user-info ]] || touch -a /git/user-info || die "Failed to create /git/user-info to save user accounts. Permission problem?"  exec 3>&1  exec 4>&1 diff --git a/services/docker/git-server/app/lighttpd/lighttpd.conf b/services/docker/git-server/app/lighttpd/lighttpd.conf index a96a778..d6c30cd 100644 --- a/services/docker/git-server/app/lighttpd/lighttpd.conf +++ b/services/docker/git-server/app/lighttpd/lighttpd.conf @@ -47,11 +47,21 @@ $HTTP["url"] =^ "/git" {      }      else {          alias.url += ( +            "/git/private" => "/usr/lib/cgit/cgit.cgi",              "/git" => "/usr/lib/cgit/cgit.cgi",          ) -        setenv.add-environment = ( -            "CGIT_CONFIG" => "/app/cgit/cgitrc" -        ) + +        $HTTP["url"] =^ "/git/private" { +            setenv.add-environment = ( +                "CGIT_CONFIG" => "/app/cgit/private" +            ) +        } +        else { +            setenv.add-environment = ( +                "CGIT_CONFIG" => "/app/cgit/public" +            ) +        } +          cgi.assign = ("" => "")      }  }  | 
