From 07a3461622f49d806744c6767fe03311f7555fe5 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Fri, 17 May 2019 10:44:19 +0200 Subject: [PATCH 1/2] Do not rm... --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index ad18600..5d74e76 100755 --- a/scripts/install +++ b/scripts/install @@ -124,7 +124,7 @@ ynh_replace_string --match_string="__YNH_ADMIN_USER__" --replace_string="$admin_ ynh_store_file_checksum --file="$jirafeauconfigfile" # Remove the install.php -rm $final_path/install.php +ynh_secure_remove --file=$final_path/install.php #================================================= # GENERIC FINALISATION diff --git a/scripts/upgrade b/scripts/upgrade index cae86d6..9e4af78 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,7 +151,7 @@ ynh_replace_string --match_string="__YNH_ADMIN_USER__" --replace_string="$admin_ ynh_store_file_checksum --file="$jirafeauconfigfile" # Remove the install.php -rm $final_path/install.php +ynh_secure_remove --file=$final_path/install.php #================================================= # GENERIC FINALISATION From 8e7cc8531acd5ed4b608c7bf206b0b762159fe6d Mon Sep 17 00:00:00 2001 From: nicofrand Date: Sat, 25 May 2019 11:33:11 +0200 Subject: [PATCH 2/2] Do not output upload password in logs (fix #60) --- scripts/install | 4 ++++ scripts/upgrade | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index 5d74e76..d9a2d40 100755 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,9 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin_user=$YNH_APP_ARG_ADMIN_USER +ynh_print_OFF upload_password=$YNH_APP_ARG_UPLOAD_PASSWORD +ynh_print_ON is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -94,6 +96,7 @@ jirafeauconfigfile="$final_path/lib/config.local.php" cp "../conf/config.local.php" "$jirafeauconfigfile" # Set and save upload password, allowing an empty one +ynh_print_OFF if [ -z "$upload_password" ] then ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile" @@ -102,6 +105,7 @@ else ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile" ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password" fi +ynh_print_ON #================================================= # CONFIGURE JIRAFEAU diff --git a/scripts/upgrade b/scripts/upgrade index 9e4af78..b97c573 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,9 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) admin_user=$(ynh_app_setting_get --app=$app --key=admin_user) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +ynh_print_OFF upload_password=$(ynh_app_setting_get --app=$app --key=upload_password) +ynh_print_ON #================================================= # CHECK VERSION @@ -121,6 +123,7 @@ ynh_backup_if_checksum_is_different --file="$final_path/lib/config.local.php" cp "../conf/config.local.php" "$final_path/lib/config.local.php" # Set and save upload password, allowing an empty one +ynh_print_OFF if [ -z "$upload_password" ] then ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="" --target_file="$jirafeauconfigfile" @@ -129,6 +132,7 @@ else ynh_replace_string --match_string="__YNH_UPLOAD_PASSWORD__" --replace_string="'$upload_password'" --target_file="$jirafeauconfigfile" ynh_app_setting_set --app=$app --key=upload_password --value="$upload_password" fi +ynh_print_ON #================================================= # CONFIGURE JIRAFEAU