up adguardhome107.6

This commit is contained in:
SirPdboy 2022-05-14 21:43:47 +08:00 committed by GitHub
parent b99f644348
commit 80442c2862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 46 deletions

View File

@ -6,13 +6,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=adguardhome
PKG_VERSION:=0.108.0-b.4
PKG_VERSION:=0.107.6
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=89d9b03dfec8a5f1406507d45e582e852e748859
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/AdguardTeam/AdGuardHome
PKG_MIRROR_HASH:=skip
PKG_MIRROR_HASH:=6ad030cf8e47e35354b24cd6bdfce3afb9e26006a81a0596f11aaba8cfcc9e9b
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILES:=LICENSE.txt
@ -22,21 +22,19 @@ PKG_BUILD_DEPENDS:=golang/host node/host node-yarn/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_CONFIG_DEPENDS:=CONFIG_ADGUARDHOME_COMPRESS_GOPROXY
GO_PKG:=github.com/AdguardTeam/AdGuardHome
GO_PKG_BUILD_PKG:=github.com/AdguardTeam/AdGuardHome
AGH_BUILD_TIME:=$(shell date -d @$(SOURCE_DATE_EPOCH) +%FT%TZ%z)
AGH_VERSION_PKG:=github.com/AdguardTeam/AdGuardHome/internal/version
GO_PKG_LDFLAGS_X:=$(AGH_VERSION_PKG).channel=release \
$(AGH_VERSION_PKG).version=v$(PKG_VERSION) \
$(AGH_VERSION_PKG).version=$(PKG_SOURCE_VERSION) \
$(AGH_VERSION_PKG).buildtime=$(AGH_BUILD_TIME) \
$(AGH_VERSION_PKG).goarm=$(GO_ARM) \
$(AGH_VERSION_PKG).gomips=$(GO_MIPS)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
include ../../lang/golang/golang-package.mk
define Package/adguardhome
SECTION:=net
@ -55,17 +53,6 @@ define Package/adguardhome/description
Free and open source, powerful network-wide ads and trackers blocking DNS server.
endef
define Package/$(PKG_NAME)/config
config ADGUARDHOME_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
endef
ifeq ($(CONFIG_ADGUARDHOME_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.bj.bcebos.com
endif
define Build/Compile
( \
pushd $(PKG_BUILD_DIR) ; \

View File

@ -21,31 +21,29 @@ end
function get_template_config()
local b
local d=""
local file = "/tmp/resolv.conf.d/resolv.conf.auto"
if not fs.access(file) then
file = "/tmp/resolv.conf.auto"
for cnt in io.lines("/tmp/resolv.conf.d/resolv.conf.auto") do
b=string.match (cnt,"^[^#]*nameserver%s+([^%s]+)$")
if (b~=nil) then
d=d.." - "..b.."\n"
end
end
for cnt in io.lines(file) do
b = string.match(cnt, "^[^#]*nameserver%s+([^%s]+)$")
if (b ~= nil) then d = d .. " - " .. b .. "\n" end
end
local f = io.open("/usr/share/AdGuardHome/AdGuardHome_template.yaml", "r+")
local tbl = {}
local a = ""
while (1) do
a = f:read("*l")
if (a == "#bootstrap_dns") then
a = d
elseif (a == "#upstream_dns") then
a = d
elseif (a == nil) then
break
end
table.insert(tbl, a)
end
f:close()
http.prepare_content("text/plain; charset=utf-8")
http.write(table.concat(tbl, "\n"))
local f=io.open("/usr/share/AdGuardHome/AdGuardHome_template.yaml", "r+")
local tbl = {}
local a=""
while (1) do
a=f:read("*l")
if (a=="#bootstrap_dns") then
a=d
elseif (a=="#upstream_dns") then
a=d
elseif (a==nil) then
break
end
table.insert(tbl, a)
end
f:close()
http.prepare_content("text/plain; charset=utf-8")
http.write(table.concat(tbl, "\n"))
end
function reload_config()
fs.remove("/tmp/AdGuardHometmpconfig.yaml")

View File

@ -50,9 +50,7 @@ stop_forward_dnsmasq()
uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null
addrlist="`uci get dhcp.@dnsmasq[0].server 2>/dev/null`"
if [ -z "$addrlist" ] ; then
resolvfile="/tmp/resolv.conf.d/resolv.conf.auto"
[ ! -f "$resolvfile" ] && resolvfile="/tmp/resolv.conf.auto"
uci set dhcp.@dnsmasq[0].resolvfile="$resolvfile" 2>/dev/null
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null
uci delete dhcp.@dnsmasq[0].noresolv 2>/dev/null
fi
uci commit dhcp
@ -229,6 +227,9 @@ _do_redirect()
fi
config_get configpath $CONFIGURATION configpath "/etc/config/AdGuardHome.yaml"
AdGuardHome_PORT=$(config_editor "dns.port" "" "$configpath" "1")
if [ ! -s "$configpath" ]; then
cp -f /usr/share/AdGuardHome/AdGuardHome_template.yaml $configpath
fi
if [ -z "$AdGuardHome_PORT" ]; then
AdGuardHome_PORT="0"
fi

View File

@ -20,7 +20,7 @@ if [ ! -f "$configpath" ]; then
echo "please make a config first"
exit 1
fi
wget --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O- | base64 -d > /tmp/gfwlist.txt
wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O- | base64 -d > /tmp/gfwlist.txt
cat /tmp/gfwlist.txt | awk -v upst="$gfwupstream" 'BEGIN{getline;}{
s1=substr($0,1,1);
if (s1=="!")