1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Redacting sensitive data is now handled by the core

This commit is contained in:
Alexandre Aubin 2020-06-16 16:53:58 +02:00
parent 1a27b9dc05
commit 3c546b1c80
4 changed files with 8 additions and 13 deletions

View file

@ -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

View file

@ -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 chpasswd <<< "${user}:${password}"
ynh_print_OFF; ynh_app_setting_set --app=$app --key=password --value="$password"; ynh_print_ON ynh_app_setting_set --app=$app --key=password --value="$password"
fi fi
#================================================= #=================================================

View file

@ -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

View file

@ -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