aboutsummaryrefslogtreecommitdiff
path: root/docker/s6/gogs/setup
diff options
context:
space:
mode:
authorAchilleas Koutsou <achilleas.k@gmail.com>2020-01-22 19:22:30 +0100
committerᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-01-23 02:22:30 +0800
commit91e9495148378ccb2766a63c1e8191d6787fab02 (patch)
tree8809ff3c8062cb7cd645c4134de5de7db4aea1b9 /docker/s6/gogs/setup
parent873966aa869f6934619f4643d6f672155d8b19dd (diff)
docker: check "/app/gogs" separately on startup (#5895)
When running gogs after the first time, if the image has changed (update rebuild), the /app/gogs directory will have changed owner back to root:root, but /data will likely not be since the data directories are likely to be persistent. Checking /app/gogs separately fixes this.
Diffstat (limited to 'docker/s6/gogs/setup')
-rwxr-xr-xdocker/s6/gogs/setup9
1 files changed, 8 insertions, 1 deletions
diff --git a/docker/s6/gogs/setup b/docker/s6/gogs/setup
index 7d4358b3..8a95422a 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/