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:
parent
e9fe3698db
commit
a29adfcf6a
2 changed files with 0 additions and 16 deletions
|
@ -21,9 +21,7 @@ domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$(ynh_normalize_url_path $YNH_APP_ARG_PATH)
|
path_url=$(ynh_normalize_url_path $YNH_APP_ARG_PATH)
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
db_user="pgadmin"
|
db_user="pgadmin"
|
||||||
ynh_print_OFF
|
|
||||||
admin_pwd=$YNH_APP_ARG_ADMIN_PASSWORD
|
admin_pwd=$YNH_APP_ARG_ADMIN_PASSWORD
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
test ! -e "$final_path" || ynh_die --message "This path already contains a folder"
|
test ! -e "$final_path" || ynh_die --message "This path already contains a folder"
|
||||||
|
@ -40,9 +38,7 @@ fi
|
||||||
|
|
||||||
# Build user password
|
# Build user password
|
||||||
ynh_script_progression --message="Defining db password..."
|
ynh_script_progression --message="Defining db password..."
|
||||||
ynh_print_OFF
|
|
||||||
db_pwd=$(ynh_string_random --length 30)
|
db_pwd=$(ynh_string_random --length 30)
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
ynh_script_progression --message="Storing installation settings..."
|
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 admin --value $admin
|
||||||
ynh_app_setting_set --app $app --key db_user --value "$db_user"
|
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_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 admin_pwd --value "$admin_pwd"
|
||||||
ynh_app_setting_set --app $app --key db_pwd --value "$db_pwd"
|
ynh_app_setting_set --app $app --key db_pwd --value "$db_pwd"
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -90,24 +84,18 @@ ynh_script_progression --message="Configuring sqlite database..."
|
||||||
chmod +x ../conf/setup.exp
|
chmod +x ../conf/setup.exp
|
||||||
PS1=""
|
PS1=""
|
||||||
source $final_path/bin/activate
|
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_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"
|
../conf/setup.exp "$final_path/bin/python3" "$final_path/lib/python$python_version/site-packages/pgadmin4/setup.py" "$email"
|
||||||
|
|
||||||
# POPULATE THE DATABASE
|
# POPULATE THE DATABASE
|
||||||
ynh_script_progression --message="Configuring Postgresql database..."
|
ynh_script_progression --message="Configuring Postgresql database..."
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_print_OFF
|
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
--sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
|
--sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
# Add Server In PGadmin database
|
# Add Server In PGadmin database
|
||||||
ynh_replace_string --match_string "__PYTHON_VERSION__" --replace_string "$python_version" --target_file config_database.py
|
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"
|
$final_path/bin/python3 config_database.py "$db_user" "$db_pwd"
|
||||||
ynh_print_ON
|
|
||||||
deactivate
|
deactivate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,9 +22,7 @@ admin=$(ynh_app_setting_get --app $app --key admin)
|
||||||
final_path=$(ynh_app_setting_get --app $app --key final_path)
|
final_path=$(ynh_app_setting_get --app $app --key final_path)
|
||||||
db_name=$(ynh_app_setting_get --app $app --key db_name)
|
db_name=$(ynh_app_setting_get --app $app --key db_name)
|
||||||
db_user=$(ynh_app_setting_get --app $app --key db_user)
|
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)
|
db_pwd=$(ynh_app_setting_get --app $app --key db_pwd)
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
|
@ -45,10 +43,8 @@ ynh_restore
|
||||||
# POPULATE THE DATABASE
|
# POPULATE THE DATABASE
|
||||||
ynh_script_progression --message="Reconfiguring Postgresql database..."
|
ynh_script_progression --message="Reconfiguring Postgresql database..."
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_print_OFF
|
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
--sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
|
--sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
# Restore systemd configuration
|
# Restore systemd configuration
|
||||||
ynh_script_progression --message="Reconfiguring application..."
|
ynh_script_progression --message="Reconfiguring application..."
|
||||||
|
|
Loading…
Reference in a new issue