diff options
author | Fabian Braun <fabian-braun@users.noreply.github.com> | 2018-10-30 16:41:41 +0100 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-10-30 11:41:41 -0400 |
commit | d0f614a25bd0bb48f43f8039f016dacc46498645 (patch) | |
tree | bd09d12622eb3d16af161b56ba06088afb6185c1 /docker | |
parent | 98ea1a5143487477b25e6684ca43bd5d50b7b4c3 (diff) | |
download | gitea-d0f614a25bd0bb48f43f8039f016dacc46498645.tar.gz gitea-d0f614a25bd0bb48f43f8039f016dacc46498645.zip |
only chown directories during docker setup if necessary. Fix #4425 (#5064)
Signed-off-by: Fabian Braun <fabian-braun@mailbox.org>
Diffstat (limited to 'docker')
-rwxr-xr-x | docker/etc/s6/gitea/setup | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docker/etc/s6/gitea/setup b/docker/etc/s6/gitea/setup index 03758ed819..2b0fb6c37b 100755 --- a/docker/etc/s6/gitea/setup +++ b/docker/etc/s6/gitea/setup @@ -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 |