summaryrefslogtreecommitdiff
path: root/f3s/git-server
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-10 11:53:52 +0200
committerPaul Buetow <paul@buetow.org>2026-01-10 11:53:52 +0200
commit2e4b6a0c4e8b939ac9af48b6d909773ed97748c7 (patch)
tree44d7bba6930c1906ec7a6c8b9564f6e079624a13 /f3s/git-server
parent87cfd924dd1131286db36d1d9e1a9df020c4400d (diff)
Add initContainer to install git-http-backend
- New initContainer installs git and copies git-http-backend to shared /tmp volume - Updated nginx config to use /tmp/git-http-backend - Removed apk add from cgit container (was failing due to non-root user)
Diffstat (limited to 'f3s/git-server')
-rw-r--r--f3s/git-server/helm-chart/templates/deployment.yaml22
1 files changed, 18 insertions, 4 deletions
diff --git a/f3s/git-server/helm-chart/templates/deployment.yaml b/f3s/git-server/helm-chart/templates/deployment.yaml
index 45e246a..168fe17 100644
--- a/f3s/git-server/helm-chart/templates/deployment.yaml
+++ b/f3s/git-server/helm-chart/templates/deployment.yaml
@@ -49,6 +49,22 @@ spec:
- name: git-ssh-writable
mountPath: /ssh-git
+ - name: install-git-http-backend
+ image: alpine:3.19
+ command:
+ - /bin/sh
+ - -c
+ - |
+ # Install git package (includes git-http-backend)
+ apk add --no-cache git
+ # Copy git-http-backend to shared volume
+ mkdir -p /git-binaries
+ cp /usr/libexec/git-core/git-http-backend /git-binaries/
+ chmod 755 /git-binaries/git-http-backend
+ volumeMounts:
+ - name: cgit-runtime
+ mountPath: /git-binaries
+
containers:
# Container 1: SSH Git Server
- name: git-server
@@ -85,9 +101,6 @@ spec:
command: ["/bin/sh", "-c"]
args:
- |
- # Install git-daemon package which provides git-http-backend
- apk add --no-cache git-daemon
-
# Configure git repository for HTTP access
git config --file /repos/repos/conf.git/config http.receivepack true
git config --file /repos/repos/conf.git/config http.uploadpack true
@@ -105,11 +118,12 @@ spec:
# Add git-http-backend location to default.conf (insert before the cgit location)
# Find the server block and add the location directive
+ # Note: git-http-backend is copied to /tmp by initContainer
sed -i '/location \/ {/i \
# Git HTTP backend for clone/fetch/pull operations\
location ~ ^/([^/]+\\.git)/(.*) {\
fastcgi_pass unix:/tmp/fcgiwrap.sock;\
- fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;\
+ fastcgi_param SCRIPT_FILENAME /tmp/git-http-backend;\
fastcgi_param GIT_PROJECT_ROOT /repos/repos;\
fastcgi_param GIT_HTTP_EXPORT_ALL "";\
fastcgi_param PATH_INFO /$1/$2;\