diff --git a/scripts/remove b/scripts/remove index 8dc44e3..1cdcc6a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -44,6 +44,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a43eb05..7d1a13d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,6 +32,20 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up Etherpad before upgrading (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -61,20 +75,6 @@ if ! ynh_permission_exists --permission="admin"; then ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin --auth_header=false fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up Etherpad before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -101,7 +101,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/settings.json $final_path/credentials.json" fi # Set permissions on app files @@ -126,14 +126,14 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$nodejs_version -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Reconfiguring Etherpad..." --weight=6 +# #================================================= +# # MODIFY A CONFIG FILE +# #================================================= +# ynh_script_progression --message="Reconfiguring Etherpad..." --weight=6 -ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json" -ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" -chmod 400 "$final_path/credentials.json" +# ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json" +# ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" +# chmod 400 "$final_path/credentials.json" #================================================= # INSTALL ETHERPAD