From 3c546b1c803bda11fdb2d76594c56256d2528641 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 16 Jun 2020 16:53:58 +0200 Subject: [PATCH] Redacting sensitive data is now handled by the core --- scripts/config | 7 ++----- scripts/install | 6 +++--- scripts/restore | 4 +--- scripts/upgrade | 4 ++-- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/scripts/config b/scripts/config index 104c718..f373efb 100644 --- a/scripts/config +++ b/scripts/config @@ -32,7 +32,7 @@ with_sftp="${YNH_CONFIG_MAIN_SFTP_SFTP:-$old_with_sftp}" # sftp password is_password_exist=0 -ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password) +password=$(ynh_app_setting_get --app=$app --key=password) if [ -n "$password" ] then ynh_print_warn --message="A password already exist, it will not be replaced." @@ -43,7 +43,6 @@ else # Otherwise, get the new password password="$YNH_CONFIG_MAIN_SFTP_PASSWORD" fi -ynh_print_ON # is_public @@ -87,7 +86,7 @@ show_config() { # here you are supposed to read some config file/database/other then print the values # ynh_return "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value" ynh_return "YNH_CONFIG_MAIN_SFTP_SFTP=$with_sftp" -# ynh_print_OFF; ynh_return "YNH_CONFIG_MAIN_SFTP_PASSWORD=$password"; ynh_print_ON +# ynh_return "YNH_CONFIG_MAIN_SFTP_PASSWORD=$password" ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public" @@ -129,10 +128,8 @@ apply_config() { else user=$(ynh_app_setting_get --app=$app --key=user) # Add the password to the user - ynh_print_OFF chpasswd <<< "${user}:${password}" ynh_app_setting_set --app=$app --key=password --value="$password" - ynh_print_ON fi fi fi diff --git a/scripts/install b/scripts/install index 363c43d..01db129 100644 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH with_sftp=$YNH_APP_ARG_WITH_SFTP -ynh_print_OFF; password=$YNH_APP_ARG_PASSWORD; ynh_print_ON +password=$YNH_APP_ARG_PASSWORD is_public=$YNH_APP_ARG_IS_PUBLIC with_mysql=$YNH_APP_ARG_WITH_MYSQL @@ -103,8 +103,8 @@ ynh_system_user_exists --username=$user || \ if [ $with_sftp -eq 1 ] then # Add the password to this user - ynh_print_OFF; chpasswd <<< "${user}:${password}"; ynh_print_ON - ynh_print_OFF; ynh_app_setting_set --app=$app --key=password --value="$password"; ynh_print_ON + chpasswd <<< "${user}:${password}" + ynh_app_setting_set --app=$app --key=password --value="$password" fi #================================================= diff --git a/scripts/restore b/scripts/restore index e147dff..a30508f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp) -ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON +password=$(ynh_app_setting_get --app=$app --key=password) user=$(ynh_app_setting_get --app=$app --key=user) #================================================= @@ -78,13 +78,11 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei ynh_system_user_exists --username=$user || \ useradd -d "$final_path" -M --user-group "$user" -ynh_print_OFF if [ -n "$password" ] then # Add the password to this user chpasswd <<< "${user}:${password}" fi -ynh_print_ON #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index 3469edb..246f75a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp) -ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON +password=$(ynh_app_setting_get --app=$app --key=password) user=$(ynh_app_setting_get --app=$app --key=user) overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx) @@ -155,7 +155,7 @@ ynh_system_user_exists --username=$user || \ if [ $with_sftp -eq 1 ] then # Add the password to this user - ynh_print_OFF; chpasswd <<< "${user}:${password}"; ynh_print_ON + chpasswd <<< "${user}:${password}" fi # Change the user group for previous my_webapp install script