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

Remove ynh_print_OFF/ON

This commit is contained in:
Josué Tille 2019-07-30 11:55:33 +02:00
parent e9fe3698db
commit a29adfcf6a
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
2 changed files with 0 additions and 16 deletions

View file

@ -21,9 +21,7 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$(ynh_normalize_url_path $YNH_APP_ARG_PATH)
admin=$YNH_APP_ARG_ADMIN
db_user="pgadmin"
ynh_print_OFF
admin_pwd=$YNH_APP_ARG_ADMIN_PASSWORD
ynh_print_ON
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
test ! -e "$final_path" || ynh_die --message "This path already contains a folder"
@ -40,9 +38,7 @@ fi
# Build user password
ynh_script_progression --message="Defining db password..."
ynh_print_OFF
db_pwd=$(ynh_string_random --length 30)
ynh_print_ON
# STORE SETTINGS FROM MANIFEST
ynh_script_progression --message="Storing installation settings..."
@ -51,10 +47,8 @@ ynh_app_setting_set --app $app --key path --value $path_url
ynh_app_setting_set --app $app --key admin --value $admin
ynh_app_setting_set --app $app --key db_user --value "$db_user"
ynh_app_setting_set --app $app --key final_path --value $final_path
ynh_print_OFF
ynh_app_setting_set --app $app --key admin_pwd --value "$admin_pwd"
ynh_app_setting_set --app $app --key db_pwd --value "$db_pwd"
ynh_print_ON
#=================================================
# STANDARD MODIFICATIONS
@ -90,24 +84,18 @@ ynh_script_progression --message="Configuring sqlite database..."
chmod +x ../conf/setup.exp
PS1=""
source $final_path/bin/activate
ynh_print_OFF
ynh_replace_special_string --match_string "__ADMIN_PASSWORD__" --replace_string "$admin_pwd" --target_file "../conf/setup.exp"
ynh_print_ON
../conf/setup.exp "$final_path/bin/python3" "$final_path/lib/python$python_version/site-packages/pgadmin4/setup.py" "$email"
# POPULATE THE DATABASE
ynh_script_progression --message="Configuring Postgresql database..."
ynh_psql_test_if_first_run
ynh_print_OFF
ynh_psql_execute_as_root \
--sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
ynh_print_ON
# Add Server In PGadmin database
ynh_replace_string --match_string "__PYTHON_VERSION__" --replace_string "$python_version" --target_file config_database.py
ynh_print_OFF
$final_path/bin/python3 config_database.py "$db_user" "$db_pwd"
ynh_print_ON
deactivate
#=================================================

View file

@ -22,9 +22,7 @@ admin=$(ynh_app_setting_get --app $app --key admin)
final_path=$(ynh_app_setting_get --app $app --key final_path)
db_name=$(ynh_app_setting_get --app $app --key db_name)
db_user=$(ynh_app_setting_get --app $app --key db_user)
ynh_print_OFF
db_pwd=$(ynh_app_setting_get --app $app --key db_pwd)
ynh_print_ON
#=================================================
# STANDARD RESTORATION STEPS
@ -45,10 +43,8 @@ ynh_restore
# POPULATE THE DATABASE
ynh_script_progression --message="Reconfiguring Postgresql database..."
ynh_psql_test_if_first_run
ynh_print_OFF
ynh_psql_execute_as_root \
--sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
ynh_print_ON
# Restore systemd configuration
ynh_script_progression --message="Reconfiguring application..."