aboutsummaryrefslogtreecommitdiff
path: root/docker/git-server
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-02-22 18:11:35 +0800
committerYuqian Yang <crupest@crupest.life>2025-02-23 01:36:11 +0800
commit1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8 (patch)
tree585b6124b0100371b4bd8a291c4a59fbb5fbf1fe /docker/git-server
parenta931457d61b053682d5e89a0cfb411e43e5e21c7 (diff)
downloadcrupest-1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8.tar.gz
crupest-1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8.tar.bz2
crupest-1e9b2436eaffa4130f6a69c3a108f6feb9dd4ac8.zip
feat(services): refactor structure.
Diffstat (limited to 'docker/git-server')
-rw-r--r--docker/git-server/Dockerfile24
-rw-r--r--docker/git-server/cgitrc.template20
-rw-r--r--docker/git-server/git-auth.conf3
-rw-r--r--docker/git-server/git-lighttpd.conf41
-rwxr-xr-xdocker/git-server/lighttpd-wrapper3
5 files changed, 0 insertions, 91 deletions
diff --git a/docker/git-server/Dockerfile b/docker/git-server/Dockerfile
deleted file mode 100644
index 389b777..0000000
--- a/docker/git-server/Dockerfile
+++ /dev/null
@@ -1,24 +0,0 @@
-
-FROM debian:latest AS lighttpd-config-generator
-RUN apt-get update && apt-get install -y apache2-utils
-RUN --mount=type=secret,id=git-server,required=true \
- . /run/secrets/git-server && \
- htpasswd -cb /user-info ${CRUPEST_GIT_SERVER_USERNAME} ${CRUPEST_GIT_SERVER_PASSWORD}
-ARG ROOT_URL
-ADD cgitrc.template /cgitrc.template
-RUN sed "s|@@CRUPEST_ROOT_URL@@|${ROOT_URL}|g" /cgitrc.template > /cgitrc
-
-FROM debian:latest
-RUN apt-get update && apt-get install -y \
- git cgit lighttpd apache2-utils python3-pygments python3-markdown \
- tar gzip bzip2 zip unzip tini && \
- rm -rf /var/lib/apt/lists/*
-
-COPY --from=lighttpd-config-generator /user-info /app/
-COPY --from=lighttpd-config-generator /cgitrc /etc/cgitrc
-ADD git-lighttpd.conf git-auth.conf /app/
-ADD --chmod=755 lighttpd-wrapper /app/
-
-VOLUME [ "/git" ]
-ENTRYPOINT ["/usr/bin/tini", "--"]
-CMD [ "/app/lighttpd-wrapper" ]
diff --git a/docker/git-server/cgitrc.template b/docker/git-server/cgitrc.template
deleted file mode 100644
index f3c61eb..0000000
--- a/docker/git-server/cgitrc.template
+++ /dev/null
@@ -1,20 +0,0 @@
-css=/git/static/cgit.css
-logo=/git/static/cgit.png
-root-title=crupest Git Repos
-
-enable-http-clone=0
-enable-commit-graph=1
-enable-index-links=1
-enable-index-owner=0
-enable-log-filecount=1
-enable-log-linecount=1
-section-from-path=1
-
-clone-url=@@CRUPEST_ROOT_URL@@/$CGIT_REPO_URL
-snapshots=tar.gz tar.bz2 zip
-source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
-about-filter=/usr/lib/cgit/filters/about-formatting.sh
-readme=:README.md
-readme=:README
-
-scan-path=/git/
diff --git a/docker/git-server/git-auth.conf b/docker/git-server/git-auth.conf
deleted file mode 100644
index 2908bec..0000000
--- a/docker/git-server/git-auth.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-auth.backend = "htpasswd"
-auth.backend.htpasswd.userfile = "/app/user-info"
-auth.require = ( "" => ("method" => "basic", "realm" => "Git Access", "require" => "valid-user") )
diff --git a/docker/git-server/git-lighttpd.conf b/docker/git-server/git-lighttpd.conf
deleted file mode 100644
index 5d946bc..0000000
--- a/docker/git-server/git-lighttpd.conf
+++ /dev/null
@@ -1,41 +0,0 @@
-server.modules += ("mod_accesslog")
-server.modules += ("mod_auth", "mod_authn_file")
-server.modules += ("mod_setenv", "mod_cgi", "mod_alias")
-
-server.document-root = "/var/www/html/"
-accesslog.filename = "/dev/fd/3"
-
-$HTTP["url"] =^ "/git" {
- mimetype.assign = ( ".css" => "text/css" )
-
- $HTTP["url"] =~ "^/git/.*/(HEAD|info/refs|objects/info/[^/]+|git-(upload|receive)-pack)$" {
- $HTTP["querystring"] =~ "service=git-receive-pack" {
- include "git-auth.conf"
- }
- $HTTP["url"] =~ "^/git/.*/git-receive-pack$" {
- include "git-auth.conf"
- }
- alias.url += ( "/git" => "/usr/lib/git-core/git-http-backend" )
- setenv.add-environment = (
- "GIT_PROJECT_ROOT" => "/git",
- "GIT_HTTP_EXPORT_ALL" => ""
- )
- cgi.assign = ("" => "")
- }
- else $HTTP["url"] =~ "^/git/.*/((objects/[0-9a-f]{2}/[0-9a-f]{38})|(pack/pack-[0-9a-f]{40}.(pack|idx)))$" {
- alias.url += (
- "/git" => "/git",
- )
- }
- else $HTTP["url"] =^ "/git/static" {
- alias.url += (
- "/git/static" => "/usr/share/cgit",
- )
- }
- else {
- alias.url += (
- "/git" => "/usr/lib/cgit/cgit.cgi",
- )
- cgi.assign = ("" => "")
- }
-}
diff --git a/docker/git-server/lighttpd-wrapper b/docker/git-server/lighttpd-wrapper
deleted file mode 100755
index f071c13..0000000
--- a/docker/git-server/lighttpd-wrapper
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 3>&1
-lighttpd -D -f /app/git-lighttpd.conf