mirror of
https://github.com/YunoHost-Apps/adguardhome_ynh.git
synced 2024-09-03 18:06:23 +02:00
rename 'port_dns_over_http' in 'port_dns_over_tls'
This commit is contained in:
parent
21d71b65a4
commit
d19c5d9fb2
6 changed files with 28 additions and 28 deletions
|
@ -54,8 +54,8 @@ default = false
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
|
||||||
[install.dns_over_https]
|
[install.dns_over_https]
|
||||||
ask.en = "Should DNS-over-HTTPS/QUIC be enabled?"
|
ask.en = "Should DNS-over-HTTPS/TLS/QUIC be enabled?"
|
||||||
help.en = "If so, anyone who knows your adguard address can make a doh request to https://adguardomain.tld/dns-query"
|
help.en = "If so, anyone who knows your adguard address can make a doh request to https://adguardomain.tld/dns-query or using DoT/DoQ"
|
||||||
default = false
|
default = false
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ type = "boolean"
|
||||||
autoupdate.strategy = "latest_github_release"
|
autoupdate.strategy = "latest_github_release"
|
||||||
|
|
||||||
[resources.ports]
|
[resources.ports]
|
||||||
dns_over_http.default = 853
|
dns_over_tls.default = 853
|
||||||
dns_over_http.exposed = "Both"
|
dns_over_tls.exposed = "Both"
|
||||||
dns_over_quic.default = 784
|
dns_over_quic.default = 784
|
||||||
dns_over_quic.exposed = "UDP"
|
dns_over_quic.exposed = "UDP"
|
||||||
internal_https.default = 13120
|
internal_https.default = 13120
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
# import needed settings
|
# import needed settings
|
||||||
port_dns_over_http=$(ynh_app_setting_get --app="$app" --key=port_dns_over_http)
|
port_dns_over_tls=$(ynh_app_setting_get --app="$app" --key=port_dns_over_tls)
|
||||||
port_dns_over_quic=$(ynh_app_setting_get --app="$app" --key=port_dns_over_quic)
|
port_dns_over_quic=$(ynh_app_setting_get --app="$app" --key=port_dns_over_quic)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -43,9 +43,9 @@ set__expose_port_53() {
|
||||||
# declare needs_exposed_ports according to real user need
|
# declare needs_exposed_ports according to real user need
|
||||||
ynh_print_info --message="Updating the YunoHost service for AdGuard Home..."
|
ynh_print_info --message="Updating the YunoHost service for AdGuard Home..."
|
||||||
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_tls"
|
||||||
elif [ "$dns_over_https" == "true" ]; then
|
elif [ "$dns_over_https" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_tls"
|
||||||
elif [ "$expose_port_53" == "true" ]; then
|
elif [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
||||||
else
|
else
|
||||||
|
@ -61,12 +61,12 @@ set__dns_over_https() {
|
||||||
if [ "$dns_over_https" == "true" ]; then
|
if [ "$dns_over_https" == "true" ]; then
|
||||||
ynh_print_info --message="Opening DoH and DoQ ports..."
|
ynh_print_info --message="Opening DoH and DoQ ports..."
|
||||||
# if DNS over HTTPS/QUIC is activated, open the associated ports
|
# if DNS over HTTPS/QUIC is activated, open the associated ports
|
||||||
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
||||||
elif [ "$dns_over_https" == "false" ]; then
|
elif [ "$dns_over_https" == "false" ]; then
|
||||||
# else if false, close them
|
# else if false, close them
|
||||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||||
else
|
else
|
||||||
# else, throw error
|
# else, throw error
|
||||||
|
@ -76,9 +76,9 @@ set__dns_over_https() {
|
||||||
# declare needs_exposed_ports according to real user need
|
# declare needs_exposed_ports according to real user need
|
||||||
ynh_print_info --message="Updating the YunoHost service for AdGuard Home..."
|
ynh_print_info --message="Updating the YunoHost service for AdGuard Home..."
|
||||||
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_tls"
|
||||||
elif [ "$dns_over_https" == "true" ]; then
|
elif [ "$dns_over_https" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_tls"
|
||||||
elif [ "$expose_port_53" == "true" ]; then
|
elif [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
||||||
else
|
else
|
||||||
|
|
|
@ -45,9 +45,9 @@ fi
|
||||||
|
|
||||||
if [ "${dns_over_https:-}" = true ]; then
|
if [ "${dns_over_https:-}" = true ]; then
|
||||||
# if DoH and DoQ are closed
|
# if DoH and DoQ are closed
|
||||||
if ! yunohost firewall list | grep -q " $port_dns_over_http$" && ! yunohost firewall list | grep -q " $port_dns_over_quic$"; then
|
if ! yunohost firewall list | grep -q " $port_dns_over_tls$" && ! yunohost firewall list | grep -q " $port_dns_over_quic$"; then
|
||||||
ynh_print_info --message="Opening DoH and DoQ ports..."
|
ynh_print_info --message="Opening DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
||||||
else
|
else
|
||||||
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
||||||
|
@ -57,7 +57,7 @@ else
|
||||||
# if dns_over_https is false, we need to close ports,
|
# if dns_over_https is false, we need to close ports,
|
||||||
# as they were opened at the 'Provisioning ports' step
|
# as they were opened at the 'Provisioning ports' step
|
||||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -136,9 +136,9 @@ ynh_add_systemd_config
|
||||||
|
|
||||||
# declare needs_exposed_ports according to real user need
|
# declare needs_exposed_ports according to real user need
|
||||||
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_tls"
|
||||||
elif [ "$dns_over_https" == "true" ]; then
|
elif [ "$dns_over_https" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_tls"
|
||||||
elif [ "$expose_port_53" == "true" ]; then
|
elif [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
||||||
else
|
else
|
||||||
|
|
|
@ -19,7 +19,7 @@ ynh_print_info --message="Closing port 53..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both 53
|
ynh_exec_warn_less yunohost firewall disallow Both 53
|
||||||
if [ "$dns_over_https" == "true" ]; then
|
if [ "$dns_over_https" == "true" ]; then
|
||||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ fi
|
||||||
|
|
||||||
if [ "${dns_over_https:-}" = true ]; then
|
if [ "${dns_over_https:-}" = true ]; then
|
||||||
# if DoH and DoQ are closed
|
# if DoH and DoQ are closed
|
||||||
if ! yunohost firewall list | grep -q " $port_dns_over_http$" && ! yunohost firewall list | grep -q " $port_dns_over_quic$"; then
|
if ! yunohost firewall list | grep -q " $port_dns_over_tls$" && ! yunohost firewall list | grep -q " $port_dns_over_quic$"; then
|
||||||
ynh_print_info --message="Opening DoH and DoQ ports..."
|
ynh_print_info --message="Opening DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
||||||
else
|
else
|
||||||
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
||||||
|
@ -35,7 +35,7 @@ else
|
||||||
# if dns_over_https is false, we need to close ports,
|
# if dns_over_https is false, we need to close ports,
|
||||||
# as they were opened at the 'Provisioning ports' step
|
# as they were opened at the 'Provisioning ports' step
|
||||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -94,9 +94,9 @@ systemctl enable "$app.service" --quiet
|
||||||
|
|
||||||
# declare needs_exposed_ports according to real user need
|
# declare needs_exposed_ports according to real user need
|
||||||
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_tls"
|
||||||
elif [ "$dns_over_https" == "true" ]; then
|
elif [ "$dns_over_https" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_tls"
|
||||||
elif [ "$expose_port_53" == "true" ]; then
|
elif [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
||||||
else
|
else
|
||||||
|
|
|
@ -65,7 +65,7 @@ if grep -q "port_https: 443" "$install_dir/AdGuardHome.yaml" || grep -q "port_dn
|
||||||
# if so: mandatory replacement for them
|
# if so: mandatory replacement for them
|
||||||
# (because the final user can't easily know the ports used by the package)
|
# (because the final user can't easily know the ports used by the package)
|
||||||
ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port_https" --value="$port_internal_https"
|
ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port_https" --value="$port_internal_https"
|
||||||
ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port_dns_over_tls" --value="$port_dns_over_http"
|
ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port_dns_over_tls" --value="$port_dns_over_tls"
|
||||||
ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port_dns_over_quic" --value="$port_dns_over_quic"
|
ynh_write_var_in_file --file="$install_dir/AdGuardHome.yaml" --key="port_dns_over_quic" --value="$port_dns_over_quic"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -95,9 +95,9 @@ fi
|
||||||
|
|
||||||
if [ "${dns_over_https:-}" = true ]; then
|
if [ "${dns_over_https:-}" = true ]; then
|
||||||
# if DoH and DoQ are closed
|
# if DoH and DoQ are closed
|
||||||
if ! yunohost firewall list | grep -q " $port_dns_over_http$" && ! yunohost firewall list | grep -q " $port_dns_over_quic$"; then
|
if ! yunohost firewall list | grep -q " $port_dns_over_tls$" && ! yunohost firewall list | grep -q " $port_dns_over_quic$"; then
|
||||||
ynh_print_info --message="Opening DoH and DoQ ports..."
|
ynh_print_info --message="Opening DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
||||||
else
|
else
|
||||||
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
# no need to open the ports, as they were opened at the 'Provisioning ports' step
|
||||||
|
@ -107,7 +107,7 @@ else
|
||||||
# if dns_over_https is false, we need to close ports,
|
# if dns_over_https is false, we need to close ports,
|
||||||
# as they were opened at the 'Provisioning ports' step
|
# as they were opened at the 'Provisioning ports' step
|
||||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_tls" --no-reload
|
||||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -141,9 +141,9 @@ ynh_add_systemd_config
|
||||||
|
|
||||||
# declare needs_exposed_ports according to real user need
|
# declare needs_exposed_ports according to real user need
|
||||||
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
if [ "$dns_over_https" == "true" ] && [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53" "$port_dns_over_tls"
|
||||||
elif [ "$dns_over_https" == "true" ]; then
|
elif [ "$dns_over_https" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_http"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "$port_dns_over_tls"
|
||||||
elif [ "$expose_port_53" == "true" ]; then
|
elif [ "$expose_port_53" == "true" ]; then
|
||||||
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
yunohost service add "$app" --description="Ads & trackers blocking DNS server" --needs_exposed_ports "53"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue