1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

fix SC2086 linter alerts

This commit is contained in:
OniriCorpe 2023-11-01 04:00:03 +01:00
parent 3a60dd3b2d
commit a58e968ce2
4 changed files with 20 additions and 20 deletions

View file

@ -25,7 +25,7 @@ ynh_change_url_nginx_config
#=================================================
ynh_script_progression --message="Upgrading FreshRSS..." --weight=1
ynh_exec_as $app $install_dir/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$new_domain$new_path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
ynh_exec_as "$app" "$install_dir/cli/reconfigure.php" --auth_type http_auth --environment production --base_url "https://$new_domain$new_path" --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user "$db_name" --db-password "$db_pwd" --db-base "$db_name"
#=================================================
# END OF SCRIPT

View file

@ -18,7 +18,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chown -R "$app":www-data "$install_dir"
#=================================================
# SYSTEM CONFIGURATION
@ -36,8 +36,8 @@ chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
log_path="/var/log/$app"
mkdir -p $log_path
chown $app:www-data $log_path
mkdir -p "$log_path"
chown "$app":www-data "$log_path"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
@ -48,12 +48,12 @@ ynh_use_logrotate
#=================================================
ynh_script_progression --message="FreshRSS setup..." --weight=1
ynh_exec_as $app $install_dir/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
ynh_exec_as "$app" "$install_dir/cli/do-install.php" --default_user "$admin" --auth_type http_auth --environment production --base_url "https://$domain$path" --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user "$db_name" --db-password "$db_pwd" --db-base "$db_name"
for myuser in $(ynh_user_list)
do
user_token=$(ynh_string_random)
ynh_exec_as $app $install_dir/cli/create-user.php --user $myuser --language $language --token $user_token
ynh_exec_as "$app" "$install_dir/cli/create-user.php" --user "$myuser" --language "$language" --token "$user_token"
done
#=================================================

View file

@ -18,14 +18,14 @@ 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 THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
@ -41,8 +41,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/cron.d/$app"
log_path="/var/log/$app"
mkdir -p $log_path
chown $app:www-data $log_path
mkdir -p "$log_path"
chown "$app":www-data "$log_path"
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
@ -52,7 +52,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
#=================================================

View file

@ -23,12 +23,12 @@ upgrade_type=$(ynh_check_app_version_changed)
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "$admin" ]; then
admin=$(ynh_app_setting_get --app=$app --key=admin_user)
if [ -z $admin ]; then
admin=$(ynh_app_setting_get --app="$app" --key=admin_user)
if [ -z "$admin" ]; then
ynh_die --message="no admin user found"
fi;
ynh_app_setting_delete --app=$app --key=admin_user
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_delete --app="$app" --key=admin_user
ynh_app_setting_set --app="$app" --key=admin --value="$admin"
fi
#=================================================
@ -44,7 +44,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
@ -65,13 +65,13 @@ if [ -f /tmp/FreshRSS.log ]; then
ynh_secure_remove --file="/tmp/FreshRSS.log"
fi
if [ -f $install_dir/$app.log ]; then
if [ -f "$install_dir/$app.log" ]; then
ynh_secure_remove --file="/var/www/$app/$app.log"
fi
log_path="/var/log/$app"
mkdir -p $log_path
chown $app:www-data "$log_path"
mkdir -p "$log_path"
chown "$app":www-data "$log_path"
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
@ -83,7 +83,7 @@ ynh_use_logrotate --non-append
ynh_script_progression --message="Upgrading FreshRSS..." --weight=1
# reconfigure application with latest parameters
ynh_exec_as $app $install_dir/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
ynh_exec_as "$app" "$install_dir/cli/reconfigure.php" --default_user "$admin" --auth_type http_auth --environment production --base_url "https://$domain$path" --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user "$db_name" --db-password "$db_pwd" --db-base "$db_name"
#=================================================
# END OF SCRIPT