Skip to content

Commit

Permalink
dcompass/aiodns/dnsproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
honwen committed Apr 16, 2021
1 parent 0a78624 commit b9bbcf5
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 18 deletions.
10 changes: 5 additions & 5 deletions aiodns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=aiodns
PKG_VERSION:=1.0.0
PKG_RELEASE:=20210327
PKG_VERSION:=20210415
PKG_RELEASE:=39287b4fe4
PKG_MAINTAINER:=honwen <https://github.com/honwen>

# OpenWrt ARCH: arm, aarch64, i386, x86_64, mips, mipsel
Expand All @@ -25,9 +25,9 @@ ifeq ($(ARCH),aarch64)
PKG_ARCH:=arm64
endif

PKG_SOURCE:=$(PKG_NAME)-linux-$(PKG_ARCH)-v$(PKG_RELEASE).tar.gz
PKG_SOURCE_URL:=https://github.com/honwen/aiodns/releases/download/v$(PKG_RELEASE)/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_RELEASE)
PKG_SOURCE:=$(PKG_NAME)-linux-$(PKG_ARCH)-v$(PKG_VERSION)@$(PKG_RELEASE).tar.gz
PKG_SOURCE_URL:=https://github.com/honwen/aiodns/releases/download/v$(PKG_VERSION)/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
PKG_HASH:=skip

include $(INCLUDE_DIR)/package.mk
Expand Down
3 changes: 3 additions & 0 deletions aiodns/files/aiodns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ config aiodns
option port 7100
option block_ipv6 1
option fastest_addr 0
list bypasslist '/etc/dnsmasq-extra.d/direct.gz'
list extralist '/etc/dnsmasq-extra.d/tldn.gz'
list extralist '/etc/dnsmasq-extra.d/gfwlist.gz'
list extralist 'https://raw.sevencdn.com/Loyalsoldier/v2ray-rules-dat/release/greatfire.txt'

# list bypasslist 'https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/ns-whitelist.txt'
# list bypasslist 'https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf'
# list extralist 'https://raw.githubusercontent.com/honwen/openwrt-dnsmasq-extra/master/dnsmasq-extra/files/data/tldn.gz'
# list extralist 'https://raw.githubusercontent.com/honwen/openwrt-dnsmasq-extra/master/dnsmasq-extra/files/data/gfwlist.gz'

Expand Down
3 changes: 2 additions & 1 deletion aiodns/files/aiodns.init
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ start_service() {
local fallback=$(for it in $(uci_get_by_type $NAME fallback); do echo -n "-f=$it "; done)
local bootstrap=$(for it in $(uci_get_by_type $NAME bootstrap); do echo -n "-b=$it "; done)
local extralist=$(for it in $(uci_get_by_type $NAME extralist); do echo -n "-L=$it "; done)
local bypasslist=$(for it in $(uci_get_by_type $NAME bypasslist); do echo -n "-B=$it "; done)

start_instance /usr/bin/$NAME ${args} ${upstream} ${special} ${fallback} ${bootstrap} ${extralist}
start_instance /usr/bin/$NAME ${args} ${upstream} ${special} ${fallback} ${bootstrap} ${extralist} ${bypasslist}
}

