1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pgadmin_ynh.git synced 2024-09-03 19:56:38 +02:00

reorder steps

This commit is contained in:
Félix Piédallu 2024-01-31 14:44:14 +01:00
parent e9907e2263
commit 61ab529897
2 changed files with 15 additions and 13 deletions

View file

@ -11,6 +11,13 @@ 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 THE APP MAIN DIR
#=================================================
@ -23,13 +30,6 @@ ynh_restore_file --origin_path="$install_dir"
### ownership to all files such as after the ynh_setup_source step
chown -R "$app:www-data" "$install_dir"
#=================================================
# RESTORE THE POSTGRESQL SUPERUSER
#=================================================
ynh_script_progression --message="Restoring the Postgresql superuser..." --weight=1
password=$(cat hashed_password.txt)
ynh_psql_execute_as_root --sql "ALTER USER $app WITH PASSWORD '$password' SUPERUSER CREATEDB CREATEROLE REPLICATION"
#=================================================
# REINSTALL DEPENDENCIES
#=================================================

View file

@ -32,6 +32,14 @@ usermod -d "$install_dir" "$app"
# Clean old uwsgi config
ynh_secure_remove /etc/uwsgi/apps-enabled/pgadmin.ini
#=================================================
# Postgresql superuser
#=================================================
ynh_script_progression --message="Configuring Postgresql superuser..."
# Re-set the db_pwd just in case…
ynh_psql_execute_as_root --sql "ALTER USER $app WITH PASSWORD '$db_pwd' SUPERUSER CREATEDB CREATEROLE REPLICATION"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -52,12 +60,6 @@ ynh_add_config --template="config_local.py" --destination="$install_dir/venv/lib
set_permission
#=================================================
# Postgresql superuser
#=================================================
ynh_script_progression --message="Configuring Postgresql superuser..."
ynh_psql_execute_as_root --sql "ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================