From 7eebeda6997610ff8f5ff7d7e3762cf267fc77cc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 Aug 2020 00:17:14 +0200 Subject: [PATCH] db_pwd --- scripts/change_url | 3 ++- scripts/install | 5 +++-- scripts/upgrade | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 5d4c704..207197d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED @@ -88,7 +89,7 @@ cp ../conf/config.php "$final_path/config.php" # Change domain name in config.php ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.php" -ynh_replace_string --match_string="__DBPWD__" --replace_string="$mysqlpwd" --target_file="$final_path/config.php" +ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" ynh_replace_string --match_string="__DOMAINPATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" # Recalculate and store the config file checksum into the app settings diff --git a/scripts/install b/scripts/install index e7ca42b..f89cec2 100644 --- a/scripts/install +++ b/scripts/install @@ -55,8 +55,9 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_script_progression --message="Creating a MySQL database..." --weight=2 db_name=$(ynh_sanitize_dbid $app) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name +ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -102,7 +103,7 @@ cp ../conf/config.php "$final_path/config.php" # Change variables in ttrss configuration ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.php" -ynh_replace_string --match_string="__DBPWD__" --replace_string="$mysqlpwd" --target_file="$final_path/config.php" +ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" ynh_replace_string --match_string="__DOMAINPATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" # Recalculate and store the config file checksum into the app settings diff --git a/scripts/upgrade b/scripts/upgrade index 8d0cefb..bc25cb5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= # CHECK VERSION @@ -140,7 +141,7 @@ then # Change variables in ttrss configuration ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.php" db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - ynh_replace_string --match_string="__DBPWD__" --replace_string="$mysqlpwd" --target_file="$final_path/config.php" + ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" ynh_replace_string --match_string="__DOMAINPATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" # Recalculate and store the config file checksum into the app settings