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

Merge pull request #138 from grenagit/master

Fix password change
This commit is contained in:
Kayou 2024-07-23 13:35:57 +02:00 committed by GitHub
commit 7d29233133
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 5 deletions

View file

@ -4,19 +4,23 @@ version = "1.0"
name = "My Webapp configuration"
[main.sftp]
name = "SFTP access"
name.en = "SFTP access"
name.fr = "Accès SFTP"
[main.sftp.with_sftp]
ask = "Do you need a SFTP access?"
ask.en = "Do you need a SFTP access?"
ask.fr = "Avez-vous besoin d'un accès SFTP ?"
type = "boolean"
default = true
[main.sftp.password]
ask = "Set a password for the SFTP access"
ask.en = "Set a password for the SFTP access"
ask.fr = "Définir un mot de passe pour laccès SFTP"
type = "password"
optional = true
visible = "with_sftp"
help = "If a password already exist, leave blank and it will not be replaced."
help.en = "If a password already exist, leave blank and it will not be replaced."
help.fr = "Si un mot de passe existe déjà, laissez vide et il ne sera pas remplacé."
[main.code_error]
name = "Html Custom error"

View file

@ -59,7 +59,7 @@ get__free_footprint() {
#=================================================
set__password() {
if [ "$password" == "" ]
if [ ! "$password" == "" ]
then
ynh_app_setting_set --app=$app --key=password --value="$password"
fi
@ -150,6 +150,11 @@ ynh_app_config_apply() {
then
ynh_system_user_del_group --username=$app --groups="sftp.app"
fi
if [ "${changed[password]}" == "true" ] && [ ! "$password" == "" ]
then
chpasswd <<< "${app}:${password}"
fi
if [ "${changed[custom_error_file]}" == "true" ]
then