Browse Source

Merge pull request #18363 from stangri/openwrt-22.03-https-dns-proxy

[22.03] https-dns-proxy: 2021-11-22-3: add support for Canary Domains
lilik-openwrt-22.03
Stan Grishin 3 years ago
committed by GitHub
parent
commit
646e539d8f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions
  1. +1
    -1
      net/https-dns-proxy/Makefile
  2. +7
    -1
      net/https-dns-proxy/files/https-dns-proxy.init

+ 1
- 1
net/https-dns-proxy/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=https-dns-proxy PKG_NAME:=https-dns-proxy
PKG_VERSION:=2021-11-22 PKG_VERSION:=2021-11-22
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/ PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/


+ 7
- 1
net/https-dns-proxy/files/https-dns-proxy.init View File

@ -22,6 +22,7 @@ readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m'
readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m' readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m'
readonly PROG=/usr/sbin/https-dns-proxy readonly PROG=/usr/sbin/https-dns-proxy
readonly DEFAULT_BOOTSTRAP='1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844' readonly DEFAULT_BOOTSTRAP='1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844'
readonly canaryDomains='use-application-dns.net'
dnsmasqConfig=''; forceDNS=''; forceDNSPorts=''; dnsmasqConfig=''; forceDNS=''; forceDNSPorts='';
str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; } str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
@ -171,7 +172,6 @@ start_instance() {
procd_close_instance procd_close_instance
if [ "$?" ]; then if [ "$?" ]; then
forceDNS=0
config_get listen_addr "$cfg" 'listen_addr' '127.0.0.1' config_get listen_addr "$cfg" 'listen_addr' '127.0.0.1'
config_get listen_port "$cfg" 'listen_port' "$port" config_get listen_port "$cfg" 'listen_port' "$port"
if [ "$dnsmasqConfig" = '*' ]; then if [ "$dnsmasqConfig" = '*' ]; then
@ -188,6 +188,7 @@ start_instance() {
fi fi
output_ok output_ok
port="$((port+1))" port="$((port+1))"
forceDNS=0
else else
output_fail output_fail
fi fi
@ -244,6 +245,11 @@ dnsmasq_doh_server() {
local cfg="$1" param="$2" address="${3:-127.0.0.1}" port="$4" i local cfg="$1" param="$2" address="${3:-127.0.0.1}" port="$4" i
case "$param" in case "$param" in
add) add)
if [ "$forceDNS" -ne 0 ]; then
for i in $canaryDomains; do
uci_add_list_if_new "dhcp.${cfg}.server" "/${i}/"
done
fi
case $address in case $address in
0.0.0.0|::ffff:0.0.0.0) address='127.0.0.1';; 0.0.0.0|::ffff:0.0.0.0) address='127.0.0.1';;
::) address='::1';; ::) address='::1';;


Loading…
Cancel
Save