diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index f367b62..f42358d 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,6 +1,6 @@ This is a dummy disclaimer to display after the install -The app url is `__DOMAIN____PATH__` +The app url is The app install dir is `__INSTALL_DIR__` diff --git a/scripts/backup b/scripts/backup index 010f6c5..0856374 100755 --- a/scripts/backup +++ b/scripts/backup @@ -34,37 +34,25 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="$data_dir" --is_big #================================================= -# BACKUP THE NGINX CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= +# Backup the PHP-FPM configuration ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" +# Backup the nginx configuration +ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= +# Backup the systemd service unit +ynh_backup --src_path="/etc/systemd/system/$app.service" +# Backup the logrotate configuration ynh_backup --src_path="/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - -ynh_backup --src_path="/etc/systemd/system/$app.service" +# Backup the Fail2Ban config +ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" +ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" #================================================= # BACKUP VARIOUS FILES diff --git a/scripts/install b/scripts/install index bf1a40a..4e695e7 100755 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ source /usr/share/yunohost/helpers # ... # -# $app is the app id (i.e. 'example' for first install, +# $app is the app id (i.e. 'example' for first install, # or 'example__2', '__3', ... for multi-instance installs) # @@ -44,7 +44,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir" -# $install_dir will automatically be initialized with some decent +# $install_dir will automatically be initialized with some decent # permission by default ... however, you may need to recursively reapply # ownership to all files such as after the ynh_setup_source step chown -R "$app:www-data" "$install_dir" diff --git a/scripts/remove b/scripts/remove index 3a85218..b7d321e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -25,8 +25,6 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SYSTEMD SERVICE -#================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # This should be a symetric version of what happens in the install script @@ -38,16 +36,16 @@ then yunohost service remove "$app" fi +ynh_remove_fail2ban_config + +ynh_remove_logrotate + ynh_remove_systemd_config ynh_remove_nginx_config ynh_remove_fpm_config -ynh_remove_logrotate - -ynh_remove_fail2ban_config - # Remove other various files specific to the app... such as : ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 783f655..e2a05fb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,7 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -# $install_dir will automatically be initialized with some decent +# $install_dir will automatically be initialized with some decent # permissions by default ... however, you may need to recursively reapply # ownership to all files such as after the ynh_setup_source step chown -R "$app:www-data" "$install_dir" @@ -42,8 +42,6 @@ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 # This should be a symetric version of what happens in the install script @@ -63,11 +61,20 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -# Other various files... +#================================================= +# RESTORE VARIOUS FILES +#================================================= ynh_restore_file --origin_path="/etc/cron.d/$app" ynh_restore_file --origin_path="/etc/$app/" +#================================================= +# 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 + #================================================= # GENERIC FINALIZATION #=================================================