From 421888d1377f99f5965b5e6465256948b4fe21d0 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 17 Jun 2020 16:09:30 +0200 Subject: [PATCH] Password strength is to be enforced by the core --- config_panel.toml | 2 +- scripts/config | 14 +++----------- scripts/install | 9 --------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 3ce3d75..bcaceb1 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -13,7 +13,7 @@ name = "My webapp configuration" default = true [main.sftp.password] - ask = "Set a password for the SFTP access. ≥ 5 character" + ask = "Set a password for the SFTP access" type = "password" optional = true help = "If a password already exist, it will not be replaced." diff --git a/scripts/config b/scripts/config index b1024be..ebdadf8 100644 --- a/scripts/config +++ b/scripts/config @@ -119,17 +119,9 @@ apply_config() { # Change the password only if none was already set for the user if [ $is_password_exist -eq 0 ] && [ $with_sftp -eq 1 ] then - # Check password strength - if [ ${#password} -le 5 ] - then - ynh_print_err --message="The password is too weak, it must be longer than 5 characters." - # Disable the sftp access, as the password is incorrect - yunohost app action run $app sftp --args with_sftp=0 - else - # Add the password to the user - chpasswd <<< "${app}:${password}" - ynh_app_setting_set --app=$app --key=password --value="$password" - fi + # Add the password to the user + chpasswd <<< "${app}:${password}" + ynh_app_setting_set --app=$app --key=password --value="$password" fi fi diff --git a/scripts/install b/scripts/install index 464c781..3400ecb 100644 --- a/scripts/install +++ b/scripts/install @@ -39,15 +39,6 @@ ynh_script_progression --message="Validating installation parameters..." --weigh final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -if [ $with_sftp -eq 1 ] -then - # Check password strength - if [ ${#password} -le 5 ] - then - ynh_die --message="The password is too weak, it must be longer than 5 characters" - fi -fi - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url