From 6e841e6e26ebceea74d4886bf824c4af52ff1be7 Mon Sep 17 00:00:00 2001 From: justusbunsi Date: Wed, 9 Jun 2021 22:35:50 +0800 Subject: [PATCH] Fix regression for creating repositories in root-based containers (#172) Due to #160 it was no longer possible to create repositories in root-based containers. This was caused by the missing `/tmp/gitea` directory in that image. It was dynamically created by Gitea internal functionality with less privileges than necessary. Explicitly creating the directory and set proper permissions fix this. Fixes: #171 Co-authored-by: JustusBunsi Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/172 Reviewed-by: luhahn Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: justusbunsi Co-committed-by: justusbunsi --- Chart.yaml | 2 +- templates/gitea/init.yaml | 5 +++++ templates/gitea/statefulset.yaml | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index be8ff92..355b59d 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -3,7 +3,7 @@ name: gitea description: Gitea Helm chart for Kubernetes type: application version: 0.0.0 -appVersion: 1.14.1 +appVersion: 1.14.2 icon: https://docs.gitea.io/images/gitea.png keywords: diff --git a/templates/gitea/init.yaml b/templates/gitea/init.yaml index c97c166..33184d7 100644 --- a/templates/gitea/init.yaml +++ b/templates/gitea/init.yaml @@ -23,6 +23,11 @@ stringData: chmod -R 700 /data/git/.ssh mkdir -p /data/gitea/conf + # prepare temp directory structure + mkdir -p "${GITEA_TEMP}" + chown 1000:1000 "${GITEA_TEMP}" + chmod ug+rwx "${GITEA_TEMP}" + # Copy config file to writable volume cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini chmod a+rwx /data/gitea/conf/app.ini diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index 78a0b18..e20e940 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -48,12 +48,16 @@ spec: value: /data/gitea - name: GITEA_WORK_DIR value: /data + - name: GITEA_TEMP + value: /tmp/gitea {{- if .Values.statefulset.env }} {{- toYaml .Values.statefulset.env | nindent 12 }} {{- end }} volumeMounts: - name: init mountPath: /usr/sbin + - name: temp + mountPath: /tmp - name: config mountPath: /etc/gitea/conf - name: data