Merge pull request #2061 from nextcloud/fix/2057/install-check

fix install check for primary object storage
This commit is contained in:
Simon L 2023-02-23 17:48:30 +01:00 committed by GitHub
commit 70eefd1f0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -215,6 +215,7 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
# Try to force generation of appdata dir: # Try to force generation of appdata dir:
php /var/www/html/occ maintenance:repair php /var/www/html/occ maintenance:repair
if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
max_retries=10 max_retries=10
try=0 try=0
while [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ] && [ "$try" -lt "$max_retries" ]; do while [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ] && [ "$try" -lt "$max_retries" ]; do
@ -229,6 +230,7 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then
touch "$NEXTCLOUD_DATA_DIR/install.failed" touch "$NEXTCLOUD_DATA_DIR/install.failed"
exit 1 exit 1
fi fi
fi
# unset admin password # unset admin password
unset ADMIN_PASSWORD unset ADMIN_PASSWORD
@ -357,18 +359,18 @@ else
SKIP_UPDATE=1 SKIP_UPDATE=1
fi fi
# Check if appdata is present if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
# If not, something broke (e.g. changing ncdatadir after aio was first started) # Check if appdata is present
if [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ]; then # If not, something broke (e.g. changing ncdatadir after aio was first started)
if [ -z "$(find "$NEXTCLOUD_DATA_DIR/" -maxdepth 1 -mindepth 1 -type d -name "appdata_*")" ]; then
echo "Appdata is not present. Did you maybe change the datadir after aio was first started?" echo "Appdata is not present. Did you maybe change the datadir after aio was first started?"
echo "See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir" echo "See https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir"
echo "In the datadir was found:" echo "In the datadir was found:"
ls -la "$NEXTCLOUD_DATA_DIR/" ls -la "$NEXTCLOUD_DATA_DIR/"
exit 1 exit 1
fi fi
# Configure tempdirectory # Configure tempdirectory
if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then
mkdir -p "$NEXTCLOUD_DATA_DIR/tmp/" mkdir -p "$NEXTCLOUD_DATA_DIR/tmp/"
if ! grep -q upload_tmp_dir /usr/local/etc/php/conf.d/nextcloud.ini; then if ! grep -q upload_tmp_dir /usr/local/etc/php/conf.d/nextcloud.ini; then
echo "upload_tmp_dir = $NEXTCLOUD_DATA_DIR/tmp/" >> /usr/local/etc/php/conf.d/nextcloud.ini echo "upload_tmp_dir = $NEXTCLOUD_DATA_DIR/tmp/" >> /usr/local/etc/php/conf.d/nextcloud.ini