diff --git a/check_process b/check_process index c64d406..1fbcb9a 100644 --- a/check_process +++ b/check_process @@ -22,7 +22,3 @@ Email= Notification=none ;;; Upgrade options - ; commit=157310ca395c326add85d24fa397f7fd0cadefb1 - name=1.979~ynh1 - ; commit=99875e2b4c69f9ef22b05f565eeab52a8befb566 - name=1.979~ynh2 diff --git a/scripts/change_url b/scripts/change_url index 24ffe59..945c4bf 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -26,10 +26,10 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." - # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" diff --git a/scripts/install b/scripts/install index 3227e70..94d9bb2 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -57,7 +57,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_script_progression --message="Finding an available port..." # Find an available port -port=$(ynh_find_port --port=10000) +port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port #================================================= diff --git a/scripts/restore b/scripts/restore index 2938727..319c72f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -34,13 +34,6 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -52,6 +45,13 @@ ynh_install_app_dependencies $pkg_dependencies # Install Webmin ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/download/repository sarge contrib" --package="webmin" --key="https://download.webmin.com/jcameron-key.asc" +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE VARIOUS FILES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2e87fdb..239fb56 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,6 +36,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -61,14 +62,6 @@ if ! ynh_permission_exists --permission="admin"; then ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin fi -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -80,6 +73,14 @@ ynh_install_app_dependencies $pkg_dependencies ynh_backup_if_checksum_is_different --file="/etc/webmin/miniserv.conf" ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/download/repository sarge contrib" --package="webmin" --key="https://download.webmin.com/jcameron-key.asc" +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # SPECIFIC UPGRADE #=================================================