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:
parent
69e734b931
commit
9868419ec4
4 changed files with 17 additions and 18 deletions
|
@ -9,4 +9,7 @@ name = "Adguard configuration"
|
||||||
[main.options.dns_over_https]
|
[main.options.dns_over_https]
|
||||||
ask = "Enable DNS-over-HTTPS"
|
ask = "Enable DNS-over-HTTPS"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "allow_unencrypted_doh:__FINALPATH__/AdGuardHome.yaml"
|
yes = "true"
|
||||||
|
no = "false"
|
||||||
|
bind = "allow_unencrypted_doh:__FINALPATH__/AdGuardHome.yaml"
|
||||||
|
services = [ '__APP__' ]
|
|
@ -29,13 +29,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
adguard_port=$(ynh_app_setting_get --app=$app --key=adguard_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)
|
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)
|
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)
|
ipv6_route_output=$(echo "$(ip -6 route get ::1.2.3.4 2> /dev/null)" | head -n1)
|
||||||
|
|
||||||
|
|
|
@ -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=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
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=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
|
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
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
if [ "$dns_over_https" == "1" ];
|
|
||||||
then
|
|
||||||
dns_over_https="true"
|
|
||||||
else
|
|
||||||
dns_over_https="false"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Main config File
|
# Main config File
|
||||||
ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$final_path/AdGuardHome.yaml"
|
ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$final_path/AdGuardHome.yaml"
|
||||||
|
|
||||||
|
|
|
@ -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"
|
ynh_permission_create --permission="api" --label="api" --url="re:$domain/dns-query" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$dns_over_https" ];
|
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ];
|
||||||
then
|
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
|
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue