]> source.dussan.org Git - gitea.git/commitdiff
only chown directories during docker setup if necessary. Fix #4425 (#5064)
authorFabian Braun <fabian-braun@users.noreply.github.com>
Tue, 30 Oct 2018 15:41:41 +0000 (16:41 +0100)
committertechknowlogick <hello@techknowlogick.com>
Tue, 30 Oct 2018 15:41:41 +0000 (11:41 -0400)
Signed-off-by: Fabian Braun <fabian-braun@mailbox.org>
docker/etc/s6/gitea/setup

index 03758ed819ac1bb3d4584980f96ccdd35f121ffe..2b0fb6c37bb36b12a810595ef4b17d8d7124b8a5 100755 (executable)
@@ -39,5 +39,8 @@ if [ ! -f /data/gitea/conf/app.ini ]; then
     envsubst < /etc/templates/app.ini > /data/gitea/conf/app.ini
 fi
 
-chown -R ${USER}:git /data/gitea /app/gitea /data/git
+# 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