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

fix config panel

This commit is contained in:
Kay0u 2022-01-07 10:30:25 +01:00
parent 69e734b931
commit 9868419ec4
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
4 changed files with 17 additions and 18 deletions

View file

@ -9,4 +9,7 @@ name = "Adguard configuration"
[main.options.dns_over_https]
ask = "Enable DNS-over-HTTPS"
type = "boolean"
bind = "allow_unencrypted_doh:__FINALPATH__/AdGuardHome.yaml"
yes = "true"
no = "false"
bind = "allow_unencrypted_doh:__FINALPATH__/AdGuardHome.yaml"
services = [ '__APP__' ]

View file

@ -29,13 +29,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
adguard_port=$(ynh_app_setting_get --app=$app --key=adguard_port)
dns_over_https=$(ynh_app_setting_get --app=$app --key=dns_over_https)
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
else
dns_over_https="false"
fi
ipv4_route_output=$(echo "$(ip -4 route get 1.2.3.4 2> /dev/null)" | head -n1)
ipv6_route_output=$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1)

View file

@ -49,6 +49,13 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
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
if [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
else
dns_over_https="false"
fi
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
#=================================================
@ -164,14 +171,6 @@ for i in $(seq "$(echo $ipv6_route_output | wc -w)" -1 1); do
fi
done
if [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
else
dns_over_https="false"
fi
# Main config File
ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$final_path/AdGuardHome.yaml"

View file

@ -43,9 +43,13 @@ if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --label="api" --url="re:$domain/dns-query" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
fi
if [ -z "$dns_over_https" ];
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ];
then
dns_over_https="0"
dns_over_https="true"
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
elif [ -z "$dns_over_https" ] || [ "$dns_over_https" == "0" ];
then
dns_over_https="false"
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
fi