mirror of
https://github.com/YunoHost-Apps/adguardhome_ynh.git
synced 2024-09-03 18:06:23 +02:00
hardcode port 53 (mandatory but conflicting with dnsmasq and the core)
This commit is contained in:
parent
556b2458ef
commit
f65fc16f3f
6 changed files with 17 additions and 20 deletions
|
@ -16,7 +16,7 @@ dns:
|
||||||
bind_hosts:
|
bind_hosts:
|
||||||
__IPV4_ADDR__
|
__IPV4_ADDR__
|
||||||
__IPV6_ADDR__
|
__IPV6_ADDR__
|
||||||
port: __PORT_ADGUARD__
|
port: 53
|
||||||
anonymize_client_ip: false
|
anonymize_client_ip: false
|
||||||
ratelimit: 20
|
ratelimit: 20
|
||||||
ratelimit_subnet_len_ipv4: 24
|
ratelimit_subnet_len_ipv4: 24
|
||||||
|
|
|
@ -72,9 +72,6 @@ autoupdate.asset.armhf = "^AdGuardHome_linux_armv7.tar.gz$"
|
||||||
autoupdate.strategy = "latest_github_release"
|
autoupdate.strategy = "latest_github_release"
|
||||||
|
|
||||||
[resources.ports]
|
[resources.ports]
|
||||||
adguard.default = 53
|
|
||||||
adguard.exposed = "Both"
|
|
||||||
adguard.fixed = true
|
|
||||||
dns_over_http.default = 853
|
dns_over_http.default = 853
|
||||||
dns_over_http.exposed = "Both"
|
dns_over_http.exposed = "Both"
|
||||||
dns_over_quic.default = 784
|
dns_over_quic.default = 784
|
||||||
|
|
|
@ -20,12 +20,12 @@ set__open_port_53() {
|
||||||
if [ "$open_port_53" == "true" ]; then
|
if [ "$open_port_53" == "true" ]; then
|
||||||
ynh_script_progression --message="Opening port 53..."
|
ynh_script_progression --message="Opening port 53..."
|
||||||
# if the user would expose port 53 to the Internet, open it
|
# if the user would expose port 53 to the Internet, open it
|
||||||
ynh_exec_warn_less yunohost firewall allow Both "$port_adguard"
|
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||||
yunohost firewall reload
|
yunohost firewall reload
|
||||||
elif [ "$open_port_53" == "false" ]; then
|
elif [ "$open_port_53" == "false" ]; then
|
||||||
# else if false, close it
|
# else if false, close it
|
||||||
ynh_script_progression --message="Closing port 53..."
|
ynh_script_progression --message="Closing port 53..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_adguard"
|
ynh_exec_warn_less yunohost firewall disallow Both 53
|
||||||
yunohost firewall reload
|
yunohost firewall reload
|
||||||
else
|
else
|
||||||
# else, throw error
|
# else, throw error
|
||||||
|
|
|
@ -30,13 +30,11 @@ ynh_app_setting_set --app="$app" --key=dns_over_https --value="$dns_over_https"
|
||||||
|
|
||||||
if [ "$open_port_53" == "1" ]; then
|
if [ "$open_port_53" == "1" ]; then
|
||||||
open_port_53="true"
|
open_port_53="true"
|
||||||
# no need to open th port, as it were opened at the 'Provisioning ports' step
|
# if open_port_53 is true, we need to open port 53
|
||||||
|
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||||
|
ynh_exec_warn_less yunohost firewall reload
|
||||||
else
|
else
|
||||||
open_port_53="false"
|
open_port_53="false"
|
||||||
# if open_port_53 is false, we need to close port,
|
|
||||||
# as it were opened at the 'Provisioning ports' step
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
|
||||||
ynh_exec_warn_less yunohost firewall reload
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
||||||
|
|
|
@ -11,8 +11,8 @@ source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CLOSE UNNECESSARY PORTS
|
# PROCESS OPENING/CLOSING PORTS
|
||||||
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
# no need to open the DoH/DoQ ports, as they were opened at the 'Provisioning ports' step
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ "$dns_over_https" == "false" ]; then
|
if [ "$dns_over_https" == "false" ]; then
|
||||||
|
@ -23,8 +23,9 @@ if [ "$dns_over_https" == "false" ]; then
|
||||||
ynh_exec_warn_less yunohost firewall reload
|
ynh_exec_warn_less yunohost firewall reload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$open_port_53" == "false" ]; then
|
if [ "$open_port_53" == "true" ]; then
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
# if open_port_53 is true, we need to open port 53
|
||||||
|
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||||
ynh_exec_warn_less yunohost firewall reload
|
ynh_exec_warn_less yunohost firewall reload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -66,16 +66,17 @@ fi
|
||||||
if [ -n "${open_port_53:-}" ] && [ "${open_port_53:-}" == "1" ]; then
|
if [ -n "${open_port_53:-}" ] && [ "${open_port_53:-}" == "1" ]; then
|
||||||
open_port_53="true"
|
open_port_53="true"
|
||||||
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
||||||
# no need to open th port, as it were opened at the 'Provisioning ports' step
|
# if open_port_53 is true, we need to open port 53
|
||||||
|
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||||
|
ynh_exec_warn_less yunohost firewall reload
|
||||||
elif [ -z "${open_port_53:-}" ] || [ "${open_port_53:-}" == "0" ]; then
|
elif [ -z "${open_port_53:-}" ] || [ "${open_port_53:-}" == "0" ]; then
|
||||||
open_port_53="false"
|
open_port_53="false"
|
||||||
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
||||||
# if open_port_53 is false, we need to close port,
|
|
||||||
# as it were opened at the 'Provisioning ports' step
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
|
||||||
ynh_exec_warn_less yunohost firewall reload
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# remove setting no longer required
|
||||||
|
ynh_app_setting_delete --app="$app" --key="$port_adguard"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue