mirror of
				https://github.com/hoellen/dockerfiles.git
				synced 2025-11-04 00:06:44 +00:00 
			
		
		
		
	[nextcloud] fix permissions check
This commit is contained in:
		@@ -17,7 +17,7 @@ ENV UID=991 GID=991 \
 | 
			
		||||
    TZ=Etc/UTC \
 | 
			
		||||
    DB_TYPE=sqlite3 \
 | 
			
		||||
    DOMAIN=localhost \
 | 
			
		||||
    ChECK_PERMISSIONS=1
 | 
			
		||||
    CHECK_PERMISSIONS=1
 | 
			
		||||
 | 
			
		||||
RUN apk -U upgrade \
 | 
			
		||||
 && apk add -t build-dependencies \
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ ENV UID=991 GID=991 \
 | 
			
		||||
    TZ=Etc/UTC \
 | 
			
		||||
    DB_TYPE=sqlite3 \
 | 
			
		||||
    DOMAIN=localhost \
 | 
			
		||||
    ChECK_PERMISSIONS=1
 | 
			
		||||
    CHECK_PERMISSIONS=1
 | 
			
		||||
 | 
			
		||||
RUN apk -U upgrade \
 | 
			
		||||
 && apk add -t build-dependencies \
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ Other tags than `daily` are built weekly. For security reasons, you should occas
 | 
			
		||||
- **DB_USER** : username for database *(default : none)*
 | 
			
		||||
- **DB_PASSWORD** : password for database user *(default : none)*
 | 
			
		||||
- **DB_HOST** : database host *(default : none)*
 | 
			
		||||
- **CHECK_PERMISSIONS** : disable permission check *(default: 1)*
 | 
			
		||||
- **CHECK_PERMISSIONS** : disable permission check for /data folder *(default: 1)*
 | 
			
		||||
 | 
			
		||||
Don't forget to use a **strong password** for the admin account!
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,20 +22,20 @@ if [ ! -d /data/session ]; then
 | 
			
		||||
  mkdir -p /data/session;
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ "$CHECK_PERMISSIONS" = "1" ]; then
 | 
			
		||||
  echo "Updating permissions..."
 | 
			
		||||
  for dir in /nextcloud /data /config /apps2 /var/log /php /nginx /tmp /etc/s6.d; do
 | 
			
		||||
    if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
 | 
			
		||||
      echo "Updating permissions in $dir..."
 | 
			
		||||
      chown -R $UID:$GID $dir
 | 
			
		||||
    else
 | 
			
		||||
      echo "Permissions in $dir are correct."
 | 
			
		||||
    fi
 | 
			
		||||
  done
 | 
			
		||||
  echo "Done updating permissions."
 | 
			
		||||
else
 | 
			
		||||
  echo "Skip checking permissions"
 | 
			
		||||
fi
 | 
			
		||||
echo "Updating permissions..."
 | 
			
		||||
for dir in /nextcloud /data /config /apps2 /var/log /php /nginx /tmp /etc/s6.d; do
 | 
			
		||||
  if [ "$dir" = "/data" ] && [ "$CHECK_PERMISSIONS" = "0" ]; then
 | 
			
		||||
    echo "WARNING: Skip checking permissions for /data"
 | 
			
		||||
    continue
 | 
			
		||||
  fi
 | 
			
		||||
  if $(find $dir ! -user $UID -o ! -group $GID|egrep '.' -q); then
 | 
			
		||||
    echo "Updating permissions in $dir..."
 | 
			
		||||
    chown -R $UID:$GID $dir
 | 
			
		||||
  else
 | 
			
		||||
    echo "Permissions in $dir are correct."
 | 
			
		||||
  fi
 | 
			
		||||
done
 | 
			
		||||
echo "Done updating permissions."
 | 
			
		||||
 | 
			
		||||
if [ ! -f /config/config.php ]; then
 | 
			
		||||
    # New installation, run the setup
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user