From bce58021f7c364471026338dd41d29aeb7cf52ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 30 Jan 2024 18:01:12 +0100 Subject: [PATCH] fix upgrade --- scripts/upgrade | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d694fe8..816e920 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,22 +33,33 @@ usermod -d "$install_dir" "$app" ynh_secure_remove /etc/uwsgi/apps-enabled/pgadmin.ini #================================================= -# SPECIFIC UPGRADE +# DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# ... -#================================================= -# Download, check integrity, uncompress and patch the source from app.src ynh_script_progression --message="Upgrading source files..." --weight=6 -install_source +ynh_install_venv + +_install_pgadmin_pip + +setup_dir + +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=1 -# CONFIGURE PGADMIN -ynh_script_progression --message="Configuring application..." config_pgadmin -# Set permission after initialisation -ynh_script_progression --message="Protecting directory..." +# CONFIGURE PGADMIN +ynh_add_config --template="config_local.py" --destination="$install_dir/venv/lib/python$python_version/site-packages/pgadmin4/config_local.py" + 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 #=================================================