1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wireguard_ynh.git synced 2024-09-03 20:35:58 +02:00

Remove is_public argument

This commit is contained in:
tituspijean 2021-01-21 19:55:16 +01:00
parent e811a176d5
commit d2b10120d7
5 changed files with 4 additions and 29 deletions

View file

@ -8,10 +8,6 @@
domain="domain.tld" (DOMAIN)
path="/" (PATH)
admin="john" (USER)
#language="fr"
is_public=1 (PUBLIC|public=1|private=0)
#password="pass"
#port="666" (PORT)
; Checks
pkg_linter=1
setup_sub_dir=0
@ -34,5 +30,5 @@ Notification=none
;;; Upgrade options
; commit=797a3e5990571629a8525764ce6e8d359277313f
name=a version using backport kernel
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=1&
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=0&

View file

@ -61,19 +61,6 @@
"fr": "Choisissez ladministrateur"
},
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": {
"en": "It is strongly advised to keep the configuration UI private.",
"fr": "Il est fortement conseillé de garder l'interface de configuration privée."
},
"default": false
}
]
}

View file

@ -27,7 +27,6 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH #TODO: Check if possible with wireguard_ui to use sub path
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC # Forced to use it to pass root installation check as public
app=$YNH_APP_INSTANCE_NAME
@ -50,7 +49,6 @@ 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=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public # Forced to use it to pass root installation check as public
#=================================================
# STANDARD MODIFICATIONS
@ -196,13 +194,7 @@ ynh_systemd_action --service_name=wireguard_ui --action="start" --log_path="/var
#=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary to pass root installation check
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission "main" --add visitors
else
ynh_permission_update --permission "main" --remove "all_users" --add "$admin"
fi
#=================================================
# RELOAD NGINX

View file

@ -33,7 +33,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
port_wg=$(ynh_app_setting_get --app=$app --key=port_wg)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
#=================================================
# CHECK IF THE APP CAN BE RESTORED

View file

@ -45,7 +45,8 @@ then
ynh_app_setting_delete --app=$app --key=port
port=$(ynh_find_port --port=$(($port_wg+1)))
ynh_app_setting_set --app=$app --key=port --value=$port
ynh_app_setting_set --app=$app --key=is_public --value=0
# Let's remove the unused is_public key too
ynh_app_setting_delete --app=$app --key=is_public
fi
# Downgrade linux-image-$arch if updated to the buster-backports version