From ce69882180bb07d07d4e95ac0398b580484d27b5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 10 Feb 2022 11:37:53 +0000 Subject: [PATCH] Fix issue with docker-rootless shimming script (#18690) (#18699) Backport #18690 There is a problem with the current shimming script in that it will double quote the provided GITEA_APP_INI due to a mistake in the bash. Here we change this to use a bash array. Fix https://gitea.com/gitea/helm-chart/issues/287 Signed-off-by: Andrew Thornton --- contrib/fhs-compliant-script/gitea | 6 ++---- docker/rootless/usr/local/bin/gitea | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/contrib/fhs-compliant-script/gitea b/contrib/fhs-compliant-script/gitea index ae1ae3cf14..ea033b0f2d 100755 --- a/contrib/fhs-compliant-script/gitea +++ b/contrib/fhs-compliant-script/gitea @@ -33,10 +33,8 @@ for i in "$@"; do done if [ -z "$APP_INI_SET" ]; then - CONF_ARG="-c \"$APP_INI\"" + CONF_ARG=("-c" "${GITEA_APP_INI:-$APP_INI}") fi # Provide FHS compliant defaults -GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@" - - +GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" "${CONF_ARG[@]}" "$@" diff --git a/docker/rootless/usr/local/bin/gitea b/docker/rootless/usr/local/bin/gitea index 1b33ca8547..9a9a569b12 100644 --- a/docker/rootless/usr/local/bin/gitea +++ b/docker/rootless/usr/local/bin/gitea @@ -32,11 +32,9 @@ for i in "$@"; do done if [ -z "$APP_INI_SET" ]; then - CONF_ARG="-c \"${GITEA_APP_INI:-$APP_INI}\"" + CONF_ARG=("-c" "${GITEA_APP_INI:-$APP_INI}") fi # Provide docker defaults -GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@" - - +GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" "${CONF_ARG[@]}" "$@"