diff --git a/check_process b/check_process index c7e7a34..3554c31 100644 --- a/check_process +++ b/check_process @@ -12,9 +12,14 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=0ea46c375b775316cec39a96fa917ec240e45970 backup_restore=1 multi_instance=0 change_url=1 ;;; Options Email= Notification=none +;;; Upgrade options + ; commit=0ea46c375b775316cec39a96fa917ec240e45970 + name=Testing (#33) + manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/scripts/backup b/scripts/backup index 9c7fc73..bc99ca4 100755 --- a/scripts/backup +++ b/scripts/backup @@ -55,7 +55,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app" # BACKUP DATADIR DIRECTORY #================================================= -ynh_backup --src_path="$data_path" +ynh_backup --src_path="$data_path" --is_big #================================================= # BACKUP BINARY diff --git a/scripts/install b/scripts/install index b9b6f53..db3dbb8 100755 --- a/scripts/install +++ b/scripts/install @@ -128,6 +128,7 @@ chown -R $app:www-data "$data_path" #================================================= # CONFIGURE HASTE #================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js" @@ -169,6 +170,7 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" diff --git a/scripts/restore b/scripts/restore index 234e2c8..3ff4e61 100755 --- a/scripts/restore +++ b/scripts/restore @@ -40,6 +40,7 @@ test ! -d $final_path || ynh_die "There is already a directory: $final_path " #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -70,12 +71,21 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # RESTORE VARIOUS FILES #================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 -ynh_restore_file --origin_path="$data_path" +ynh_restore_file --origin_path="$data_path" --not_mandatory + +# Create app folders +mkdir -p "$data_path" + +chmod 750 "$data_path" +chmod -R o-rwx "$data_path" +chown -R $app:www-data "$data_path" #================================================= # RESTORE BINARY #================================================= +ynh_script_progression --message="Restoring various files..." --weight=1 ynh_restore_file --origin_path="/usr/bin/$app" @@ -100,6 +110,7 @@ chown $app -R /var/log/$app #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log" @@ -111,6 +122,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # START SYSTEMD SERVICE #================================================= @@ -118,12 +136,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c21fc75..103c625 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,12 +108,14 @@ ynh_system_user_create --username=$app #================================================= # UPGRADE NODEJS #================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=8 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # UPGRADE NPM MODULES #================================================= +ynh_script_progression --message="Installing $app..." --weight=8 pushd "$final_path" ynh_use_nodejs @@ -149,6 +151,7 @@ ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/ #================================================= # UPGRADE HASTE BINARY #================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=1 haste_url="${domain}${path_url}" ynh_add_config --template="../conf/haste.sh" --destination="/usr/bin/$app" @@ -167,6 +170,7 @@ chmod +x /usr/bin/$app #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Haste is a pastebin software" --log="/var/log/$app/$app.log"