mirror of
https://github.com/YunoHost-Apps/mosquitto_ynh.git
synced 2024-09-03 19:45:54 +02:00
Clarifie password request
This commit is contained in:
parent
3ff1f680e3
commit
4df8dd6d75
7 changed files with 24 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
username="mosquitto"
|
||||
password="pass"
|
||||
userpass="mosquitto"
|
||||
port="1883"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
|
|
|
@ -1 +1 @@
|
|||
__USERNAME__:__PASSWORD__
|
||||
__USERNAME__:__USERPASS__
|
||||
|
|
|
@ -31,12 +31,20 @@
|
|||
{
|
||||
"name": "username",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Set the username for client authentication",
|
||||
"fr": "Définissez le nom d'utilisateur pour l'authentification du client"
|
||||
},
|
||||
"example": "mosquitto",
|
||||
"default": "mosquitto"
|
||||
},
|
||||
{
|
||||
"name": "password",
|
||||
"type": "password"
|
||||
"name": "userpass",
|
||||
"type": "password",
|
||||
"ask": {
|
||||
"en": "Set the password for client authentication",
|
||||
"fr": "Définissez le mot de passe pour l'authentification du client"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
username=$(ynh_app_setting_get --app=$app --key=username)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
userpass=$(ynh_app_setting_get --app=$app --key=userpass)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
|
|
@ -21,7 +21,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
|
||||
username=$YNH_APP_ARG_USERNAME
|
||||
password=$YNH_APP_ARG_PASSWORD
|
||||
userpass=$YNH_APP_ARG_USERPASS
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -31,7 +31,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||
|
||||
ynh_app_setting_set --app=$app --key=username --value=$username
|
||||
ynh_app_setting_set --app=$app --key=password --value=$password
|
||||
ynh_app_setting_set --app=$app --key=userpass --value=$userpass
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
|
|
@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
username=$(ynh_app_setting_get --app=$app --key=username)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
userpass=$(ynh_app_setting_get --app=$app --key=userpass)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
|
|
@ -18,7 +18,14 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
username=$(ynh_app_setting_get --app=$app --key=username)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
userpass=$(ynh_app_setting_get --app=$app --key=userpass)
|
||||
|
||||
# Transfer and delete the old "password" key
|
||||
if [ -z "$userpass" ]; then
|
||||
ynh_app_setting_set --app=$app --key=userpass --value=$(ynh_app_setting_get --app=$app --key=password)
|
||||
ynh_app_setting_delete --app=$app --key=password
|
||||
userpass=$(ynh_app_setting_get --app=$app --key=userpass)
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
|
Loading…
Reference in a new issue