diff --git a/docker/s6/gogs/setup b/docker/s6/gogs/setup index 7d4358b39..8a95422ae 100755 --- a/docker/s6/gogs/setup +++ b/docker/s6/gogs/setup @@ -21,6 +21,13 @@ ln -sfn /data/git /home/git # Only chown for the first time, owner of '/data' is 'git' inside Docker after installation if [ $(stat -c '%U' /data) != 'git' ]; then - chown -R git:git /data /app/gogs ~git/ + chown -R git:git /data ~git/ fi + +# Check ownership of '/app/gogs' in case the image changed and '/data' is persistent +if [ $(stat -c '%U' /app/gogs) != 'git' ]; then + chown -R git:git /app/gogs +fi + + chmod 0755 /data /data/gogs ~git/