fix: auto-fix linting issues

This commit is contained in:
alexbelgium
2025-06-10 10:06:17 +00:00
committed by github-actions[bot]
parent e5adbd266f
commit f728166b14
197 changed files with 5747 additions and 5714 deletions

View File

@@ -12,12 +12,12 @@ if [ ! -f /app/www/public/occ ]; then cp /etc/cont-init.d/"$(basename "${BASH_SO
echo "Setting logs"
for var in /data/config/log/nginx/error.log /data/config/log/nginx/access.log /data/config/log/php/error.log; do
# Make sure directory exists
mkdir -p "$(dirname "$var")"
# Clean files
if [ -f "$var" ]; then rm -r "$var"; fi
# Create symlink
ln -sf /proc/1/fd/1 "$var"
# Make sure directory exists
mkdir -p "$(dirname "$var")"
# Clean files
if [ -f "$var" ]; then rm -r "$var"; fi
# Create symlink
ln -sf /proc/1/fd/1 "$var"
done
################
@@ -32,39 +32,39 @@ if [ -f /notinstalled ]; then exit 0; fi
# Check current version
if [ -f /data/config/www/nextcloud/config/config.php ]; then
CURRENTVERSION="$(sed -n "s|.*version.*' => '*\(.*[^ ]\) *',.*|\1|p" /data/config/www/nextcloud/config/config.php)"
CURRENTVERSION="$(sed -n "s|.*version.*' => '*\(.*[^ ]\) *',.*|\1|p" /data/config/www/nextcloud/config/config.php)"
else
CURRENTVERSION="Not found"
CURRENTVERSION="Not found"
fi
echo " "
# If not installed, or files not available
if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]] || [ ! -f /data/config/www/nextcloud/config/config.php ]; then
bashio::log.green "--------------------------------------------------------------------------------------------------------------"
bashio::log.yellow "Nextcloud not installed, please wait for addon startup, login Webui, install Nextcloud, then restart the addon"
bashio::log.green "--------------------------------------------------------------------------------------------------------------"
bashio::log.green " "
touch /notinstalled
exit 0
# Is there missing files
bashio::log.green "--------------------------------------------------------------------------------------------------------------"
bashio::log.yellow "Nextcloud not installed, please wait for addon startup, login Webui, install Nextcloud, then restart the addon"
bashio::log.green "--------------------------------------------------------------------------------------------------------------"
bashio::log.green " "
touch /notinstalled
exit 0
# Is there missing files
elif [[ $($LAUNCHER -V 2>&1) =~ ^"Nextcloud "[0-9].* ]]; then
# Log
bashio::log.green "----------------------------------------"
bashio::log.green " Nextcloud $CURRENTVERSION is installed "
bashio::log.green "----------------------------------------"
# Tentative to downgrade
# Log
bashio::log.green "----------------------------------------"
bashio::log.green " Nextcloud $CURRENTVERSION is installed "
bashio::log.green "----------------------------------------"
# Tentative to downgrade
else
bashio::log.red "-------------------------------------------------"
bashio::log.red " Unknown error detected, auto-repair will launch "
bashio::log.red "-------------------------------------------------"
bashio::log.red "Error message:"
bashio::log.red "$($LAUNCHER -V 2>&1)"
bashio::log.red "------------------------------------------------------------------"
sudo -u abc -s /bin/bash -c "php /app/www/public/occ maintenance:repair" || true
sudo -u abc -s /bin/bash -c "php /app/www/public/occ maintenance:repair-share-owner" || true
sudo -u abc -s /bin/bash -c "php /app/www/public/occ app:update --all" || true
sudo -u abc -s /bin/bash -c "php /app/www/public/occ upgrade" || true
bashio::log.red "-------------------------------------------------"
bashio::log.red " Unknown error detected, auto-repair will launch "
bashio::log.red "-------------------------------------------------"
bashio::log.red "Error message:"
bashio::log.red "$($LAUNCHER -V 2>&1)"
bashio::log.red "------------------------------------------------------------------"
sudo -u abc -s /bin/bash -c "php /app/www/public/occ maintenance:repair" || true
sudo -u abc -s /bin/bash -c "php /app/www/public/occ maintenance:repair-share-owner" || true
sudo -u abc -s /bin/bash -c "php /app/www/public/occ app:update --all" || true
sudo -u abc -s /bin/bash -c "php /app/www/public/occ upgrade" || true
fi
echo " "
@@ -75,10 +75,10 @@ echo " "
# Updater apps code
if ! bashio::config.true "disable_updates"; then
bashio::log.green "... checking for app updates"
sudo -u abc -s /bin/bash -c "php /app/www/public/occ app:update --all" || true
bashio::log.green "... checking for app updates"
sudo -u abc -s /bin/bash -c "php /app/www/public/occ app:update --all" || true
else
bashio::log.yellow "... disable_updates set, apps need to be updated manually"
bashio::log.yellow "... disable_updates set, apps need to be updated manually"
fi
###########################
@@ -101,8 +101,8 @@ echo "... Remove CODE if installed as not compatible"
################
if bashio::config.has_value "default_phone_region"; then
echo "... Define default_phone_region"
sudo -u abc php /app/www/public/occ config:system:set default_phone_region --value="$(bashio::config "default_phone_region")"
echo "... Define default_phone_region"
sudo -u abc php /app/www/public/occ config:system:set default_phone_region --value="$(bashio::config "default_phone_region")"
fi
######################
@@ -111,10 +111,10 @@ fi
echo "... Disabling check_data_directory_permissions"
for files in /defaults/config.php /data/config/www/nextcloud/config/config.php; do
if [ -f "$files" ]; then
sed -i "/check_data_directory_permissions/d" "$files"
sed -i "/datadirectory/a\ \ 'check_data_directory_permissions' => false," "$files"
fi
if [ -f "$files" ]; then
sed -i "/check_data_directory_permissions/d" "$files"
sed -i "/datadirectory/a\ \ 'check_data_directory_permissions' => false," "$files"
fi
done
timeout 10 sudo -u abc php /app/www/public/occ config:system:set check_data_directory_permissions --value=false --type=bool || echo "Please install nextcloud first"
@@ -123,12 +123,12 @@ timeout 10 sudo -u abc php /app/www/public/occ config:system:set check_data_dire
##################
for variable in env_memory_limit env_upload_max_filesize env_post_max_size; do
if bashio::config.has_value "$variable"; then
variable="${variable#env_}"
sed -i "/$variable/c $variable = $(bashio::config "env_$variable")" /etc/php*/conf.d/nextcloud.ini
sed -i "/$variable/c $variable = $(bashio::config "env_$variable")" /etc/php*/php.ini
bashio::log.blue "$variable set to $(bashio::config "env_$variable")"
fi
if bashio::config.has_value "$variable"; then
variable="${variable#env_}"
sed -i "/$variable/c $variable = $(bashio::config "env_$variable")" /etc/php*/conf.d/nextcloud.ini
sed -i "/$variable/c $variable = $(bashio::config "env_$variable")" /etc/php*/php.ini
bashio::log.blue "$variable set to $(bashio::config "env_$variable")"
fi
done
#####################
@@ -136,19 +136,19 @@ done
#####################
if bashio::config.true "enable_thumbnails"; then
echo "... enabling thumbnails"
# Add variables
sudo -u abc php /app/www/public/occ config:system:set preview_ffmpeg_path --value='/usr/bin/ffmpeg'
sudo -u abc php /app/www/public/occ config:system:set enable_previews --value=true
i=0
for element in AVI BMP Font GIF HEIC Image JPEG Krita MarkDown MKV Movie MP3 MP4 OpenDocument PDF PNG SVG TIFF TXT XBitmap; do # Comma separated values
sudo -u abc php /app/www/public/occ config:system:set enabledPreviewProviders "$i" --value="OC\\Preview\\${element}" >/dev/null
i=$((i + 1))
done
echo "... enabling thumbnails"
# Add variables
sudo -u abc php /app/www/public/occ config:system:set preview_ffmpeg_path --value='/usr/bin/ffmpeg'
sudo -u abc php /app/www/public/occ config:system:set enable_previews --value=true
i=0
for element in AVI BMP Font GIF HEIC Image JPEG Krita MarkDown MKV Movie MP3 MP4 OpenDocument PDF PNG SVG TIFF TXT XBitmap; do # Comma separated values
sudo -u abc php /app/www/public/occ config:system:set enabledPreviewProviders "$i" --value="OC\\Preview\\${element}" >/dev/null
i=$((i + 1))
done
else
# Remove variables
echo "... disabling thumbnails"
sudo -u abc php /app/www/public/occ config:system:set enable_previews --value=false
# Remove variables
echo "... disabling thumbnails"
sudo -u abc php /app/www/public/occ config:system:set enable_previews --value=false
fi
##########################
@@ -156,6 +156,6 @@ fi
##########################
if [[ "$(occ config:system:get maintenance_window_start)" == "" ]]; then
echo "... maintenance windows not set, it will be changed to 1"
sudo -u abc php /app/www/public/occ config:system:set maintenance_window_start --type=integer --value=1
echo "... maintenance windows not set, it will be changed to 1"
sudo -u abc php /app/www/public/occ config:system:set maintenance_window_start --type=integer --value=1
fi