mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
make config_panel consistent to prevent issues
This commit is contained in:
parent
501af4cf29
commit
e2fd53ce0f
7 changed files with 28 additions and 14 deletions
|
@ -36,6 +36,6 @@ STATICMAP_SUBDOMAINS=''
|
|||
|
||||
# Weather
|
||||
# available weather API providers: darksky, visualcrossing
|
||||
WEATHER_API_PROVIDER=__WEATHER_PROVIDER__
|
||||
WEATHER_API_KEY=__WEATHER_KEY__
|
||||
WEATHER_API_PROVIDER=__WEATHER_API_PROVIDER__
|
||||
WEATHER_API_KEY=__WEATHER_API_KEY__
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ services = ["__APP__", "__APP___workers"]
|
|||
help.fr = "Change le répertoire de données où sont stockés tous les fichiers .gpx téléversés et les photos de profil"
|
||||
bind = "UPLOAD_FOLDER:/var/www/__APP__/.env"
|
||||
|
||||
[main.config.weather_provider]
|
||||
[main.config.weather_api_provider]
|
||||
ask.en = "Change weather provider"
|
||||
ask.fr = "Changer le fournisseur météo"
|
||||
type = "select"
|
||||
|
@ -36,7 +36,7 @@ services = ["__APP__", "__APP___workers"]
|
|||
help.fr = "Changer votre fournisseur météo en choisissant un de ceux qui vous sont proposés"
|
||||
bind = "WEATHER_API_PROVIDER:/var/www/__APP__/.env"
|
||||
|
||||
[main.config.WEATHER_API_KEY]
|
||||
[main.config.weather_api_key]
|
||||
ask.en = "Change weather api key"
|
||||
ask.fr = "Changer la clé api pour la météo"
|
||||
type = "string"
|
||||
|
|
|
@ -47,7 +47,7 @@ ram.runtime = "50M"
|
|||
help.fr = "Choisissez un mot de passe pour l’utilisateur admin ici."
|
||||
type = "password"
|
||||
|
||||
[install.weather_provider]
|
||||
[install.weather_api_provider]
|
||||
ask.en = "(Optional) Choose your weather provider between Darksky and Visual Crossing"
|
||||
ask.fr = "(Optionnel) Choisissez votre fournisseur météo entre Darksky et Visual Crossing"
|
||||
help.en = "Since Fittrackee 0.7.15, only Visual Crossing is supported"
|
||||
|
@ -57,7 +57,7 @@ ram.runtime = "50M"
|
|||
default = "visualcrossing"
|
||||
optional = true
|
||||
|
||||
[install.weather_key]
|
||||
[install.weather_api_key]
|
||||
ask.en = "(Optional) Insert here the api key from the chosen weather provider"
|
||||
ask.fr = "(Optionnel) Insérez ici la clé API du fournisseur de météo choisi"
|
||||
type = "string"
|
||||
|
|
|
@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers
|
|||
admin=$(ynh_user_get_info --username=$admin --key=username)
|
||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
|
||||
weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider)
|
||||
weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key)
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
|
|
@ -11,8 +11,8 @@ source /usr/share/yunohost/helpers
|
|||
|
||||
admin=$(ynh_user_get_info --username=$admin --key=username)
|
||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
ynh_app_setting_set --app=$app --key=weather_provider --value=$weather_provider
|
||||
ynh_app_setting_set --app=$app --key=weather_key --value=$weather_key
|
||||
ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider
|
||||
ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -16,8 +16,24 @@ source /usr/share/yunohost/helpers
|
|||
admin=$(ynh_user_get_info --username=$admin --key=username)
|
||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
|
||||
weather_provider=$(ynh_app_setting_get --app=$app --key=$weather_provider)
|
||||
weather_key=$(ynh_app_setting_get --app=$app --key=$weather_key)
|
||||
ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider
|
||||
ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
if [ -z "${weather_api_provider:-}" ]; then
|
||||
weather_api_provider=$weather_provider
|
||||
ynh_app_setting_set --app=$app --key=weather_api_provider --value=$weather_api_provider
|
||||
fi
|
||||
|
||||
if [ -z "${weather_api_key:-}" ]; then
|
||||
weather_api_key=$weather_key
|
||||
ynh_app_setting_set --app=$app --key=weather_api_key --value=$weather_api_key
|
||||
fi
|
||||
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
|
|
@ -21,4 +21,5 @@ test_format = 1.0
|
|||
test_upgrade_from.e49294c.name = "0.7.22"
|
||||
test_upgrade_from.a446e8c.name = "0.7.23"
|
||||
test_upgrade_from.316dea4.name = "0.7.24"
|
||||
test_upgrade_from.d682f12.name = "0.7.25~ynh3"
|
||||
test_upgrade_from.d682f12.name = "0.7.25~ynh3"
|
||||
test_upgrade_from.e48197d.name = "0.7.26"
|
Loading…
Reference in a new issue