Support DNS Over HTTPS

This commit is contained in:
Nick Peng
2019-03-30 20:10:27 +08:00
parent 5501bfb6a3
commit 2d01ed8a04
21 changed files with 1264 additions and 88 deletions

View File

@@ -5,6 +5,19 @@ chmod +x /etc/init.d/smartdns
mkdir -p /var/etc/smartdns/
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
if [ ! -f "/var/etc/smartdns/address.conf" ]; then
cp /etc/smartdns/address.conf /var/etc/smartdns/address.conf
fi
if [ ! -f "/var/etc/smartdns/blacklist-ip.conf" ]; then
cp /etc/smartdns/blacklist-ip.conf /var/etc/smartdns/blacklist-ip.conf
fi
if [ ! -f "/var/etc/smartdns/custom.conf" ]; then
cp /etc/smartdns/custom.conf /var/etc/smartdns/custom.conf
fi
. ${IPKG_INSTROOT}/lib/functions.sh
default_postinst $0 $@
ret=$?

View File

@@ -155,9 +155,11 @@ load_server()
SERVER="server-tcp"
elif [ "$type" = "tls" ]; then
SERVER="server-tls"
elif [ "$type" = "https" ]; then
SERVER="server-https"
fi
if [ ! -z "`echo $ip | grep ":"`" ]; then
if [ ! -z "`echo $ip | grep ":" | grep -v "https://"`" ]; then
if [ -z "`echo $ip | grep "\["`" ]; then
ip="[$ip]"
fi
@@ -185,6 +187,10 @@ load_server()
DNS_ADDRESS="$ip"
fi
if [ "$type" = "https" ]; then
DNS_ADDRESS="$ip"
fi
conf_append "$SERVER" "$DNS_ADDRESS $ADDITIONAL_ARGS $addition_arg"
}