From d79cf9ed73dbb641ea0548410ca4def800e58f68 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Nov 2021 08:27:38 +0100 Subject: [PATCH] Fix --- scripts/install | 6 +++++- scripts/restore | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 2a6df83..e87693d 100755 --- a/scripts/install +++ b/scripts/install @@ -24,6 +24,7 @@ path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC admin=$YNH_APP_ARG_ADMIN password=$YNH_APP_ARG_PASSWORD +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -46,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # STANDARD MODIFICATIONS @@ -103,7 +105,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) # #================================================= # # SETUP APPLICATION WITH CURL @@ -137,6 +138,9 @@ ynh_script_progression --message="Modifying $app config file..." ynh_add_config --template="../conf/noalyss.conf" --destination="$final_path/include/config.inc.php" +chmod 400 "$final_path/include/config.inc.php" +chown $app:$app "$final_path/include/config.inc.php" + #================================================= # SETUP LOGROTATE #================================================= diff --git a/scripts/restore b/scripts/restore index 127f3f3..ff34c7d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -35,8 +35,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path \ - || ynh_die "There is already a directory: $final_path " +test ! -d $final_path || ynh_die "There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -44,7 +43,7 @@ test ! -d $final_path \ # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER @@ -70,7 +69,7 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Restoring PHP-FPM configuration..." -ynh_restore_file "/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION @@ -85,7 +84,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 +ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd