summaryrefslogtreecommitdiff
path: root/f3s/git-server
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-10 20:28:47 +0200
committerPaul Buetow <paul@buetow.org>2026-01-10 20:28:47 +0200
commitcb3829b84863e60f999fcbac240c320792d87bf5 (patch)
tree6c330bade85fdf0cef360b9f86650eba95c27d84 /f3s/git-server
parent90abde069fac1f5d4741ff1773462ff5d5f6916e (diff)
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/<repo>.git format. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'f3s/git-server')
-rw-r--r--f3s/git-server/helm-chart/README.md18
-rw-r--r--f3s/git-server/helm-chart/templates/configmap-cgit.yaml4
-rw-r--r--f3s/git-server/helm-chart/templates/deployment.yaml10
3 files changed, 17 insertions, 15 deletions
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/<repo>.git
+git clone git-server:/repos/<repo>.git
# Or directly
-git clone ssh://git@r0:30022/repos/repos/<repo>.git
+git clone ssh://git@r0:30022/repos/<repo>.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 <app-name> -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/<repo>.git
+# git config --global --add safe.directory /repos/<repo>.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/<repo>.git && cd repos/repos/<repo>.git && git init --bare'
+fatal: unrecognized command 'mkdir -p repos/<repo>.git && cd repos/<repo>.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