mirror of
https://github.com/YunoHost-Apps/snappymail_ynh.git
synced 2024-09-03 20:26:29 +02:00
fix SC2086 linter alerts
This commit is contained in:
parent
1f180a2832
commit
6830760bf5
5 changed files with 25 additions and 25 deletions
|
@ -24,7 +24,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1
|
|||
ynh_add_config --template="application.ini" --destination="$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
|
||||
chmod 400 "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
chown $app:$app "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
chown "$app":"$app" "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSO
|
||||
|
|
|
@ -15,8 +15,8 @@ ynh_abort_if_errors
|
|||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
||||
current_fpm_footprint=$(ynh_app_setting_get --app="$app" --key=fpm_footprint)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC GETTERS FOR TOML SHORT KEY
|
||||
|
@ -52,14 +52,14 @@ get__free_footprint() {
|
|||
set__fpm_footprint() {
|
||||
if [ "$fpm_footprint" != "specific" ]
|
||||
then
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint"
|
||||
ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_footprint"
|
||||
fi
|
||||
}
|
||||
|
||||
set__fpm_free_footprint() {
|
||||
if [ "$fpm_footprint" = "specific" ]
|
||||
then
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint"
|
||||
ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_free_footprint"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ ynh_app_config_validate() {
|
|||
ynh_app_config_apply() {
|
||||
_ynh_app_config_apply
|
||||
|
||||
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
|
||||
ynh_add_fpm_config --phpversion="$phpversion" --usage="$fpm_usage" --footprint="$fpm_footprint"
|
||||
}
|
||||
|
||||
ynh_app_config_run $1
|
||||
ynh_app_config_run "$1"
|
||||
|
|
|
@ -21,9 +21,9 @@ fpm_usage="low"
|
|||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
ynh_app_setting_set --app="$app" --key=fpm_footprint --value=$fpm_footprint
|
||||
ynh_app_setting_set --app="$app" --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
ynh_app_setting_set --app="$app" --key=fpm_usage --value=$fpm_usage
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -34,7 +34,7 @@ ynh_script_progression --message="Setting up source files..." --weight=3
|
|||
ynh_setup_source --dest_dir="$install_dir/app"
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R "$app":www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
|
@ -58,12 +58,12 @@ ynh_use_logrotate
|
|||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
mkdir -p "$install_dir/app/data/_data_/_default_/configs"
|
||||
chown $app:$app -R "$install_dir/app/data/_data_"
|
||||
chown "$app":"$app" -R "$install_dir/app/data/_data_"
|
||||
|
||||
ynh_add_config --template="application.ini" --destination="$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
|
||||
chmod 600 "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
chown $app:$app "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
chown "$app":"$app" "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSO
|
||||
|
|
|
@ -18,7 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
|||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R "$app":www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEM CONFIGURATIONS
|
||||
|
@ -26,7 +26,7 @@ chown -R $app:www-data "$install_dir"
|
|||
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=4
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
|
||||
ynh_add_fpm_config --usage="$fpm_usage" --footprint="$fpm_footprint" --phpversion="$phpversion"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
|
@ -39,7 +39,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||
ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -23,19 +23,19 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
|||
# If fpm_footprint doesn't exist, create it
|
||||
if [ -z "${fpm_footprint:-}" ]; then
|
||||
fpm_footprint=low
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
||||
ynh_app_setting_set --app="$app" --key=fpm_footprint --value=$fpm_footprint
|
||||
fi
|
||||
|
||||
# If fpm_free_footprint doesn't exist, create it
|
||||
if [ -z "${fpm_free_footprint:-}" ]; then
|
||||
fpm_free_footprint=0
|
||||
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
ynh_app_setting_set --app="$app" --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
fi
|
||||
|
||||
# If fpm_usage doesn't exist, create it
|
||||
if [ -z "${fpm_usage:-}" ]; then
|
||||
fpm_usage=low
|
||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
ynh_app_setting_set --app="$app" --key=fpm_usage --value=$fpm_usage
|
||||
fi
|
||||
|
||||
# Do something when upgrading from 2.3.2~ynh1 or lower
|
||||
|
@ -43,10 +43,10 @@ if ynh_compare_current_package_version --comparison le --version 2.28.4~ynh1
|
|||
then
|
||||
# Move everything inside a $install_dir/app/ subfolder
|
||||
# This allows to have a $install_dir/index.php handling the SSO
|
||||
mkdir -p $install_dir/app
|
||||
mkdir -p "$install_dir/app"
|
||||
# Ugly way to not return an error when moving everything to a subfolter of the same folder https://stackoverflow.com/a/43262922
|
||||
find $install_dir -maxdepth 1 -mindepth 1 -not -name app -exec mv -t $install_dir/app {} +
|
||||
chown $app:root $install_dir/app/
|
||||
find "$install_dir" -maxdepth 1 -mindepth 1 -not -name app -exec mv -t "$install_dir/app" {} +
|
||||
chown "$app":root "$install_dir/app/"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -62,7 +62,7 @@ then
|
|||
fi
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R "$app":www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
|
@ -70,7 +70,7 @@ chown -R $app:www-data "$install_dir"
|
|||
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=5
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
|
||||
ynh_add_fpm_config --phpversion="$phpversion" --usage="$fpm_usage" --footprint="$fpm_footprint"
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
@ -88,7 +88,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1
|
|||
ynh_add_config --template="application.ini" --destination="$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
|
||||
chmod 600 "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
chown $app:$app "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
chown "$app":"$app" "$install_dir/app/data/_data_/_default_/configs/application.ini"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSO
|
||||
|
|
Loading…
Add table
Reference in a new issue