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

do not overwrite db_pwd

This commit is contained in:
Félix Piédallu 2024-01-31 12:17:37 +01:00
parent d845cdd024
commit 670a55b632
2 changed files with 6 additions and 6 deletions

View file

@ -3,12 +3,11 @@ set timeout 20
set cmd [lindex $argv 0] set cmd [lindex $argv 0]
set path [lindex $argv 1] set path [lindex $argv 1]
set user [lindex $argv 2]
spawn $cmd $path spawn $cmd $path
expect "Email address:" expect "Email address:"
send "$user\r"; send "__EMAIL__\r";
expect "Password:" expect "Password:"
send {__PASSWORD__}; send {__PASSWORD__};

View file

@ -14,6 +14,7 @@ source /usr/share/yunohost/helpers
# INITIALIZE AND STORE SETTINGS # INITIALIZE AND STORE SETTINGS
#================================================= #=================================================
# Used in expect script
email=$(ynh_user_get_info --username $admin --key 'mail') email=$(ynh_user_get_info --username $admin --key 'mail')
#================================================= #=================================================
@ -38,19 +39,19 @@ ynh_script_progression --message="Configuring $app..."
ynh_add_config --template="setup.exp" --destination="$install_dir/setup.exp" ynh_add_config --template="setup.exp" --destination="$install_dir/setup.exp"
chmod +x "$install_dir/setup.exp" chmod +x "$install_dir/setup.exp"
"$install_dir/setup.exp" "$install_dir/venv/bin/python3" "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4/setup.py" "$email" "$install_dir/setup.exp" "$install_dir/venv/bin/python3" "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4/setup.py"
#================================================= #=================================================
# Postgresql superuser # Postgresql superuser
#================================================= #=================================================
ynh_script_progression --message="Configuring Postgresql superuser..." ynh_script_progression --message="Configuring Postgresql superuser..."
# We overwrite the existing db_pwd
ynh_psql_execute_as_root --sql "ALTER USER $app WITH PASSWORD '$password' SUPERUSER CREATEDB CREATEROLE REPLICATION" ynh_psql_execute_as_root --sql "ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION"
# Add Server In PGadmin database # Add Server In PGadmin database
ynh_add_config --template="setup_database.py" --destination "$install_dir/setup_database.py" ynh_add_config --template="setup_database.py" --destination "$install_dir/setup_database.py"
chmod +x "$install_dir/setup_database.py" chmod +x "$install_dir/setup_database.py"
"$install_dir/venv/bin/python3" "$install_dir/setup_database.py" "$db_user" "$password" "$install_dir/venv/bin/python3" "$install_dir/setup_database.py" "$db_user" "$db_pwd"
# Set permission after initialisation # Set permission after initialisation
ynh_script_progression --message="Protecting directory" ynh_script_progression --message="Protecting directory"