Be noisy about updating permissions

In #75, I mentioned that I was a little stumped why my Nextcloud container was showing a `502 Bad Gateway` error. In the end, it turned out that it was just updating the permissions in the container, which are set to `nobody:nogroup`, but need to be chowned to `991:991` when first starting a fresh container. This PR seeks to make that a little more obvious to the user, in case they choose to use `docker-compose logs -f nextcloud` or such.
This commit is contained in:
Conor Anderson 2017-01-16 16:32:16 -05:00 committed by GitHub
parent 321e04e9d5
commit 18d29d7dbf

View File

@ -10,11 +10,16 @@ sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /etc/nginx/nginx.conf /etc/ph
ln -sf /config/config.php /nextcloud/config/config.php &>/dev/null ln -sf /config/config.php /nextcloud/config/config.php &>/dev/null
ln -sf /apps2 /nextcloud &>/dev/null ln -sf /apps2 /nextcloud &>/dev/null
echo "Updating permissions..."
for dir in /nextcloud /data /config /apps2 /etc/nginx /etc/php7 /var/log /var/lib/nginx /var/lib/redis /tmp /etc/s6.d; do for dir in /nextcloud /data /config /apps2 /etc/nginx /etc/php7 /var/log /var/lib/nginx /var/lib/redis /tmp /etc/s6.d; do
if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
echo "Updating permissions in $dir..."
chown -R $UID:$GID $dir chown -R $UID:$GID $dir
else
echo "Permissions in $dir are correct."
fi fi
done done
echo "Done updating permissions."
if [ ! -f /config/config.php ]; then if [ ! -f /config/config.php ]; then
# New installation, run the setup # New installation, run the setup