From 36a89338946169caaa98c9e52bc8a76aa0e34a44 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Jun 2021 22:28:01 +0200 Subject: [PATCH] Fix --- scripts/_common.sh | 2 +- scripts/restore | 83 ---------------------------------------------- scripts/upgrade | 44 ------------------------ 3 files changed, 1 insertion(+), 128 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 26b646e..8a59e92 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,7 +10,7 @@ nodejs_version=14 # dependencies used by the app -pkg_dependencies="apt-transport-https build-essential gzip curl graphicsmagick" +pkg_dependencies="apt-transport-https build-essential gzip curl fontconfig graphicsmagick" #================================================= # PERSONAL HELPERS diff --git a/scripts/restore b/scripts/restore index abc463d..638dce0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -159,86 +159,3 @@ ynh_systemd_action --service_name=nginx --action=reload #================================================= ynh_script_progression --message="Restoration completed for $app" --time --last - - - - - - - - - - - - -#================================================= -# LOAD SETTINGS -#================================================= - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get $app domain) -path=$(ynh_app_setting_get $app path) -final_path=$(ynh_app_setting_get $app final_path) -serviceuser=$(ynh_app_setting_get $app serviceuser) -port=$(ynh_app_setting_get $app port) - -# Check domain/path availability -ynh_webpath_available $domain $path -if [[ ! $? -eq 0 ]]; then - ynh_die "domain not available" -fi - -# Check destination directory -[[ -d $final_path ]] && ynh_die \ -"The destination directory '$final_path' already exists.\ - You should safely delete it before restoring this app." - -# Create destination -mkdir -p $final_path - -# Create user -id -u $serviceuser || useradd -d "$final_path" -M $serviceuser - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= - -ynh_restore - -#================================================= -# RELOAD THE NGINX CONFIGURATION -#================================================= - -systemctl reload nginx - -#================================================= -# RELOAD AND ENABLE THE SYSTEMD CONFIGURATION -#================================================= -systemctl daemon-reload -systemctl enable rocketchat - -#================================================= -# RESTORE PERMISSIONS IN THE APP MAIN DIR -#================================================= - -chown -R $serviceuser: $final_path - -#================================================= -# INSTALL DEPENDENCIES -#================================================= - -installdeps - -#================================================= -# RESTORE THE MONGODB -#================================================= - -mongorestore ./dump - -#================================================= -# START APP RELATED SERVICES -#================================================= - -systemctl start rocketchat -waitforservice diff --git a/scripts/upgrade b/scripts/upgrade index c5c9c37..dd234ed 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -211,47 +211,3 @@ ynh_systemd_action --service_name=nginx --action=reload #================================================= ynh_script_progression --message="Upgrade of $app completed" --time --last - -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source ./_common.sh -source /usr/share/yunohost/helpers - -ynh_abort_if_errors - -app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get $app final_path) -serviceuser=$(ynh_app_setting_get $app serviceuser) -path=$(ynh_app_setting_get $app path) -port=$(ynh_app_setting_get $app port) - -#================================================= -# BACKUP THE APPLICATION -#================================================= - -# Backup the current version of the app -ynh_backup_before_upgrade > >(tee "upgrade.log") - -systemctl stop rocketchat - -ynh_secure_remove $final_path -mkdir -p $final_path - -# update to latest required node setup -installnode - -ynh_setup_source "$final_path" - -chown -R $serviceuser: $final_path - -cd $final_path/programs/server/ -npm install --production - -chown -R $serviceuser: $final_path - -systemctl start rocketchat -waitforservice