Minor cleanup

This commit is contained in:
Jean-Baptiste Holcroft 2018-04-01 00:03:32 +02:00
parent a3fe7313a9
commit 017224d59e
2 changed files with 23 additions and 17 deletions

View file

@ -36,7 +36,6 @@ final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app psql_db)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
@ -47,8 +46,8 @@ ynh_backup "$final_path"
# Copy the data directory
ynh_backup "/home/yunohost.app/${app}"
datadir="/home/yunohost.app/${app}/storage"
ynh_backup "$datadir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
@ -71,7 +70,6 @@ ynh_backup "db.sql"
ynh_backup "/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================

View file

@ -48,23 +48,23 @@ ynh_webpath_available "$domain" "$path_url" \
|| ynh_die "Path not available: ${domain}${path_url}"
test ! -d "$final_path" \
|| ynh_die "There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# FIND AND OPEN A PORT
#=================================================
# Open this port
yunohost firewall allow Both "$port" 2>&1
ynh_app_setting_set "$app" port "$port"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_restore_file "$final_path"
ynh_restore_file "/home/yunohost.app/${app}"
datadir="/home/yunohost.app/${app}/storage"
ynh_restore_file "$datadir"
#=================================================
# RECREATE THE DEDICATED USER
@ -73,6 +73,9 @@ ynh_restore_file "/home/yunohost.app/${app}"
# Create the dedicated user (if not existing)
ynh_system_user_create "$app"
#=================================================
# RESTORE USER RIGHTS
#=================================================
# Set right permissions for curl install
datadir="/home/yunohost.app/${app}/storage"
@ -121,11 +124,16 @@ systemctl enable "$app.service"
ynh_restore_file "/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
chown -R "$app" "$datadir"
(cd "$final_path" && yarn install --production --pure-lockfile)
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PeerTube
#=================================================
systemctl reload nginx
service "$app" restart