1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/noalyss_ynh.git synced 2024-09-03 19:46:20 +02:00
This commit is contained in:
ericgaspar 2020-11-28 11:41:46 +01:00
parent 34a539c618
commit 5f1f5a54f9
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 17 additions and 12 deletions

View file

@ -109,7 +109,7 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Configuring PHP-FPM..." --weight=3
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
# #=================================================
@ -127,7 +127,7 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
# # Installation with cURL
# installUrl="/install.php?submit"
# ynh_local_curl $installUrl "install=2" "db_type=psql" "hostname=localhost" "db_username=$db_user" "db_password=$db_pwd" "database_name=$db_name" "admin_username=" "admin_password=" "db_table_prefix=$db_name" "db_table_plugin_prefix=plugin" "db_table_suffix=_table" "timezone=UTC"
# ynh_local_curl $installUrl "install=2" "lang=fr_FR.utf8"
# # Remove the `install.php` directory from within the Noalyss installation path.
# # The scripts within this directory should not be accessible on a live Noalyss site

View file

@ -25,8 +25,10 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -71,9 +73,13 @@ chown -R $app: $final_path
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring PHP-FPM configuration..."
ynh_restore_file "/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
#=================================================
# SPECIFIC RESTORATION
#=================================================
@ -85,14 +91,13 @@ ynh_script_progression --message="Reinstalling dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE POSTGRES DATABASE
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the Postgres database..."
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
ynh_psql_test_if_first_run
ynh_psql_setup_db $db_name $db_name $(ynh_app_setting_get $app psqlpwd)
ynh_psql_execute_file_as_root ./db.sql $db_name
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
@ -105,10 +110,10 @@ yunohost service add $app --log "/var/log/$app/$app.log"
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression --message="Reloading nginx web server and PHP-FPM..."
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
systemctl reload php$phpversion-fpm
systemctl reload nginx
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT

View file

@ -125,7 +125,7 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies"
#=================================================
# SECURE FILES AND DIRECTORIES