1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/librarian_ynh.git synced 2024-09-03 19:36:01 +02:00
This commit is contained in:
ericgaspar 2022-05-28 14:11:09 +02:00
parent 0c6db5e463
commit c590514a69
3 changed files with 25 additions and 2 deletions

View file

@ -35,9 +35,9 @@ INSTANCE_PRIVACY:
DATA_COLLECTED_DEVICE: true
DATA_COLLECTED_DIAGNOSTIC_ONLY: false
# The country your instance is located. Leave blank if hosting on darknet.
INSTANCE_COUNTRY: ""
INSTANCE_COUNTRY: "__INSTANCE_COUNTRY__"
# Put the name of your hosting provider. If hosting from home, use the name of your ISP. Leave blank if hosting on darknet.
INSTANCE_PROVIDER: ""
INSTANCE_PROVIDER: "__INSTANCE_PROVIDER__"
# Cloudflare use is discouraged. You can set this to false if it is not proxied (gray cloud icon)
INSTANCE_CLOUDFLARE: false
# Optional: Explain your usage of data (if collected) and how it is stored.

View file

@ -30,6 +30,9 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
instance_country=""
instance_provider=""
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -48,6 +51,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=instance_country --value=$instance_country
ynh_app_setting_set --app=$app --key=instance_provider --value=$instance_provider
#=================================================
# STANDARD MODIFICATIONS

View file

@ -21,6 +21,9 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
instance_country=$(ynh_app_setting_get --app=$app --key=instance_country)
instance_provider=$(ynh_app_setting_get --app=$app --key=instance_provider)
#=================================================
# CHECK VERSION
#=================================================
@ -41,6 +44,21 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "$instance_country" ]; then
instance_country=""
ynh_app_setting_set --app=$app --key=instance_country --value=$instance_country
fi
if [ -z "$instance_provider" ]; then
instance_provider=""
ynh_app_setting_set --app=$app --key=instance_provider --value=$instance_provider
fi
#=================================================
# STANDARD UPGRADE STEPS
#=================================================