From cb3829b84863e60f999fcbac240c320792d87bf5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 10 Jan 2026 20:28:47 +0200 Subject: Simplify git-server path from /repos/repos to /repos Changes: - Mount PVC with subPath: repos in deployment - Update cgit scan-path from /repos/repos to /repos - Update git-http-backend GIT_PROJECT_ROOT to /repos - Update all documentation to reflect simplified paths This eliminates the redundant /repos/repos duplication and simplifies all git URLs to ssh://git@r0:30022/repos/.git format. Co-Authored-By: Claude Sonnet 4.5 --- f3s/git-server/helm-chart/README.md | 18 +++++++++--------- .../helm-chart/templates/configmap-cgit.yaml | 4 ++-- f3s/git-server/helm-chart/templates/deployment.yaml | 10 ++++++---- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'f3s/git-server') diff --git a/f3s/git-server/helm-chart/README.md b/f3s/git-server/helm-chart/README.md index 52a3d12..9d508e5 100644 --- a/f3s/git-server/helm-chart/README.md +++ b/f3s/git-server/helm-chart/README.md @@ -45,10 +45,10 @@ Repository structure: **External** (from your workstation): ```bash # Via SSH config alias -git clone git-server:/repos/repos/.git +git clone git-server:/repos/.git # Or directly -git clone ssh://git@r0:30022/repos/repos/.git +git clone ssh://git@r0:30022/repos/.git ``` **SSH Configuration** (`~/.ssh/config`): @@ -107,14 +107,14 @@ Gitsyncer syncs repositories from Codeberg/GitHub to the self-hosted git-server "name": "snonux" }, { - "host": "ssh://git@r0:30022/repos/repos", + "host": "ssh://git@r0:30022/repos", "backupLocation": true } ] } ``` -**Note**: The config uses explicit NodePort (30022) on cluster node r0. You could also use an SSH alias (see below) with `git@git-server:/repos/repos` for shorter syntax. +**Note**: The config uses explicit NodePort (30022) on cluster node r0. You could also use an SSH alias (see below) with `git@git-server:/repos` for shorter syntax. ### SSH Config for Gitsyncer (Optional) @@ -208,7 +208,7 @@ spec: # Change from SSH to HTTP kubectl edit application -n cicd -# Old: ssh://git@git-server.cicd.svc.cluster.local/repos/repos/conf.git +# Old: ssh://git@git-server.cicd.svc.cluster.local/repos/conf.git # New: http://git-server.cicd.svc.cluster.local/conf.git ``` @@ -324,7 +324,7 @@ kubectl logs -n cicd -l app=git-server -c cgit --tail=50 # Common error: "fatal: detected dubious ownership" # Already fixed in deployment with: -# git config --global --add safe.directory /repos/repos/.git +# git config --global --add safe.directory /repos/.git # HOME=/tmp (for cgit container) ``` @@ -332,14 +332,14 @@ kubectl logs -n cicd -l app=git-server -c cgit --tail=50 **Symptom**: Repository exists but doesn't show in web UI -**Cause**: cgit scans `/repos/repos/` directory +**Cause**: cgit scans `/repos/` directory **Verify**: ```bash # Check scan-path in cgit config kubectl get configmap cgit-config -n cicd -o yaml -# Should show: scan-path=/repos/repos +# Should show: scan-path=/repos ``` **Fix**: Restart cgit container @@ -375,7 +375,7 @@ kubectl exec -n cicd -c git-server $(kubectl get pod -n cicd -l app=git-server - **Symptom**: ``` -fatal: unrecognized command 'mkdir -p repos/repos/.git && cd repos/repos/.git && git init --bare' +fatal: unrecognized command 'mkdir -p repos/.git && cd repos/.git && git init --bare' ``` **Cause**: git-shell restricts available commands (security feature) diff --git a/f3s/git-server/helm-chart/templates/configmap-cgit.yaml b/f3s/git-server/helm-chart/templates/configmap-cgit.yaml index 9aba781..519ab26 100644 --- a/f3s/git-server/helm-chart/templates/configmap-cgit.yaml +++ b/f3s/git-server/helm-chart/templates/configmap-cgit.yaml @@ -24,6 +24,6 @@ data: # Remove .git suffix from repository URLs remove-suffix=1 - # Scan for repositories in /repos/repos + # Scan for repositories in /repos # This must be the last setting in the file - scan-path=/repos/repos + scan-path=/repos diff --git a/f3s/git-server/helm-chart/templates/deployment.yaml b/f3s/git-server/helm-chart/templates/deployment.yaml index e0fcaf3..1ed7486 100644 --- a/f3s/git-server/helm-chart/templates/deployment.yaml +++ b/f3s/git-server/helm-chart/templates/deployment.yaml @@ -77,6 +77,7 @@ spec: volumeMounts: - name: repos mountPath: /repos + subPath: repos - name: git-ssh-writable mountPath: /home/git/.ssh - name: ssh-host-keys @@ -102,11 +103,11 @@ spec: args: - | # Add git safe.directory exception for repository ownership - git config --global --add safe.directory /repos/repos/conf.git + git config --global --add safe.directory /repos/conf.git # 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 + git config --file /repos/conf.git/config http.receivepack true + git config --file /repos/conf.git/config http.uploadpack true # Copy nginx configs to writable location and modify them cp /etc/nginx/nginx.conf /tmp/nginx.conf @@ -127,7 +128,7 @@ spec: location ~ ^/([^/]+\\.git)/(.*) {\ fastcgi_pass unix:/tmp/fcgiwrap.sock;\ fastcgi_param SCRIPT_FILENAME /tmp/git-http-backend;\ - fastcgi_param GIT_PROJECT_ROOT /repos/repos;\ + fastcgi_param GIT_PROJECT_ROOT /repos;\ fastcgi_param GIT_HTTP_EXPORT_ALL "";\ fastcgi_param PATH_INFO /$1/$2;\ fastcgi_param REMOTE_USER $remote_user;\ @@ -160,6 +161,7 @@ spec: volumeMounts: - name: repos mountPath: /repos + subPath: repos readOnly: false - name: cgit-config mountPath: /etc/cgitrc -- cgit v1.2.3