Skip to content

Commit

Permalink
only chown directories during docker setup if necessary. Fix #4425 (#…
Browse files Browse the repository at this point in the history
…5064)

Signed-off-by: Fabian Braun <[email protected]>
  • Loading branch information
fabian-braun authored and techknowlogick committed Oct 30, 2018
1 parent 98ea1a5 commit d0f614a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker/etc/s6/gitea/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d0f614a

Please sign in to comment.