1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ztncui_ynh.git synced 2024-09-03 18:06:05 +02:00

Fix linter warnings

This commit is contained in:
tituspijean 2021-03-22 12:53:01 +01:00
parent 97965c16ff
commit 0f51aec95c
2 changed files with 8 additions and 18 deletions

View file

@ -14,7 +14,7 @@
"email": "tituspijean@outlook.com" "email": "tituspijean@outlook.com"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.1.2"
}, },
"services": [], "services": [],
"multi_instance": false, "multi_instance": false,
@ -23,10 +23,6 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for ztncui",
"fr": "Choisissez un nom de domaine pour ztncui"
},
"help": { "help": {
"en": "REMINDER: ztncui needs the ZeroTier app to be already installed.", "en": "REMINDER: ztncui needs the ZeroTier app to be already installed.",
"fr": "RAPPEL: ztncui nécessite que l'app ZeroTier soit déjà installée." "fr": "RAPPEL: ztncui nécessite que l'app ZeroTier soit déjà installée."
@ -36,10 +32,6 @@
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": { "help": {
"en": "Ztncui has its own login system, but setting it as private is advised.", "en": "Ztncui has its own login system, but setting it as private is advised.",
"fr": "Ztncui a son propre système de connexion, mais la rendre privée est conseillé." "fr": "Ztncui a son propre système de connexion, mais la rendre privée est conseillé."
@ -49,19 +41,11 @@
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez ladministrateur"
},
"example": "johndoe" "example": "johndoe"
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password",
"ask": {
"en": "Set the administrator password",
"fr": "Définissez le mot de passe administrateur"
},
"help": { "help": {
"en": "It will always be asked by Ztncui, in addition to your YunoHost credentials if set to private.", "en": "It will always be asked by Ztncui, in addition to your YunoHost credentials if set to private.",
"fr": "Il sera toujours demandé par Ztncui, en plus des identifiants YunoHost si l'app est privée." "fr": "Il sera toujours demandé par Ztncui, en plus des identifiants YunoHost si l'app est privée."

View file

@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
admin=$(ynh_app_setting_get --app=$app --key=admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
@ -47,6 +46,13 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
# If admin or password do not exist, assign the standard ones and have them replaced upon first login # If admin or password do not exist, assign the standard ones and have them replaced upon first login
if [ -z "$admin" ] || [ -z "$hashedpassword" ]; then if [ -z "$admin" ] || [ -z "$hashedpassword" ]; then
admin="admin" admin="admin"