mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
Fix
This commit is contained in:
parent
9f7601a5de
commit
36a8933894
3 changed files with 1 additions and 128 deletions
|
@ -10,7 +10,7 @@
|
||||||
nodejs_version=14
|
nodejs_version=14
|
||||||
|
|
||||||
# dependencies used by the app
|
# 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
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -159,86 +159,3 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoration completed for $app" --time --last
|
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
|
|
||||||
|
|
|
@ -211,47 +211,3 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade of $app completed" --time --last
|
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
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue