Browse Source

Redacting sensitive data is now handled by the core

pull/43/head
Alexandre Aubin 6 years ago
parent
commit
3c546b1c80
  1. 7
      scripts/config
  2. 6
      scripts/install
  3. 4
      scripts/restore
  4. 4
      scripts/upgrade

7
scripts/config

@ -32,7 +32,7 @@ with_sftp="${YNH_CONFIG_MAIN_SFTP_SFTP:-$old_with_sftp}"
# sftp password # sftp password
is_password_exist=0 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" ] if [ -n "$password" ]
then then
ynh_print_warn --message="A password already exist, it will not be replaced." ynh_print_warn --message="A password already exist, it will not be replaced."
@ -43,7 +43,6 @@ else
# Otherwise, get the new password # Otherwise, get the new password
password="$YNH_CONFIG_MAIN_SFTP_PASSWORD" password="$YNH_CONFIG_MAIN_SFTP_PASSWORD"
fi fi
ynh_print_ON
# is_public # is_public
@ -87,7 +86,7 @@ show_config() {
# here you are supposed to read some config file/database/other then print the values # 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_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value"
ynh_return "YNH_CONFIG_MAIN_SFTP_SFTP=$with_sftp" 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" ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public"
@ -129,10 +128,8 @@ apply_config() {
else else
user=$(ynh_app_setting_get --app=$app --key=user) user=$(ynh_app_setting_get --app=$app --key=user)
# Add the password to the user # Add the password to the user
ynh_print_OFF
chpasswd <<< "${user}:${password}" chpasswd <<< "${user}:${password}"
ynh_app_setting_set --app=$app --key=password --value="$password" ynh_app_setting_set --app=$app --key=password --value="$password"
ynh_print_ON
fi fi
fi fi
fi fi

6
scripts/install

@ -23,7 +23,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
with_sftp=$YNH_APP_ARG_WITH_SFTP 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 is_public=$YNH_APP_ARG_IS_PUBLIC
with_mysql=$YNH_APP_ARG_WITH_MYSQL with_mysql=$YNH_APP_ARG_WITH_MYSQL
@ -103,8 +103,8 @@ ynh_system_user_exists --username=$user || \
if [ $with_sftp -eq 1 ] if [ $with_sftp -eq 1 ]
then then
# Add the password to this user # 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 fi
#================================================= #=================================================

4
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) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp) 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) 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 || \ ynh_system_user_exists --username=$user || \
useradd -d "$final_path" -M --user-group "$user" useradd -d "$final_path" -M --user-group "$user"
ynh_print_OFF
if [ -n "$password" ] if [ -n "$password" ]
then then
# Add the password to this user # Add the password to this user
chpasswd <<< "${user}:${password}" chpasswd <<< "${user}:${password}"
fi fi
ynh_print_ON
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS

4
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) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql) with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp) 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) user=$(ynh_app_setting_get --app=$app --key=user)
overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx) 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 ] if [ $with_sftp -eq 1 ]
then then
# Add the password to this user # Add the password to this user
ynh_print_OFF; chpasswd <<< "${user}:${password}"; ynh_print_ON
chpasswd <<< "${user}:${password}"
fi fi
# Change the user group for previous my_webapp install script # Change the user group for previous my_webapp install script

Loading…
Cancel
Save