1
0
Fork 0
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:
Grena 2023-04-22 09:24:09 +02:00
parent 3ff1f680e3
commit 4df8dd6d75
7 changed files with 24 additions and 9 deletions

View file

@ -1,7 +1,7 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
username="mosquitto" username="mosquitto"
password="pass" userpass="mosquitto"
port="1883" port="1883"
; Checks ; Checks
pkg_linter=1 pkg_linter=1

View file

@ -1 +1 @@
__USERNAME__:__PASSWORD__ __USERNAME__:__USERPASS__

View file

@ -31,12 +31,20 @@
{ {
"name": "username", "name": "username",
"type": "string", "type": "string",
"ask": {
"en": "Set the username for client authentication",
"fr": "Définissez le nom d'utilisateur pour l'authentification du client"
},
"example": "mosquitto", "example": "mosquitto",
"default": "mosquitto" "default": "mosquitto"
}, },
{ {
"name": "password", "name": "userpass",
"type": "password" "type": "password",
"ask": {
"en": "Set the password for client authentication",
"fr": "Définissez le mot de passe pour l'authentification du client"
}
} }
] ]
} }

View file

@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
username=$(ynh_app_setting_get --app=$app --key=username) 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 # DECLARE DATA AND CONF FILES TO BACKUP

View file

@ -21,7 +21,7 @@ ynh_abort_if_errors
#================================================= #=================================================
username=$YNH_APP_ARG_USERNAME username=$YNH_APP_ARG_USERNAME
password=$YNH_APP_ARG_PASSWORD userpass=$YNH_APP_ARG_USERPASS
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -31,7 +31,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Storing installation settings..." --weight=1 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=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 # STANDARD MODIFICATIONS

View file

@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
username=$(ynh_app_setting_get --app=$app --key=username) 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 # SPECIFIC RESTORATION

View file

@ -18,7 +18,14 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
username=$(ynh_app_setting_get --app=$app --key=username) 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 # CHECK VERSION