1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pgadmin_ynh.git synced 2024-09-03 19:56:38 +02:00
pgadmin_ynh/scripts/restore
Josué Tille 72c3a867da
Full rework of package following PR #35
- Fix regression #35 - python dependancy
- Fix regression #35 - armv7 support
- Fix regression #35 - bad install dir
- Fix DB setup and don't request password to user
- Fix data storage path
- Add SSO support
- Update app to 8.3 (will be updated to 8.4 by auto update)
- Add mail support
- Remove legacy uwsig and use gunicorn instead
- Remove expect dependancy
- Set permission explicitly
- Add multi instance support
- Simplify again restore script
2024-03-11 12:18:35 +01:00

61 lines
2.2 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE POSTGRESQL SUPERUSER
#=================================================
ynh_script_progression --message="Restoring the Postgresql superuser..." --weight=1
ynh_psql_execute_as_root --sql "ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION"
#=================================================
# RESTORE ALL CONFIG AND DATA
#=================================================
ynh_script_progression --message="Restoring directory and configuration..." --weight=10
ynh_restore
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Updating python virtualenv..." --weight=5
install_source
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Enable systemd services" --weight=2
# systemctl daemon-reload
systemctl enable $app.service --quiet
yunohost service add $app --log "/var/log/$app/$app.log" --description 'PgAdmin application'
set_permission
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND THE APP SERVICE
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last