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

user ressources in manifest to declare dot and doq ports

This commit is contained in:
OniriCorpe 2023-12-26 17:23:28 +01:00
parent 54aef3496a
commit bf81f58546
4 changed files with 6 additions and 25 deletions

View file

@ -76,8 +76,8 @@ tls:
server_name: "__DOMAIN__"
force_https: false
port_https: 443
port_dns_over_tls: __ADGUARD_DOT_PORT__
port_dns_over_quic: __ADGUARD_DOQ_PORT__
port_dns_over_tls: __PORT_DNS_OVER_HTTP__
port_dns_over_quic: __PORT_DNS_OVER_QUIC__
port_dnscrypt: 0
dnscrypt_config_file: ""
allow_unencrypted_doh: false

View file

@ -67,6 +67,10 @@ autoupdate.strategy = "latest_github_release"
[resources.ports]
adguard.default = 53
adguard.exposed = "Both"
dns_over_http.default = 853
dns_over_http.exposed = "Both"
dns_over_quic.default = 784
dns_over_quic.exposed = "TCP"
[resources.system_user]

View file

@ -14,19 +14,9 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2
# DNS over TLS
adguard_dot_port=ynh_find_port --port=853
ynh_app_setting_set --app="$app" --key=adguard_dot_port --value=$adguard_dot_port
# DNS over QUIC
adguard_doq_port=ynh_find_port --port=784
ynh_app_setting_set --app="$app" --key=adguard_doq_port --value=$adguard_doq_port
if [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_dot_port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $adguard_dot_port
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_doq_port
else
dns_over_https="false"
fi

View file

@ -29,23 +29,10 @@ ynh_systemd_action --service_name="$app" --action="stop"
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "$adguard_dot_port" ] || [ -z "$adguard_doq_port" ];
then
# DNS over TLS
adguard_dot_port=ynh_find_port --port=853
ynh_app_setting_set --app=$app --key=adguard_dot_port --value=$adguard_dot_port
# DNS over QUIC
adguard_doq_port=ynh_find_port --port=784
ynh_app_setting_set --app="$app" --key=adguard_doq_port --value=$adguard_doq_port
fi
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
ynh_app_setting_set --app="$app" --key=dns_over_https --value=$dns_over_https
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_dot_port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $adguard_dot_port
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $adguard_doq_port
elif [ -z "$dns_over_https" ] || [ "$dns_over_https" == "0" ];
then
dns_over_https="false"