1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grav_ynh.git synced 2024-09-03 19:16:01 +02:00
grav_ynh/scripts/restore

66 lines
2.4 KiB
Text
Raw Permalink Normal View History

2017-03-02 15:44:54 +01:00
#!/bin/bash
2018-09-03 23:31:52 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-03-02 15:44:54 +01:00
2022-10-06 00:00:31 +02:00
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
2018-09-03 23:31:52 +02:00
source ../settings/scripts/_common.sh
2017-03-02 15:44:54 +01:00
source /usr/share/yunohost/helpers
2021-09-09 22:54:05 +02:00
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=2
2023-04-27 23:04:36 +02:00
ynh_restore_file --origin_path="$install_dir"
2021-02-07 17:05:09 +01:00
2024-04-17 22:24:57 +02:00
# Grav will complain about missing backup directory, let's create it
mkdir -p "$install_dir/backup"
2023-04-27 23:04:36 +02:00
chown -R $app:www-data "$install_dir"
find "$install_dir" -type f -exec chmod 640 {} \;
find "$install_dir/bin" -type f -exec chmod 750 {} \;
find "$install_dir" -type d -exec chmod 750 {} \;
find "$install_dir" -type d -exec chmod +s {} \;
2021-02-07 17:05:09 +01:00
#=================================================
2018-09-03 23:31:52 +02:00
# RESTORE THE PHP-FPM CONFIGURATION
2018-09-03 21:35:41 +02:00
#=================================================
2022-10-06 00:00:31 +02:00
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
2018-09-03 21:35:41 +02:00
2022-10-06 00:00:31 +02:00
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
2017-03-02 15:44:54 +01:00
2021-11-29 20:25:33 +01:00
#=================================================
2022-10-06 00:00:31 +02:00
# RESTORE THE NGINX CONFIGURATION
2021-11-29 20:25:33 +01:00
#=================================================
2022-10-06 00:00:31 +02:00
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
2021-11-29 20:25:33 +01:00
2022-10-06 00:00:31 +02:00
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/etc/cron.d/$app"
chmod 644 /etc/cron.d/$app
2017-03-09 17:27:59 +01:00
2018-09-03 23:31:52 +02:00
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
2021-01-20 08:52:18 +01:00
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
2017-04-01 17:03:40 +02:00
2022-10-06 00:00:31 +02:00
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
Upgrade to v1.6.26, YNH v3.7 permissions system, PHP version handling, fix CI badge (#39) * Fix check_process (#34) * Upgrade to 1.6.26, YNH v3.7 permissions system and PHP version handling (#37) * [upg] grav 1.6.16 Makes the app agnostic regarding the needed PHP version. Includes experimental helpers to install various PHP versions, if needed. Includes Grav v1.6.16 with PHP 7.2. * [enh] adding LDAP login for designated admin It is a bit hacky, since YNH does not have yet LDAP groups support: groups=usernames. To add more users, manually edit the configuration file in the admin. * [enh] use the permissions system * [enh] setting permissions up * [enh] restore php before adding conf file * [enh] avoid adding repo if sury list already exists This prevents getting multiple warning messages about duplicated repos. * [fix] remove order * [fix] testing and setting permissions * [upg] app version and remove php7.0-fpm dependency * Fix check_process (#34) * [upg] permissions configuration for install and upgrade * [upg] grav v1.6.23 * [upg] new permissions system * [fix] check_process is_public * [fix] missing 1 more_set_headers in nginx.conf * [fix] upgrade: allow visitors if was public * [fix] experimental_helpers directory in remove * [fix] retrieve phpversion in remove * [fix] remove old php-fpm config if needed in upgrade * [fix] helpers in subdirectory * [enh] no default group needed * [enh] update all plugins during upgrade * [enh] adding progress messages * [fix] specify phpversion in change_url * [enh] to v3.7 standards * [upg] grav v1.6.26 * [rem] ynh_permission_has_user is now official * [upg] check_process * [fix] php-fpm upgrade * [fix] use YNH_PHP_VERSION instead of phpversion in restore * [fix] php and chown in upgrade * [fix] check_process * [fix] app-upgrade.src * [fix] php-fpm and [rem] progression --time * [fix] restart php-fpm instead of reloading * [fix] user home_dir and permissions * [fix] upgrade publicness * [fix] CI badge on README (#38) * Fix failing check_process (#35) * Fix check_process (#34) * Fix CI badge on README Co-authored-by: tituspijean <tituspijean@outlook.com> Co-authored-by: Kayou <pierre.moltess@gmail.com> Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2020-07-10 19:22:37 +02:00
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
2021-01-20 08:46:17 +01:00
ynh_script_progression --message="Restoration completed for $app" --last