From ec2b69b0ecf8a179de70c7e38bb6531eca52dcfc Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 24 Jun 2023 00:44:32 +0200 Subject: [PATCH] [GITEA] environment-to-ini fails if run as root (cherry picked from commit 494f11afe81442f0b1b4d59f182e28c40b1842ac) (cherry picked from commit 883d3f3f0f2f6036033c1cfce4ee0e451d340ad6) --- docker/root/etc/s6/gitea/setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/root/etc/s6/gitea/setup b/docker/root/etc/s6/gitea/setup index b801ef4e03..90f9078d9f 100755 --- a/docker/root/etc/s6/gitea/setup +++ b/docker/root/etc/s6/gitea/setup @@ -56,11 +56,11 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then chown ${USER}:git ${GITEA_CUSTOM}/conf/app.ini fi -# Replace app.ini settings with env variables in the form GITEA__SECTION_NAME__KEY_NAME -environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini - # only chown if current owner is not already the gitea ${USER}. No recursive check to save time if ! [[ $(ls -ld /data/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/gitea; fi if ! [[ $(ls -ld /app/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /app/gitea; fi if ! [[ $(ls -ld /data/git | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/git; fi chmod 0755 /data/gitea /app/gitea /data/git + +# Replace app.ini settings with env variables in the form GITEA__SECTION_NAME__KEY_NAME +su $USER -c "environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini"