Minor cleanup
This commit is contained in:
parent
a3fe7313a9
commit
017224d59e
|
@ -36,7 +36,6 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
db_name=$(ynh_app_setting_get $app psql_db)
|
db_name=$(ynh_app_setting_get $app psql_db)
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# STANDARD BACKUP STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -47,8 +46,8 @@ ynh_backup "$final_path"
|
||||||
|
|
||||||
# Copy the data directory
|
# Copy the data directory
|
||||||
|
|
||||||
ynh_backup "/home/yunohost.app/${app}"
|
datadir="/home/yunohost.app/${app}/storage"
|
||||||
|
ynh_backup "$datadir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
|
@ -71,7 +70,6 @@ ynh_backup "db.sql"
|
||||||
|
|
||||||
ynh_backup "/etc/logrotate.d/$app"
|
ynh_backup "/etc/logrotate.d/$app"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -48,23 +48,23 @@ ynh_webpath_available "$domain" "$path_url" \
|
||||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||||
test ! -d "$final_path" \
|
test ! -d "$final_path" \
|
||||||
|| ynh_die "There is already a directory: $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"
|
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
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_restore_file "$final_path"
|
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
|
# RECREATE THE DEDICATED USER
|
||||||
|
@ -73,6 +73,9 @@ ynh_restore_file "/home/yunohost.app/${app}"
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create "$app"
|
ynh_system_user_create "$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE USER RIGHTS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Set right permissions for curl install
|
# Set right permissions for curl install
|
||||||
datadir="/home/yunohost.app/${app}/storage"
|
datadir="/home/yunohost.app/${app}/storage"
|
||||||
|
@ -121,11 +124,16 @@ systemctl enable "$app.service"
|
||||||
ynh_restore_file "/etc/logrotate.d/$app"
|
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)
|
(cd "$final_path" && yarn install --production --pure-lockfile)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC FINALIZATION
|
||||||
|
#=================================================
|
||||||
|
# RELOAD NGINX AND PeerTube
|
||||||
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
service "$app" restart
|
service "$app" restart
|
||||||
|
|
Loading…
Reference in a new issue