stop_service() {
Expand Down
6 changes: 3 additions & 3 deletions dcompass/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=dcompass
PKG_VERSION:=20210327
PKG_RELEASE:=0926
PKG_VERSION:=20210416
PKG_RELEASE:=0928
PKG_MAINTAINER:=honwen <https://github.com/honwen>

# OpenWrt ARCH: arm, aarch64, i386, x86_64, mips, mipsel
Expand All @@ -22,7 +22,7 @@ ifeq ($(ARCH),aarch64)
PKG_ARCH:=aarch64-unknown-linux-musleabihf
endif

PKG_SOURCE:=dcompass-$(PKG_ARCH)-min
PKG_SOURCE:=dcompass-$(PKG_ARCH)
PKG_SOURCE_URL:=https://github.com/LEXUGE/dcompass/releases/download/build-$(PKG_VERSION)_$(PKG_RELEASE)/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_ARCH)-$(PKG_VERSION)_$(PKG_RELEASE)
PKG_HASH:=skip
Expand Down
61 changes: 57 additions & 4 deletions dcompass/files/dcompass.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ config dcompass
option enable 1
option port 7500
option block_ipv6 1
list oversea ytimg.com
list oversea youtube.com
list oversea 1e100.net
list oversea gvt1.com
list oversea gvt2.com
list oversea ggpht.com
list oversea google.com
list oversea gstatic.com
list oversea googleapis.com
list oversea googlevideo.com
list oversea googleusercontent.com
list oversea googlesyndication.com
list oversea g.cn
list oversea gkecnapps.cn
list oversea googleapis.cn
list oversea googlecnapps.cn
list oversea gstaticcnapps.cn
list oversea googleadsserving.cn

config secure
option alias googleDoH
Expand Down Expand Up @@ -46,6 +64,41 @@ config secure
option name cloudflare-dns.com
option addr 1.1.1.1:853

config oversea
option alias opendnsDoH
option type https
option no_sni on
option name doh.opendns.com
option addr 146.112.41.2:443

config oversea
option alias adguardDoH
option type https
option no_sni on
option name dns.adguard.com
option addr 94.140.15.15:443

config oversea
option alias quad101DoH
option type https
option no_sni on
option name dns.twnic.tw
option addr 101.102.103.104:443

config oversea
option alias adguardDoT
option type tls
option no_sni on
option name dns.adguard.com
option addr 94.140.14.14:853

config oversea
option alias quad101DoT
option type tls
option no_sni on
option name dns.twnic.tw
option addr 101.101.101.101:853

config domestic
option alias dnspodDoH
option type https
Expand All @@ -57,19 +110,19 @@ config domestic
option alias aliDoH
option type https
option no_sni off
option name ddns.alidns.com
option name dns.alidns.com
option addr 223.5.5.5:443

config domestic
option alias dnspodDoT
option type tls
option no_sni off
option name doh.pub
option addr 162.14.21.178:443
option addr 162.14.21.178:853

config domestic
option alias aliDoT
option type tls
option no_sni off
option name ddns.alidns.com
option addr 223.6.6.6:443
option name dns.alidns.com
option addr 223.6.6.6:853
26 changes: 23 additions & 3 deletions dcompass/files/dcompass.init
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,48 @@ $(uci_get_by_name $1 alias):
EOF
}

gen_secure_matcher(){
[ -f /etc/dnsmasq-extra.d/chnroute.txt ] && {
echo -e "ipcidr:\n- /etc/dnsmasq-extra.d/chnroute.txt"
} || {
echo -e "geoip:\n codes:\n - CN"
}
}

start_service() {
uci_bool_by_type $NAME enable || exit 0
add_cron
config_load $NAME

cat <<-EOF | sed 's+ *$++g' > "/var/etc/${NAME}.yaml"
# $(date)
---
verbosity: $(uci_get_by_type $NAME verbosity warn)
address: 0.0.0.0:$(uci_get_by_type $NAME port 7500)
table:
$(gen_table_head)
if: any
if:
domain:
$(for it in $(uci_get_by_type $NAME oversea); do echo " - qname: $it"; done)
then:
- query: oversea
- end
else:
- query: domestic
- check_secure
check_secure:
if:
ipcidr:
- /etc/dnsmasq-extra.d/chnroute.txt
$(gen_secure_matcher | sed 's+^+ +g' )
else:
- query: secure
- end
upstreams:
$( config_foreach gen_upstreams domestic | sed 's+^+ +g' )
$( config_foreach gen_upstreams secure | sed 's+^+ +g' )
$( config_foreach gen_upstreams oversea | sed 's+^+ +g' )
# ------------ FINAL -------------
domestic:
hybrid:
Expand All @@ -106,6 +121,11 @@ $( config_foreach uci_get_by_name domestic alias | sed 's+^+ - +g' )
secure:
hybrid:
$( config_foreach uci_get_by_name secure alias | sed 's+^+ - +g' )
$( config_foreach uci_get_by_name oversea alias | sed 's+^+ - +g' )
oversea:
hybrid:
$( config_foreach uci_get_by_name oversea alias | sed 's+^+ - +g' )
EOF

start_instance /usr/bin/$NAME -c /var/etc/$NAME.yaml
Expand Down
4 changes: 2 additions & 2 deletions dnsproxy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=dnsproxy
PKG_VERSION:=2021-03-19
PKG_RELEASE:=0.36.0
PKG_VERSION:=2021-04-15
PKG_RELEASE:=0.37.1
PKG_MAINTAINER:=honwen <https://github.com/honwen>

# OpenWrt ARCH: arm, aarch64, i386, x86_64, mips, mipsel
Expand Down

0 comments on commit b9bbcf5

Please sign in to comment.