mirror of
https://github.com/YunoHost-Apps/my_webapp_ynh.git
synced 2024-09-03 19:46:26 +02:00
commit
7d29233133
2 changed files with 14 additions and 5 deletions
|
@ -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 l’accè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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue