1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-18 18:51:16 +08:00

update-09.24

This commit is contained in:
github-actions[bot]
2021-09-24 19:49:47 +08:00
parent 16f9709c7d
commit 35ccfc35db
55 changed files with 1049 additions and 1110 deletions

View File

@ -13,7 +13,7 @@ PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/txthinking/brook/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=92c2253349af05ea5aa7a45cddd39ca638c732b2ffdb5066a5f03d2df40cb0b5
PKG_HASH:=skip
PKG_MAINTAINER:=CN_SZTL <cnsztl@immortalwrt.org>
PKG_LICENSE:=GPL-3.0

View File

@ -6,7 +6,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng.git
PKG_MIRROR_HASH:=3b66fc0888d9488e3b8e39df3016d51fae1b43325d292381e94aa3c7d2318282
PKG_MIRROR_HASH:=skip
PKG_SOURCE_VERSION:=14cc6348d67b09cae37d9bce554c89c2c0e0b265
PKG_BUILD_PARALLEL:=1

View File

@ -7,7 +7,7 @@ PKG_RELEASE:=20200218
PKG_SOURCE:=SourceCode.zip
PKG_SOURCE_SUBDIR:=DNS2SOCKS
PKG_SOURCE_URL:=@SF/dns2socks
PKG_MD5SUM:=ec82de936ad004cc940502cd2a1bff5b
PKG_MD5SUM:=skip
PKG_MAINTAINER:=ghostmaker
PKG_LICENSE:=BSD-3-Clause

View File

@ -11,7 +11,7 @@ PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/HyNetwork/hysteria/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=8f1945eb36dba8ebc47e3f68af4ba421f65ca119cc0c54d552f59228ee824e89
PKG_HASH:=skip
PKG_CONFIG_DEPENDS:= \
CONFIG_HYSTERIA_COMPRESS_GOPROXY \

View File

@ -13,7 +13,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/ipt2socks.git
PKG_MIRROR_HASH:=914465049c065c9fd21a6eabb96418acf134f2b6f0a1b861d5987ae0d10da83a
PKG_MIRROR_HASH:=skip
PKG_SOURCE_VERSION:=384dab4bae5ed9402e07ec1950e502c05812bc26
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

View File

@ -13,7 +13,7 @@ PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/xtaci/kcptun/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=3f39eb2e6ee597751888b710afc83147b429c232591e91bc97565b32895f33a8
PKG_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.md

View File

@ -13,7 +13,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/fabled/lua-maxminddb.git
PKG_SOURCE_DATE:=2019-03-14
PKG_SOURCE_VERSION:=93da9f4e6c814c3a23044dd2cdd22d4a6b4f665b
PKG_MIRROR_HASH:=b99ef18516b705b3e73b15a9d5ddc99add359299b52639fe3c81dd761591d9d9
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILE:=LICENSE

View File

@ -1,30 +1,47 @@
# Copyright (C) 2018-2019 Lienol
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-adguardhome
PKG_MAINTAINER:=<https://github.com/rufengsuixing/luci-app-adguardhome>
PKG_RELEASE:=15
LUCI_TITLE:=LuCI app for AdGuardHome
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+ca-certs +curl +wget-ssl +PACKAGE_$(PKG_NAME)_INCLUDE_binary:adguardhome
LUCI_DESCRIPTION:=LuCI support for AdGuardHome
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
define Package/$(PKG_NAME)/config
config PACKAGE_$(PKG_NAME)_INCLUDE_binary
bool "Include Binary File"
default y
include $(INCLUDE_DIR)/package.mk
define Package/luci-app-adguardhome
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LuCI app for adguardhome
PKG_MAINTAINER:=<https://github.com/rufengsuixing/luci-app-adguardhome>
PKGARCH:=all
DEPENDS:=+!wget-ssl&&!curl:wget-ssl
endef
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_binary
define Package/luci-app-adguardhome/description
LuCI support for adguardhome
endef
define Build/Prepare
endef
define Build/Compile
endef
define Package/luci-app-adguardhome/conffiles
/usr/share/AdGuardHome/links.txt
/etc/config/AdGuardHome
/etc/AdGuardHome.yaml
endef
define Package/luci-app-adguardhome/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
$(INSTALL_DIR) $(1)/
cp -pR ./root/* $(1)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
po2lmo ./po/zh-cn/AdGuardHome.po $(1)/usr/lib/lua/luci/i18n/AdGuardHome.zh-cn.lmo
endef
define Package/luci-app-adguardhome/postinst
@ -52,6 +69,4 @@ fi
exit 0
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
$(eval $(call BuildPackage,luci-app-adguardhome))

View File

@ -0,0 +1,93 @@
# luci-app-adguardhome
复杂的AdGuardHome的openwrt的luci界面
- 可以管理网页端口
- luci下载/更新核心版本(支持自定义链接下载)
- 如果为tar.gz文件需要与官方的文件结构一致
- 或者直接为主程序二进制
- upx 压缩核心xz依赖脚本自动下载如果opkg源无法连接请在编译时加入此包
- dns重定向
- 作为dnsmasq的上游服务器(在AGH中统计到的ip都为127.0.0.1无法统计客户端及对应调整设置ssr-plus正常)
- 重定向53端口到 AdGuardHomeipv6需要开启ipv6 nat redirect 否则如果客户端使用ipv6过滤无效不以dnsmasq为上游ssr-plus失效
- 使用53端口替换 dnsmasq(需要设置AGH的dnsip为0.0.0.0, AGH和dnsmasq的端口将被交换不以dnsmasq为上游ssr-plus失效)
- 自定义执行文件路径支持tmp每次重启后自动下载bin
- 自定义配置文件路径
- 自定义工作路径
- 自定义运行日志路径
- gfwlist 删除/添加/定义上游dns服务器 另外安利一下https://github.com/rufengsuixing/luci-app-autoipsetadder
- 修改网页登陆密码
- 倒序/正序 查看/删除/备份 每3秒更新显示运行日志 + 本地浏览器时区转换
- 手动修改配置文件
- 支持yaml编辑器
- 模板快速配置
- 系统升级保留勾选文件
- 开机启动后当网络准备好时重启adh(3分钟超时主要用于防止过滤器更新失败)
- 关机时备份勾选的工作目录中的文件须知在ipk更新的时候也会触发备份
- 计划任务(以下为默认值,时间和参数可以在计划任务中调整)
- 自动更新核心(最好谨慎使用)(3:30/天)
- 自动截短查询日志 (每小时 限制到2000行)
- 自动截短运行日志3:30/天 限制到2000行
- 自动更新ipv6主机并重启adh (每小时,无更新不重启)
- 自动更新gfw列表并重启adh 3:30/天,无更新不重启)
#### 已知问题:
- db数据库不支持放在不支持mmap的文件系统上比如 jffs2 data-stk-oo请修改工作目录本软件如果检测到jffs2会自动ln(软连接)到/tmp将会导致重启丢失dns数据库
- AdGuardHome 不支持ipset 设置在使用ipset的情况下无法替代dnsmasq只能作为dnsmasq上游存在如果你想要这个功能就去投票吧<br>
https://github.com/AdguardTeam/AdGuardHome/issues/1191
- 反馈出现大量127.0.0.1查询了localhost的请求问题出现原因是ddns插件如果不用ddns插件请删除或者注释掉\etc\hotplug.d\iface\95-ddns的内容如果还有其他来自本机的异常查询情况高级玩家可以使用kmod来查找原因https://github.com/rufengsuixing/kmod-plog-port
- 如果出现需要多次提交才有反应的现象请及时提交issue
#### 使用方法
- 下载release使用opkg安装即可
- 或者编译op时clone本项目加入软件包并勾选
#### 关于压缩
本着较真的想法我测试了在jffs2的压缩文件系统上进行upx压缩结果的内存占用与空间占用(单位kb使用最好压缩)<br>
文件大小<br>
源文件 14112 使用upx 压缩后 5309 <br>
实际占用 6260 使用upx 压缩后 5324 差值为 936<br>
VmRSS运存占用值<br>
不压缩 14380 使用upx 压缩后 18496 差值 -4116 <br>
对于压缩文件系统来说开启收益有,但不大<br>
如果是非压缩文件系统,性价比还是比较高的<br>
所以压缩是用运存空间来换rom空间觉得值得就可以开启
#### 关于ssr配合
- 方法一gfw代理dns重定向-作为dnsmasq的上游服务器
- 方法二gfw代理手动设置adh上游dns为自己即127.0.0.1:[自己监听的端口],然后使用 dns重定向-使用53端口替换dnsmasq因为端口互换后就是dnsmasq为上游了
- 方法三国外ip代理任意重定向方式adh加入gfw列表开启计划任务定时更新gfw即可
- 方法四gfw代理dns重定向-重定向53端口到AdGuardHome,设置adh上游dns 为127.0.0.1:53
#### 项目已经基本稳定有bug欢迎主动反馈
Complex openwrt AdGuardHome luci
- can manage browser port
- download/update core in luci
- compress core with upx
- redirect dns
- as the upstream of dnsmasq
- redirect port 53 to AdGuardHomeipv6 need to install ipv6 nat redirect or if client use ipv6 redirect is invalid
- replace dnsmasq with port 53 (need to set AGH,dnsip=0.0.0.0,the port of dnsmasq and AGH will be exchange)
- change bin path
- change config path
- change work dir(support tmp,auto redownload after reboot)
- change runtime log path
- gfwlist query to specific dns server
- modify browser login passord
- Positive/reverse order see/del/backup runtime log which update every 3 second
- modify config manually(support yaml editor)
- use template to fast config(when no config file)
- Keep bin file and config when system upgrade (database and querylog can be choose)
- when boot wait for network access 3min timeout
- backup workdir when shutdown
#### known issues:
- db database not support filesystem which not support mmap such as jffs2 and data-stk-oo,please modify work dir,if jffs2 is found,will auto ln (soft link)the dbs to /tmp ,will lost dns database after reboot
- AdGuardhome not support ipset,when we use ipset ,it can\`t be the repacement of dnsmasq but the upstream of dnsmasq ,if you want it,vote for it.<br>
https://github.com/AdguardTeam/AdGuardHome/issues/1191<br>
- find so many localhost query from 127.0.0.1,the ddns plugin is the reason,if you don\`t use ddns, please remove or comment \etc\hotplug.d\iface\95-ddns
#### usage
- download releaseinstall it with opkg
- or when make op,clone the code to the package path and set it as y or m
#### pic
example in zh-cn:<br>
![Screenshot_2019-12-23 newifi-d1 - 基础设置 - LuCI](https://user-images.githubusercontent.com/22387141/71361626-81d60900-25ce-11ea-91d5-ac4e35d5c41e.png)
![图片](https://user-images.githubusercontent.com/22387141/71361650-90242500-25ce-11ea-9727-9306a3da1357.png)
![Screenshot_2019-12-23 newifi-d1 - 日志 - LuCI(1)](https://user-images.githubusercontent.com/22387141/71361700-b944b580-25ce-11ea-8562-f68c28952b2b.png)
![Screenshot_2019-12-23 newifi-d1 - 手动设置 - LuCI](https://user-images.githubusercontent.com/22387141/71361704-bb0e7900-25ce-11ea-8042-6dd396607030.png)

View File

@ -1,130 +1,130 @@
module("luci.controller.AdGuardHome",package.seeall)
local fs=require"nixio.fs"
local http=require"luci.http"
local uci=require"luci.model.uci".cursor()
module("luci.controller.AdGuardHome", package.seeall)
local fs = require "nixio.fs"
local http = require "luci.http"
local uci = require"luci.model.uci".cursor()
function index()
local page = entry({"admin", "services", "AdGuardHome"},alias("admin", "services", "AdGuardHome", "base"),_("AdGuard Home"))
page.order = 10
page.dependent = true
page.acl_depends = { "luci-app-adguardhome" }
entry({"admin","services","AdGuardHome","base"},cbi("AdGuardHome/base"),_("Base Setting"),1).leaf = true
entry({"admin","services","AdGuardHome","log"},form("AdGuardHome/log"),_("Log"),2).leaf = true
entry({"admin","services","AdGuardHome","manual"},cbi("AdGuardHome/manual"),_("Manual Config"),3).leaf = true
entry({"admin","services","AdGuardHome","status"},call("act_status")).leaf=true
entry({"admin", "services", "AdGuardHome", "check"}, call("check_update"))
entry({"admin", "services", "AdGuardHome", "doupdate"}, call("do_update"))
entry({"admin", "services", "AdGuardHome", "getlog"}, call("get_log"))
entry({"admin", "services", "AdGuardHome", "dodellog"}, call("do_dellog"))
entry({"admin", "services", "AdGuardHome", "reloadconfig"}, call("reload_config"))
entry({"admin", "services", "AdGuardHome", "gettemplateconfig"}, call("get_template_config"))
entry({"admin", "services", "AdGuardHome"}, alias("admin", "services", "AdGuardHome", "base"), _("AdGuard Home"), 10).dependent = true
entry({"admin", "services", "AdGuardHome", "base"}, cbi("AdGuardHome/base"), _("Base Setting"), 1).leaf = true
entry({"admin", "services", "AdGuardHome", "log"}, form("AdGuardHome/log"), _("Log"), 2).leaf = true
entry({"admin", "services", "AdGuardHome", "manual"}, cbi("AdGuardHome/manual"), _("Manual Config"), 3).leaf = true
entry({"admin", "services", "AdGuardHome", "status"}, call("act_status")).leaf = true
entry({"admin", "services", "AdGuardHome", "check"}, call("check_update"))
entry({"admin", "services", "AdGuardHome", "doupdate"}, call("do_update"))
entry({"admin", "services", "AdGuardHome", "getlog"}, call("get_log"))
entry({"admin", "services", "AdGuardHome", "dodellog"}, call("do_dellog"))
entry({"admin", "services", "AdGuardHome", "reloadconfig"}, call("reload_config"))
entry({"admin", "services", "AdGuardHome", "gettemplateconfig"}, call("get_template_config"))
end
function get_template_config()
local b
local d=""
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
local b
local d = ""
local file = "/tmp/resolv.conf.d/resolv.conf.auto"
if not fs.access(file) then
file = "/tmp/resolv.conf.auto"
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"))
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"))
end
function reload_config()
fs.remove("/tmp/AdGuardHometmpconfig.yaml")
http.prepare_content("application/json")
http.write('')
fs.remove("/tmp/AdGuardHometmpconfig.yaml")
http.prepare_content("application/json")
http.write('')
end
function act_status()
local e={}
local binpath=uci:get("AdGuardHome","AdGuardHome","binpath")
e.running=luci.sys.call("pgrep "..binpath.." >/dev/null")==0
e.redirect=(fs.readfile("/var/run/AdGredir")=="1")
http.prepare_content("application/json")
http.write_json(e)
local e = {}
local binpath = uci:get("AdGuardHome", "AdGuardHome", "binpath")
e.running = luci.sys.call("pgrep " .. binpath .. " >/dev/null") == 0
e.redirect = (fs.readfile("/var/run/AdGredir") == "1")
http.prepare_content("application/json")
http.write_json(e)
end
function do_update()
fs.writefile("/var/run/lucilogpos","0")
http.prepare_content("application/json")
http.write('')
local arg
if luci.http.formvalue("force") == "1" then
arg="force"
else
arg=""
end
if fs.access("/var/run/update_core") then
if arg=="force" then
luci.sys.exec("kill $(pgrep /usr/share/AdGuardHome/update_core.sh) ; sh /usr/share/AdGuardHome/update_core.sh "..arg.." >/tmp/AdGuardHome_update.log 2>&1 &")
end
else
luci.sys.exec("sh /usr/share/AdGuardHome/update_core.sh "..arg.." >/tmp/AdGuardHome_update.log 2>&1 &")
end
fs.writefile("/var/run/lucilogpos", "0")
http.prepare_content("application/json")
http.write('')
local arg
if luci.http.formvalue("force") == "1" then
arg = "force"
else
arg = ""
end
if fs.access("/var/run/update_core") then
if arg == "force" then
luci.sys.exec("kill $(pgrep /usr/share/AdGuardHome/update_core.sh) ; sh /usr/share/AdGuardHome/update_core.sh " .. arg .. " >/tmp/AdGuardHome_update.log 2>&1 &")
end
else
luci.sys.exec("sh /usr/share/AdGuardHome/update_core.sh " .. arg .. " >/tmp/AdGuardHome_update.log 2>&1 &")
end
end
function get_log()
local logfile=uci:get("AdGuardHome","AdGuardHome","logfile")
if (logfile==nil) then
http.write("no log available\n")
return
elseif (logfile=="syslog") then
if not fs.access("/var/run/AdGuardHomesyslog") then
luci.sys.exec("(/usr/share/AdGuardHome/getsyslog.sh &); sleep 1;")
end
logfile="/tmp/AdGuardHometmp.log"
fs.writefile("/var/run/AdGuardHomesyslog","1")
elseif not fs.access(logfile) then
http.write("")
return
end
http.prepare_content("text/plain; charset=utf-8")
local fdp
if fs.access("/var/run/lucilogreload") then
fdp=0
fs.remove("/var/run/lucilogreload")
else
fdp=tonumber(fs.readfile("/var/run/lucilogpos")) or 0
end
local f=io.open(logfile, "r+")
f:seek("set",fdp)
local a=f:read(2048000) or ""
fdp=f:seek()
fs.writefile("/var/run/lucilogpos",tostring(fdp))
f:close()
http.write(a)
local logfile = uci:get("AdGuardHome", "AdGuardHome", "logfile")
if (logfile == nil) then
http.write("no log available\n")
return
elseif (logfile == "syslog") then
if not fs.access("/var/run/AdGuardHomesyslog") then
luci.sys.exec("(/usr/share/AdGuardHome/getsyslog.sh &); sleep 1;")
end
logfile = "/tmp/AdGuardHometmp.log"
fs.writefile("/var/run/AdGuardHomesyslog", "1")
elseif not fs.access(logfile) then
http.write("")
return
end
http.prepare_content("text/plain; charset=utf-8")
local fdp = tonumber(fs.readfile("/var/run/lucilogpos")) or 0
local f = io.open(logfile, "r+")
f:seek("set", fdp)
local a = f:read(2048000) or ""
fdp = f:seek()
fs.writefile("/var/run/lucilogpos", tostring(fdp))
f:close()
http.write(a)
end
function do_dellog()
local logfile=uci:get("AdGuardHome","AdGuardHome","logfile")
fs.writefile(logfile,"")
http.prepare_content("application/json")
http.write('')
local logfile = uci:get("AdGuardHome", "AdGuardHome", "logfile")
fs.writefile(logfile, "")
http.prepare_content("application/json")
http.write('')
end
function check_update()
http.prepare_content("text/plain; charset=utf-8")
local fdp=tonumber(fs.readfile("/var/run/lucilogpos")) or 0
local f=io.open("/tmp/AdGuardHome_update.log", "r+")
f:seek("set",fdp)
local a=f:read(2048000) or ""
fdp=f:seek()
fs.writefile("/var/run/lucilogpos",tostring(fdp))
f:close()
if fs.access("/var/run/update_core") then
http.write(a)
else
http.write(a.."\0")
end
http.prepare_content("text/plain; charset=utf-8")
local fdp = tonumber(fs.readfile("/var/run/lucilogpos")) or 0
local f = io.open("/tmp/AdGuardHome_update.log", "r+")
f:seek("set", fdp)
local a = f:read(2048000) or ""
fdp = f:seek()
fs.writefile("/var/run/lucilogpos", tostring(fdp))
f:close()
if fs.access("/var/run/update_core") then
http.write(a)
else
http.write(a .. "\0")
end
end

View File

@ -1,89 +1,94 @@
require("luci.sys")
require("luci.util")
require("io")
local m,s,o,o1
local fs=require"nixio.fs"
local uci=require"luci.model.uci".cursor()
local configpath=uci:get("AdGuardHome","AdGuardHome","configpath") or "/etc/AdGuardHome.yaml"
local binpath=uci:get("AdGuardHome","AdGuardHome","binpath") or "/usr/bin/AdGuardHome"
httpport=uci:get("AdGuardHome","AdGuardHome","httpport") or "3000"
local m, s, o, o1
local fs = require "nixio.fs"
local uci = require"luci.model.uci".cursor()
local configpath = uci:get("AdGuardHome", "AdGuardHome", "configpath") or "/etc/config/AdGuardHome.yaml"
local binpath = uci:get("AdGuardHome", "AdGuardHome", "binpath") or "/usr/bin/AdGuardHome/AdGuardHome"
httpport = uci:get("AdGuardHome", "AdGuardHome", "httpport") or "3000"
m = Map("AdGuardHome", "AdGuard Home")
m.description = translate("Free and open source, powerful network-wide ads & trackers blocking DNS server.")
m:section(SimpleSection).template = "AdGuardHome/AdGuardHome_status"
m:section(SimpleSection).template = "AdGuardHome/AdGuardHome_status"
s = m:section(TypedSection, "AdGuardHome")
s.anonymous=true
s.addremove=false
s.anonymous = true
s.addremove = false
---- enable
o = s:option(Flag, "enabled", translate("Enable"))
o.default = 0
o.optional = false
---- httpport
o =s:option(Value,"httpport",translate("Browser management port"))
o.placeholder=3000
o.default=3000
o.datatype="port"
o = s:option(Value, "httpport", translate("Browser management port"))
o.placeholder = 3000
o.default = 3000
o.datatype = "port"
o.optional = false
o.description = translate("<input type=\"button\" style=\"width:210px;border-color:Teal; text-align:center;font-weight:bold;color:Green;\" value=\"AdGuardHome Web:"..httpport.."\" onclick=\"window.open('http://'+window.location.hostname+':"..httpport.."/')\"/>")
o.description = translate("<input type='button' style='width:210px; border-color:Teal; text-align:center; font-weight:bold;color:Green;' value='AdGuardHome Web:" .. httpport .. "' onclick=\"window.open('http://'+window.location.hostname+':" .. httpport .. "')\"/>")
---- update warning not safe
local binmtime=uci:get("AdGuardHome","AdGuardHome","binmtime") or "0"
local e=""
if not fs.access(configpath) then
e=e.." "..translate("no config")
end
local binmtime = uci:get("AdGuardHome", "AdGuardHome", "binmtime") or "0"
local e = ""
if not fs.access(configpath) then e = e .. " " .. translate("no config") end
if not fs.access(binpath) then
e=e.." "..translate("no core")
e = e .. " " .. translate("no core")
else
local version=uci:get("AdGuardHome","AdGuardHome","version")
local testtime=fs.stat(binpath,"mtime")
if testtime~=tonumber(binmtime) or version==nil then
local tmp=luci.sys.exec(binpath.." --version | grep -m 1 -E 'v[0-9.]+' -o ")
version=string.sub(tmp, 1)
if version=="" then version="core error" end
uci:set("AdGuardHome","AdGuardHome","version",version)
uci:set("AdGuardHome","AdGuardHome","binmtime",testtime)
uci:save("AdGuardHome")
end
e=version..e
local version = uci:get("AdGuardHome", "AdGuardHome", "version")
local testtime = fs.stat(binpath, "mtime")
if testtime ~= tonumber(binmtime) or version == nil then
-- local tmp=luci.sys.exec(binpath.." -c /dev/null --check-config 2>&1| grep -m 1 -E 'v[0-9.]+' -o")
-- version=string.sub(tmp, 1, -2)
version = luci.sys.exec(string.format("echo -n $(%s --version 2>&1 | awk -F 'version ' '{print $2}' | awk -F ',' '{print $1}')", binpath))
if version == "" then version = "core error" end
uci:set("AdGuardHome", "AdGuardHome", "version", version)
uci:set("AdGuardHome", "AdGuardHome", "binmtime", testtime)
uci:commit("AdGuardHome")
end
e = version .. e
end
o=s:option(Button,"restart",translate("Update"))
o.inputtitle=translate("Update core version")
o = s:option(Button, "restart", translate("Update"))
o.inputtitle = translate("Update core version")
o.template = "AdGuardHome/AdGuardHome_check"
o.showfastconfig=(not fs.access(configpath))
o.description=string.format(translate("core version:").."<strong><font id=\"updateversion\" color=\"green\">%s </font></strong>",e)
o.showfastconfig = (not fs.access(configpath))
o.description = string.format(translate("core version:") .. "<strong><font id='updateversion' color='green'>%s </font></strong>", e)
---- port warning not safe
local port=luci.sys.exec("awk '/ port:/{printf($2);exit;}' "..configpath.." 2>nul")
if (port=="") then port="?" end
local port = luci.sys.exec("awk '/ port:/{printf($2);exit;}' " .. configpath .. " 2>nul")
if (port == "") then port = "?" end
---- Redirect
o = s:option(ListValue, "redirect", port..translate("Redirect"), translate("AdGuardHome redirect mode"))
o = s:option(ListValue, "redirect", port .. translate("Redirect"), translate("AdGuardHome redirect mode"))
o.placeholder = "none"
o:value("none", translate("none"))
o:value("dnsmasq-upstream", translate("Run as dnsmasq upstream server"))
o:value("redirect", translate("Redirect 53 port to AdGuardHome"))
o:value("exchange", translate("Use port 53 replace dnsmasq"))
o.default = "none"
o.default = "none"
o.optional = true
---- bin path
o = s:option(Value, "binpath", translate("Bin Path"), translate("AdGuardHome Bin path if no bin will auto download"))
o.default = "/usr/bin/AdGuardHome"
o.datatype = "string"
o.default = "/usr/bin/AdGuardHome/AdGuardHome"
o.datatype = "string"
o.optional = false
o.rmempty=false
o.validate=function(self, value)
if value=="" then return nil end
if fs.stat(value,"type")=="dir" then
fs.rmdir(value)
end
if fs.stat(value,"type")=="dir" then
if (m.message) then
m.message =m.message.."\nerror!bin path is a dir"
else
m.message ="error!bin path is a dir"
end
return nil
end
return value
o.rmempty = false
o.validate = function(self, value)
if value == "" then return nil end
if fs.stat(value, "type") == "dir" then fs.rmdir(value) end
if fs.stat(value, "type") == "dir" then
if (m.message) then
m.message = m.message .. "\nerror!bin path is a dir"
else
m.message = "error!bin path is a dir"
end
return nil
end
return value
end
--- upx
o = s:option(ListValue, "upxflag", translate("use upx to compress bin after download"))
o:value("", translate("none"))
@ -92,213 +97,220 @@ o:value("-9", translate("compress better"))
o:value("--best", translate("compress best(can be slow for big files)"))
o:value("--brute", translate("try all available compression methods & filters [slow]"))
o:value("--ultra-brute", translate("try even more compression variants [very slow]"))
o.default = ""
o.description=translate("bin use less space,but may have compatibility issues")
o.default = ""
o.description = translate("bin use less space,but may have compatibility issues")
o.rmempty = true
---- config path
o = s:option(Value, "configpath", translate("Config Path"), translate("AdGuardHome config path"))
o.default = "/etc/AdGuardHome.yaml"
o.datatype = "string"
o.default = "/etc/config/AdGuardHome.yaml"
o.datatype = "string"
o.optional = false
o.rmempty=false
o.validate=function(self, value)
if value==nil then return nil end
if fs.stat(value,"type")=="dir" then
fs.rmdir(value)
end
if fs.stat(value,"type")=="dir" then
if m.message then
m.message =m.message.."\nerror!config path is a dir"
else
m.message ="error!config path is a dir"
end
return nil
end
return value
o.rmempty = false
o.validate = function(self, value)
if value == nil then return nil end
if fs.stat(value, "type") == "dir" then fs.rmdir(value) end
if fs.stat(value, "type") == "dir" then
if m.message then
m.message = m.message .. "\nerror!config path is a dir"
else
m.message = "error!config path is a dir"
end
return nil
end
return value
end
---- work dir
o = s:option(Value, "workdir", translate("Work dir"), translate("AdGuardHome work dir include rules,audit log and database"))
o.default = "/etc/AdGuardHome"
o.datatype = "string"
o.default = "/usr/bin/AdGuardHome"
o.datatype = "string"
o.optional = false
o.rmempty=false
o.validate=function(self, value)
if value=="" then return nil end
if fs.stat(value,"type")=="reg" then
if m.message then
m.message =m.message.."\nerror!work dir is a file"
else
m.message ="error!work dir is a file"
end
return nil
end
if string.sub(value, -1)=="/" then
return string.sub(value, 1, -2)
else
return value
end
o.rmempty = false
o.validate = function(self, value)
if value == "" then return nil end
if fs.stat(value, "type") == "reg" then
if m.message then
m.message = m.message .. "\nerror!work dir is a file"
else
m.message = "error!work dir is a file"
end
return nil
end
if string.sub(value, -1) == "/" then
return string.sub(value, 1, -2)
else
return value
end
end
---- log file
o = s:option(Value, "logfile", translate("Runtime log file"), translate("AdGuardHome runtime Log file if 'syslog': write to system log;if empty no log"))
o.datatype = "string"
o.datatype = "string"
o.rmempty = true
o.validate=function(self, value)
if fs.stat(value,"type")=="dir" then
fs.rmdir(value)
end
if fs.stat(value,"type")=="dir" then
if m.message then
m.message =m.message.."\nerror!log file is a dir"
else
m.message ="error!log file is a dir"
end
return nil
end
return value
o.validate = function(self, value)
if fs.stat(value, "type") == "dir" then fs.rmdir(value) end
if fs.stat(value, "type") == "dir" then
if m.message then
m.message = m.message .. "\nerror!log file is a dir"
else
m.message = "error!log file is a dir"
end
return nil
end
return value
end
---- debug
o = s:option(Flag, "verbose", translate("Verbose log"))
o.default = 0
o.optional = true
---- gfwlist
local a=luci.sys.call("grep -m 1 -q programadd "..configpath)
if (a==0) then
a="Added"
---- gfwlist
local a = luci.sys.call("grep -m 1 -q programadd " .. configpath)
if (a == 0) then
a = "Added"
else
a="Not added"
a = "Not added"
end
o=s:option(Button,"gfwdel",translate("Del gfwlist"),translate(a))
o = s:option(Button, "gfwdel", translate("Del gfwlist"), translate(a))
o.optional = true
o.inputtitle=translate("Del")
o.write=function()
luci.sys.exec("sh /usr/share/AdGuardHome/gfw2adg.sh del 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin","services","AdGuardHome"))
o.inputtitle = translate("Del")
o.write = function()
luci.sys.exec("sh /usr/share/AdGuardHome/gfw2adg.sh del 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "AdGuardHome"))
end
o=s:option(Button,"gfwadd",translate("Add gfwlist"),translate(a))
o = s:option(Button, "gfwadd", translate("Add gfwlist"), translate(a))
o.optional = true
o.inputtitle=translate("Add")
o.write=function()
luci.sys.exec("sh /usr/share/AdGuardHome/gfw2adg.sh 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin","services","AdGuardHome"))
o.inputtitle = translate("Add")
o.write = function()
luci.sys.exec("sh /usr/share/AdGuardHome/gfw2adg.sh 2>&1")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "AdGuardHome"))
end
o = s:option(Value, "gfwupstream", translate("Gfwlist upstream dns server"), translate("Gfwlist domain upstream dns service")..translate(a))
o.default = "tcp://208.67.220.220:5353"
o.datatype = "string"
o = s:option(Value, "gfwupstream", translate("Gfwlist upstream dns server"), translate("Gfwlist domain upstream dns service") .. translate(a))
o.default = "tcp://208.67.220.220:5353"
o.datatype = "string"
o.optional = true
---- chpass
o = s:option(Value, "hashpass", translate("Change browser management password"), translate("Press load culculate model and culculate finally save/apply"))
o.default = ""
o.datatype = "string"
o.default = ""
o.datatype = "string"
o.template = "AdGuardHome/AdGuardHome_chpass"
o.optional = true
---- upgrade protect
o = s:option(MultiValue, "upprotect", translate("Keep files when system upgrade"))
o:value("$binpath",translate("core bin"))
o:value("$configpath",translate("config file"))
o:value("$logfile",translate("log file"))
o:value("$workdir/data/sessions.db",translate("sessions.db"))
o:value("$workdir/data/stats.db",translate("stats.db"))
o:value("$workdir/data/querylog.json",translate("querylog.json"))
o:value("$workdir/data/filters",translate("filters"))
o:value("$binpath", translate("core bin"))
o:value("$configpath", translate("config file"))
o:value("$logfile", translate("log file"))
o:value("$workdir/data/sessions.db", translate("sessions.db"))
o:value("$workdir/data/stats.db", translate("stats.db"))
o:value("$workdir/data/querylog.json", translate("querylog.json"))
o:value("$workdir/data/filters", translate("filters"))
o.widget = "checkbox"
o.default = nil
o.optional=true
o.optional = true
---- wait net on boot
o = s:option(Flag, "waitonboot", translate("On boot when network ok restart"))
o.default = 1
o.optional = true
---- backup workdir on shutdown
local workdir=uci:get("AdGuardHome","AdGuardHome","workdir") or "/etc/AdGuardHome"
local workdir = uci:get("AdGuardHome", "AdGuardHome", "workdir") or "/usr/bin/AdGuardHome"
o = s:option(MultiValue, "backupfile", translate("Backup workdir files when shutdown"))
o1 = s:option(Value, "backupwdpath", translate("Backup workdir path"))
local name
o:value("filters","filters")
o:value("stats.db","stats.db")
o:value("querylog.json","querylog.json")
o:value("sessions.db","sessions.db")
o1:depends ("backupfile", "filters")
o1:depends ("backupfile", "stats.db")
o1:depends ("backupfile", "querylog.json")
o1:depends ("backupfile", "sessions.db")
for name in fs.glob(workdir.."/data/*")
do
name=fs.basename (name)
if name~="filters" and name~="stats.db" and name~="querylog.json" and name~="sessions.db" then
o:value(name,name)
o1:depends ("backupfile", name)
end
o:value("filters", "filters")
o:value("stats.db", "stats.db")
o:value("querylog.json", "querylog.json")
o:value("sessions.db", "sessions.db")
o1:depends("backupfile", "filters")
o1:depends("backupfile", "stats.db")
o1:depends("backupfile", "querylog.json")
o1:depends("backupfile", "sessions.db")
for name in fs.glob(workdir .. "/data/*") do
name = fs.basename(name)
if name ~= "filters" and name ~= "stats.db" and name ~= "querylog.json" and
name ~= "sessions.db" then
o:value(name, name)
o1:depends("backupfile", name)
end
end
o.widget = "checkbox"
o.default = nil
o.optional=false
o.description=translate("Will be restore when workdir/data is empty")
o.optional = false
o.description = translate("Will be restore when workdir/data is empty")
----backup workdir path
o1.default = "/etc/AdGuardHome"
o1.datatype = "string"
o1.default = "/usr/bin/AdGuardHome"
o1.datatype = "string"
o1.optional = false
o1.validate=function(self, value)
if fs.stat(value,"type")=="reg" then
if m.message then
m.message =m.message.."\nerror!backup dir is a file"
else
m.message ="error!backup dir is a file"
end
return nil
end
if string.sub(value,-1)=="/" then
return string.sub(value, 1, -2)
else
return value
end
o1.validate = function(self, value)
if fs.stat(value, "type") == "reg" then
if m.message then
m.message = m.message .. "\nerror!backup dir is a file"
else
m.message = "error!backup dir is a file"
end
return nil
end
if string.sub(value, -1) == "/" then
return string.sub(value, 1, -2)
else
return value
end
end
----Crontab
o = s:option(MultiValue, "crontab", translate("Crontab task"),translate("Please change time and args in crontab"))
o:value("autoupdate",translate("Auto update core"))
o:value("cutquerylog",translate("Auto tail querylog"))
o:value("cutruntimelog",translate("Auto tail runtime log"))
o:value("autohost",translate("Auto update ipv6 hosts and restart adh"))
o:value("autogfw",translate("Auto update gfwlist and restart adh"))
o = s:option(MultiValue, "crontab", translate("Crontab task"), translate("Please change time and args in crontab"))
o:value("autoupdate", translate("Auto update core"))
o:value("cutquerylog", translate("Auto tail querylog"))
o:value("cutruntimelog", translate("Auto tail runtime log"))
o:value("autohost", translate("Auto update ipv6 hosts and restart adh"))
o:value("autogfw", translate("Auto update gfwlist and restart adh"))
o.widget = "checkbox"
o.default = nil
o.optional=true
o.optional = true
----downloadpath
o = s:option(TextValue, "downloadlinks",translate("Download links for update"))
o = s:option(TextValue, "downloadlinks", translate("Download links for update"))
o.optional = false
o.rows = 4
o.wrap = "soft"
o.cfgvalue = function(self, section)
return fs.readfile("/usr/share/AdGuardHome/links.txt")
return fs.readfile("/usr/share/AdGuardHome/links.txt")
end
o.write = function(self, section, value)
fs.writefile("/usr/share/AdGuardHome/links.txt", value:gsub("\r\n", "\n"))
fs.writefile("/usr/share/AdGuardHome/links.txt", value:gsub("\r\n", "\n"))
end
fs.writefile("/var/run/lucilogpos","0")
fs.writefile("/var/run/lucilogpos", "0")
function m.on_commit(map)
if (fs.access("/var/run/AdGserverdis")) then
io.popen("/etc/init.d/AdGuardHome reload &")
return
end
local ucitracktest=uci:get("AdGuardHome","AdGuardHome","ucitracktest")
if ucitracktest=="1" then
return
elseif ucitracktest=="0" then
io.popen("/etc/init.d/AdGuardHome reload &")
else
if (fs.access("/var/run/AdGlucitest")) then
uci:set("AdGuardHome","AdGuardHome","ucitracktest","0")
io.popen("/etc/init.d/AdGuardHome reload &")
else
fs.writefile("/var/run/AdGlucitest","")
if (ucitracktest=="2") then
uci:set("AdGuardHome","AdGuardHome","ucitracktest","1")
else
uci:set("AdGuardHome","AdGuardHome","ucitracktest","2")
end
end
uci:save("AdGuardHome")
end
if (fs.access("/var/run/AdGserverdis")) then
io.popen("/etc/init.d/AdGuardHome reload &")
return
end
local ucitracktest = uci:get("AdGuardHome", "AdGuardHome", "ucitracktest")
if ucitracktest == "1" then
return
elseif ucitracktest == "0" then
io.popen("/etc/init.d/AdGuardHome reload &")
else
if (fs.access("/var/run/AdGlucitest")) then
uci:set("AdGuardHome", "AdGuardHome", "ucitracktest", "0")
io.popen("/etc/init.d/AdGuardHome reload &")
else
fs.writefile("/var/run/AdGlucitest", "")
if (ucitracktest == "2") then
uci:set("AdGuardHome", "AdGuardHome", "ucitracktest", "1")
else
uci:set("AdGuardHome", "AdGuardHome", "ucitracktest", "2")
end
end
uci:commit("AdGuardHome")
end
end
return m

View File

@ -1,16 +1,16 @@
local fs=require"nixio.fs"
local uci=require"luci.model.uci".cursor()
local f,t
f=SimpleForm("logview")
local fs = require "nixio.fs"
local uci = require"luci.model.uci".cursor()
local f, t
f = SimpleForm("logview")
f.reset = false
f.submit = false
t=f:field(TextValue,"conf")
t.rmempty=true
t.rows=20
t.template="AdGuardHome/log"
t.readonly="readonly"
local logfile=uci:get("AdGuardHome","AdGuardHome","logfile") or ""
t.timereplace=(logfile~="syslog" and logfile~="" )
t.pollcheck=logfile~=""
fs.writefile("/var/run/lucilogreload","")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 20
t.template = "AdGuardHome/log"
t.readonly = "readonly"
local logfile = uci:get("AdGuardHome", "AdGuardHome", "logfile") or ""
t.timereplace = (logfile ~= "syslog" and logfile ~= "")
t.pollcheck = logfile ~= ""
fs.writefile("/var/run/lucilogpos", "0")
return f

View File

@ -1,97 +1,100 @@
local m, s, o
local fs = require "nixio.fs"
local uci=require"luci.model.uci".cursor()
local sys=require"luci.sys"
local uci = require"luci.model.uci".cursor()
local sys = require "luci.sys"
require("string")
require("io")
require("table")
function gen_template_config()
local b
local d=""
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
local b
local d = ""
local file = "/tmp/resolv.conf.d/resolv.conf.auto"
if not fs.access(file) then
file = "/tmp/resolv.conf.auto"
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()
return table.concat(tbl, "\n")
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()
return table.concat(tbl, "\n")
end
m = Map("AdGuardHome")
local configpath = uci:get("AdGuardHome","AdGuardHome","configpath")
local binpath = uci:get("AdGuardHome","AdGuardHome","binpath")
local configpath = uci:get("AdGuardHome", "AdGuardHome", "configpath")
local binpath = uci:get("AdGuardHome", "AdGuardHome", "binpath")
s = m:section(TypedSection, "AdGuardHome")
s.anonymous=true
s.addremove=false
s.anonymous = true
s.addremove = false
--- config
o = s:option(TextValue, "escconf")
o.rows = 66
o.wrap = "off"
o.rmempty = true
o.cfgvalue = function(self, section)
return fs.readfile("/tmp/AdGuardHometmpconfig.yaml") or fs.readfile(configpath) or gen_template_config() or ""
return fs.readfile("/tmp/AdGuardHometmpconfig.yaml") or fs.readfile(configpath) or gen_template_config() or ""
end
o.validate=function(self, value)
o.validate = function(self, value)
fs.writefile("/tmp/AdGuardHometmpconfig.yaml", value:gsub("\r\n", "\n"))
if fs.access(binpath) then
if (sys.call(binpath.." -c /tmp/AdGuardHometmpconfig.yaml --check-config 2> /tmp/AdGuardHometest.log")==0) then
return value
end
else
return value
end
luci.http.redirect(luci.dispatcher.build_url("admin","services","AdGuardHome","manual"))
return nil
if fs.access(binpath) then
if (sys.call(binpath .. " -c /tmp/AdGuardHometmpconfig.yaml --check-config 2> /tmp/AdGuardHometest.log") == 0) then return value end
else
return value
end
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "AdGuardHome", "manual"))
return nil
end
o.write = function(self, section, value)
fs.move("/tmp/AdGuardHometmpconfig.yaml",configpath)
end
o.remove = function(self, section, value)
fs.writefile(configpath, "")
fs.move("/tmp/AdGuardHometmpconfig.yaml", configpath)
end
o.remove = function(self, section, value) fs.writefile(configpath, "") end
--- js and reload button
o = s:option(DummyValue, "")
o.anonymous=true
o.anonymous = true
o.template = "AdGuardHome/yamleditor"
if not fs.access(binpath) then
o.description=translate("WARNING!!! no bin found apply config will not be test")
o.description = translate("WARNING!!! no bin found apply config will not be test")
end
--- log
--- log
if (fs.access("/tmp/AdGuardHometmpconfig.yaml")) then
local c=fs.readfile("/tmp/AdGuardHometest.log")
if (c~="") then
o = s:option(TextValue, "")
o.readonly=true
o.rows = 5
o.rmempty = true
o.name=""
o.cfgvalue = function(self, section)
return fs.readfile("/tmp/AdGuardHometest.log")
end
end
local c = fs.readfile("/tmp/AdGuardHometest.log")
if (c ~= "") then
o = s:option(TextValue, "")
o.readonly = true
o.rows = 5
o.rmempty = true
o.name = ""
o.cfgvalue = function(self, section)
return fs.readfile("/tmp/AdGuardHometest.log")
end
end
end
function m.on_commit(map)
local ucitracktest=uci:get("AdGuardHome","AdGuardHome","ucitracktest")
if ucitracktest=="1" then
return
elseif ucitracktest=="0" then
io.popen("/etc/init.d/AdGuardHome reload &")
else
fs.writefile("/var/run/AdGlucitest","")
end
local ucitracktest = uci:get("AdGuardHome", "AdGuardHome", "ucitracktest")
if ucitracktest == "1" then
return
elseif ucitracktest == "0" then
io.popen("/etc/init.d/AdGuardHome reload &")
else
fs.writefile("/var/run/AdGlucitest", "")
end
end
return m

View File

@ -1,9 +1,9 @@
<%+cbi/valueheader%>
<%local fs=require"nixio.fs"%>
<input type="button" class="btn cbi-button cbi-button-apply" id="apply_update_button" value="<%:Update core version%>" onclick=" return apply_update() "/>
<input type="button" class="btn cbi-button cbi-button-apply" id="apply_forceupdate_button" value="<%:Force update%>" onclick=" return apply_forceupdate()" style="display:none"/>
<input type="button" class="cbi-button cbi-button-apply" id="apply_update_button" value="<%:Update core version%>" onclick=" return apply_update() "/>
<input type="button" class="cbi-button cbi-button-apply" id="apply_forceupdate_button" value="<%:Force update%>" onclick=" return apply_forceupdate()" style="display:none"/>
<% if self.showfastconfig then %>
<input type="button" class="btn cbi-button cbi-button-apply" id="to_configpage" value="<%:Fast config%>" onclick="location.href='<%=url([[admin]], [[services]], [[AdGuardHome]], [[manual]])%>'"/>
<input type="button" class="cbi-button cbi-button-apply" id="to_configpage" value="<%:Fast config%>" onclick="location.href='<%=url([[admin]], [[services]], [[AdGuardHome]], [[manual]])%>'"/>
<%end%>
<div id="logview" style="display:none">
<input type="checkbox" id="reversetag" value="reverse" onclick=" return reverselog()" style="vertical-align:middle;height: auto;"><%:reverse%></input>
@ -75,4 +75,4 @@ XHR.poll(3, '<%=url([[admin]], [[services]], [[AdGuardHome]], [[check]])%>', nul
<%end%>
//]]>
</script>
<%+cbi/valuefooter%>
<%+cbi/valuefooter%>

View File

@ -45,5 +45,5 @@ function chpass(btn)
ifattr(#self.keylist > 0, "data-choices", { self.keylist, self.vallist })
%> />
<% if self.password then %><img src="<%=resource%>/cbi/reload.gif" style="vertical-align:middle" title="<%:Reveal/hide password%>" onclick="var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" /><% end %>
<input type="button" class="btn cbi-button cbi-button-apply" id="cbid.AdGuardHome.AdGuardHome.applychpass" value="<%:Load culculate model%>" onclick="return chpass(this)"/>
<%+cbi/valuefooter%>
<input type="button" class="cbi-button cbi-button-apply" id="cbid.AdGuardHome.AdGuardHome.applychpass" value="<%:Load culculate model%>" onclick="return chpass(this)"/>
<%+cbi/valuefooter%>

View File

@ -4,8 +4,8 @@
<input type="checkbox" name="NAME" value="localtime" onclick=" return chlogtime()" style="vertical-align:middle;height: auto;" checked><%:localtime%></input><br>
<%end%>
<textarea id="cbid.logview.1.conf" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" > </textarea>
<input type="button" class="btn cbi-button cbi-button-apply" id="apply_update_button" value="<%:dellog%>" onclick=" return apply_del_log() "/>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:download log%>" style=" display:inline;" onclick=" return download_log()" />
<input type="button" class="cbi-button cbi-button-apply" id="apply_update_button" value="<%:dellog%>" onclick=" return apply_del_log() "/>
<input type="button" class="cbi-button cbi-button-apply" value="<%:download log%>" style=" display:inline;" onclick=" return download_log()" />
<script type="text/javascript">//<![CDATA[
var islogreverse = true;
var isutc2local = <%=tostring(self.timereplace)%>;
@ -107,4 +107,4 @@ lv.innerHTML="<%:Please add log path in config to enable log%>"
<%end%>
//]]>
</script>
<%+cbi/valuefooter%>
<%+cbi/valuefooter%>

View File

@ -1 +0,0 @@
zh_Hans

View File

@ -0,0 +1,266 @@
#/cgi-bin/luci/admin/services/AdGuardHome
msgid "Base Setting"
msgstr "基础设置"
msgid "Log"
msgstr "日志"
msgid "Manual Config"
msgstr "手动设置"
msgid "Free and open source, powerful network-wide ads & trackers blocking DNS server."
msgstr "免费开源功能强大的全网络广告和跟踪程序拦截DNS服务器"
msgid "RUNNING"
msgstr "运行中"
msgid "NOT RUNNING"
msgstr "未运行"
msgid "Redirected"
msgstr "已重定向"
msgid "Not redirect"
msgstr "未重定向"
msgid "Collecting data..."
msgstr "获取数据中..."
msgid "Enable"
msgstr "启用"
msgid "Browser management port"
msgstr "网页管理端口"
msgid "Update"
msgstr "更新"
#button change
msgid "Update core version"
msgstr "更新核心版本"
msgid "Check..."
msgstr "检查中..."
msgid "Updated"
msgstr "已更新"
#button hide
msgid "Force update"
msgstr "强制更新"
msgid "Fast config"
msgstr "快速配置"
#
msgid "core version:"
msgstr "核心版本:"
#description change
msgid "no config"
msgstr "没有配置文件"
msgid "no core"
msgstr "没有核心"
#
msgid "Redirect"
msgstr "重定向"
#inlist
msgid "none"
msgstr "无"
msgid "Run as dnsmasq upstream server"
msgstr "作为dnsmasq的上游服务器"
msgid "Redirect 53 port to AdGuardHome"
msgstr "重定向53端口到AdGuardHome"
msgid "Use port 53 replace dnsmasq"
msgstr "使用53端口替换dnsmasq"
#
msgid "AdGuardHome redirect mode"
msgstr "AdGuardHome重定向模式"
msgid "Bin Path"
msgstr "执行文件路径"
msgid "AdGuardHome Bin path if no bin will auto download"
msgstr "AdGuardHome 执行文件路径 如果没有执行文件将自动下载"
msgid "use upx to compress bin after download"
msgstr "下载后使用upx压缩执行文件"
#inlist
msgid "compress faster"
msgstr "快速压缩"
msgid "compress better"
msgstr "更好的压缩"
msgid "compress best(can be slow for big files)"
msgstr "最好的压缩(大文件可能慢)"
msgid "try all available compression methods & filters [slow]"
msgstr "尝试所有可能的压缩方法和过滤器[慢]"
msgid "try even more compression variants [very slow]"
msgstr "尝试更多变体压缩手段[很慢]"
msgid "bin use less space,but may have compatibility issues"
msgstr "减小执行文件空间占用,但是可能压缩后有兼容性问题"
#
msgid "Config Path"
msgstr "配置文件路径"
msgid "AdGuardHome config path"
msgstr "AdGuardHome 配置文件路径"
msgid "Work dir"
msgstr "工作目录"
msgid "AdGuardHome work dir include rules,audit log and database"
msgstr "AdGuardHome 工作目录包含规则,审计日志和数据库"
msgid "Runtime log file"
msgstr "运行日志"
msgid "AdGuardHome runtime Log file if 'syslog': write to system log;if empty no log"
msgstr "AdGuardHome 运行日志 如果填syslog将写入系统日志如果空则不记录日志"
msgid "Verbose log"
msgstr "详细日志"
#hide div
msgid "Add gfwlist"
msgstr "加入gfw列表"
msgid "Add"
msgstr "添加"
msgid "Added"
msgstr "已添加"
msgid "Not added"
msgstr "未添加"
#hide div
msgid "Del gfwlist"
msgstr "删除gfw列表"
msgid "Del"
msgstr "删除"
#hide div
msgid "Gfwlist upstream dns server"
msgstr "gfw列表上游服务器"
msgid "Gfwlist domain upstream dns service"
msgstr "gfw列表域名上游服务器"
#hide div
msgid "Change browser management password"
msgstr "改变网页登录密码"
msgid "Culculate"
msgstr "计算"
##button change
msgid "Load culculate model"
msgstr "载入计算模块"
msgid "loading..."
msgstr "载入中"
msgid "Please save/apply"
msgstr "请提交"
msgid "is empty"
msgstr "为空"
msgid "Press load culculate model and culculate finally save/apply"
msgstr "按载入计算模块 然后计算 最后保存/提交"
#
msgid "Keep files when system upgrade"
msgstr "系统升级时保留文件"
#checkbox
msgid "core bin"
msgstr "核心执行文件"
msgid "config file"
msgstr "配置文件"
msgid "log file"
msgstr "日志文件"
msgid "querylog.json"
msgstr "审计日志.json"
#
msgid "On boot when network ok restart"
msgstr "开机后网络准备好时重启"
msgid "Backup workdir files when shutdown"
msgstr "在关机时备份工作目录文件"
msgid "Will be restore when workdir/data is empty"
msgstr "在工作目录/data为空的时候恢复"
msgid "Backup workdir path"
msgstr "工作目录备份路径"
msgid "Crontab task"
msgstr "计划任务"
msgid "Auto update core"
msgstr "自动升级核心"
msgid "Auto tail querylog"
msgstr "自动截短查询日志"
msgid "Auto tail runtime log"
msgstr "自动截短运行日志"
msgid "Auto update ipv6 hosts and restart adh"
msgstr "自动更新ipv6主机并重启adh"
msgid "Auto update gfwlist and restart adh"
msgstr "自动更新gfw列表并重启adh"
msgid "Please change time and args in crontab"
msgstr "请在计划任务中修改时间和参数"
msgid "Download links for update"
msgstr "升级用的下载链接"
#/cgi-bin/luci/admin/services/AdGuardHome/log/
msgid "reverse"
msgstr "逆序"
msgid "localtime"
msgstr "本地时间"
msgid "Please add log path in config to enable log"
msgstr "请在设置里填写日志路径以启用日志"
msgid "dellog"
msgstr "删除日志"
msgid "download log"
msgstr "下载日志"
#/cgi-bin/luci//admin/services/AdGuardHome/manual/
msgid "Use template"
msgstr "使用模板"
#hide button
msgid "Reload Config"
msgstr "重新载入配置"
msgid "WARNING!!! no bin found apply config will not be test"
msgstr "警告!!!未找到执行文件,提交配置将不会进行校验"
#unused
msgid "Change browser management username"
msgstr "改变网页登录用户名"
msgid "Username"
msgstr "用户名"
msgid "Check Config"
msgstr "检查配置"
msgid "unknown"
msgstr "未知"
msgid "Keep database when system upgrade"
msgstr "系统升级时保留数据"
msgid "Boot delay until network ok"
msgstr "开机时直到网络准备好再启动"

View File

@ -0,0 +1 @@
zh-cn

View File

@ -1,408 +0,0 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:27
msgid ""
"<input type=\"button\" style=\"width:210px;border-color:Teal; text-align:"
"center;font-weight:bold;color:Green;\" value=\"AdGuardHome Web:"
msgstr ""
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/controller/AdGuardHome.lua:6
msgid "AdGuard Home"
msgstr ""
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:67
msgid "AdGuardHome Bin path if no bin will auto download"
msgstr "AdGuardHome 执行文件路径 如果没有执行文件将自动下载"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:99
msgid "AdGuardHome config path"
msgstr "AdGuardHome 配置文件路径"
#
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:58
msgid "AdGuardHome redirect mode"
msgstr "AdGuardHome重定向模式"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:142
msgid ""
"AdGuardHome runtime Log file if 'syslog': write to system log;if empty no log"
msgstr "AdGuardHome 运行日志 如果填syslog将写入系统日志如果空则不记录日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:120
msgid "AdGuardHome work dir include rules,audit log and database"
msgstr "AdGuardHome 工作目录包含规则,审计日志和数据库"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:179
msgid "Add"
msgstr "添加"
# hide div
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:177
msgid "Add gfwlist"
msgstr "加入gfw列表"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:259
msgid "Auto tail querylog"
msgstr "自动截短查询日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:260
msgid "Auto tail runtime log"
msgstr "自动截短运行日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:258
msgid "Auto update core"
msgstr "自动升级核心"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:262
msgid "Auto update gfwlist and restart adh"
msgstr "自动更新gfw列表并重启adh"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:261
msgid "Auto update ipv6 hosts and restart adh"
msgstr "自动更新ipv6主机并重启adh"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:212
msgid "Backup workdir files when shutdown"
msgstr "在关机时备份工作目录文件"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:213
msgid "Backup workdir path"
msgstr "工作目录备份路径"
# /cgi-bin/luci/admin/services/AdGuardHome
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/controller/AdGuardHome.lua:7
msgid "Base Setting"
msgstr "基础设置"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:67
msgid "Bin Path"
msgstr "执行文件路径"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:22
msgid "Browser management port"
msgstr "网页管理端口"
# hide div
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:189
msgid "Change browser management password"
msgstr "改变网页登录密码"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:37
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:70
msgid "Check..."
msgstr "检查中..."
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_status.htm:25
msgid "Collecting data..."
msgstr "获取数据中..."
#
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:99
msgid "Config Path"
msgstr "配置文件路径"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:257
msgid "Crontab task"
msgstr "计划任务"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_chpass.htm:16
msgid "Culculate"
msgstr "计算"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:172
msgid "Del"
msgstr "删除"
# hide div
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:170
msgid "Del gfwlist"
msgstr "删除gfw列表"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:268
msgid "Download links for update"
msgstr "升级用的下载链接"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:18
msgid "Enable"
msgstr "启用"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:6
msgid "Fast config"
msgstr "快速配置"
# button hide
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:4
msgid "Force update"
msgstr "强制更新"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:11
msgid ""
"Free and open source, powerful network-wide ads & trackers blocking DNS "
"server."
msgstr "免费开源功能强大的全网络广告和跟踪程序拦截DNS服务器"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:184
msgid "Gfwlist domain upstream dns service"
msgstr "gfw列表域名上游服务器"
# hide div
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:184
msgid "Gfwlist upstream dns server"
msgstr "gfw列表上游服务器"
#
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:195
msgid "Keep files when system upgrade"
msgstr "系统升级时保留文件"
# #button change
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_chpass.htm:48
msgid "Load culculate model"
msgstr "载入计算模块"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/controller/AdGuardHome.lua:8
msgid "Log"
msgstr "日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/controller/AdGuardHome.lua:9
msgid "Manual Config"
msgstr "手动设置"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_status.htm:9
msgid "NOT RUNNING"
msgstr "未运行"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_status.htm:15
msgid "Not redirect"
msgstr "未重定向"
#
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:207
msgid "On boot when network ok restart"
msgstr "开机后网络准备好时重启"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/log.htm:106
msgid "Please add log path in config to enable log"
msgstr "请在设置里填写日志路径以启用日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:257
msgid "Please change time and args in crontab"
msgstr "请在计划任务中修改时间和参数"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_chpass.htm:24
msgid "Please save/apply"
msgstr "请提交"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:189
msgid "Press load culculate model and culculate finally save/apply"
msgstr "按载入计算模块 然后计算 最后保存/提交"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_status.htm:7
msgid "RUNNING"
msgstr "运行中"
#
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:58
msgid "Redirect"
msgstr "重定向"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:62
msgid "Redirect 53 port to AdGuardHome"
msgstr "重定向53端口到AdGuardHome"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_status.htm:13
msgid "Redirected"
msgstr "已重定向"
# hide button
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/yamleditor.htm:36
msgid "Reload Config"
msgstr "重新载入配置"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_chpass.htm:47
msgid "Reveal/hide password"
msgstr ""
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:61
msgid "Run as dnsmasq upstream server"
msgstr "作为dnsmasq的上游服务器"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:142
msgid "Runtime log file"
msgstr "运行日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:49
msgid "Update"
msgstr "更新"
# button change
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:50
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:3
msgid "Update core version"
msgstr "更新核心版本"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:54
msgid "Updated"
msgstr "已更新"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:63
msgid "Use port 53 replace dnsmasq"
msgstr "使用53端口替换dnsmasq"
# /cgi-bin/luci//admin/services/AdGuardHome/manual/
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/yamleditor.htm:38
msgid "Use template"
msgstr "使用模板"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:160
msgid "Verbose log"
msgstr "详细日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/manual.lua:71
msgid "WARNING!!! no bin found apply config will not be test"
msgstr "警告!!!未找到执行文件,提交配置将不会进行校验"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:234
msgid "Will be restore when workdir/data is empty"
msgstr "在工作目录/data为空的时候恢复"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:120
msgid "Work dir"
msgstr "工作目录"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:96
msgid "bin use less space,but may have compatibility issues"
msgstr "减小执行文件空间占用,但是可能压缩后有兼容性问题"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:92
msgid "compress best(can be slow for big files)"
msgstr "最好的压缩(大文件可能慢)"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:91
msgid "compress better"
msgstr "更好的压缩"
# inlist
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:90
msgid "compress faster"
msgstr "快速压缩"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:197
msgid "config file"
msgstr "配置文件"
# checkbox
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:196
msgid "core bin"
msgstr "核心执行文件"
#
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:53
msgid "core version:"
msgstr "核心版本:"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/log.htm:7
msgid "dellog"
msgstr "删除日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/log.htm:8
msgid "download log"
msgstr "下载日志"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:202
msgid "filters"
msgstr ""
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_chpass.htm:26
msgid "is empty"
msgstr "为空"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_chpass.htm:6
msgid "loading..."
msgstr "载入中"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/log.htm:4
msgid "localtime"
msgstr "本地时间"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:198
msgid "log file"
msgstr "日志文件"
# description change
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:32
msgid "no config"
msgstr "没有配置文件"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:35
msgid "no core"
msgstr "没有核心"
# inlist
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:60
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:89
msgid "none"
msgstr "无"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:201
msgid "querylog.json"
msgstr "审计日志.json"
# /cgi-bin/luci/admin/services/AdGuardHome/log/
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_check.htm:9
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/view/AdGuardHome/log.htm:2
msgid "reverse"
msgstr "逆序"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:199
msgid "sessions.db"
msgstr ""
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:200
msgid "stats.db"
msgstr ""
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:93
msgid "try all available compression methods & filters [slow]"
msgstr "尝试所有可能的压缩方法和过滤器[慢]"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:94
msgid "try even more compression variants [very slow]"
msgstr "尝试更多变体压缩手段[很慢]"
#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-adguardhome/luasrc/model/cbi/AdGuardHome/base.lua:88
msgid "use upx to compress bin after download"
msgstr "下载后使用upx压缩执行文件"
#~ msgid "Added"
#~ msgstr "已添加"
#~ msgid "Not added"
#~ msgstr "未添加"
# unused
#~ msgid "Change browser management username"
#~ msgstr "改变网页登录用户名"
#~ msgid "Username"
#~ msgstr "用户名"
#~ msgid "Check Config"
#~ msgstr "检查配置"
#~ msgid "unknown"
#~ msgstr "未知"
#~ msgid "Keep database when system upgrade"
#~ msgstr "系统升级时保留数据"
#~ msgid "Boot delay until network ok"
#~ msgstr "开机时直到网络准备好再启动"

View File

@ -2,8 +2,8 @@ config AdGuardHome 'AdGuardHome'
option enabled '0'
option httpport '3000'
option redirect 'none'
option configpath '/etc/AdGuardHome.yaml'
option workdir '/etc/AdGuardHome'
option configpath '/etc/config/AdGuardHome.yaml'
option workdir '/tmp/AdGuardHome'
option logfile '/tmp/AdGuardHome.log'
option verbose '0'
option binpath '/usr/bin/AdGuardHome'

View File

@ -7,13 +7,12 @@ STOP=01
CONFIGURATION=AdGuardHome
CRON_FILE=/etc/crontabs/root
extra_command "do_redirect" "0 or 1"
extra_command "testbackup" "backup or restore"
extra_command "test_crontab"
extra_command "force_reload"
extra_command "isrunning"
EXTRA_COMMANDS="do_redirect testbackup test_crontab force_reload isrunning"
EXTRA_HELP=" do_redirect 0 or 1\
testbackup backup or restore\
test_crontab
force_reload
isrunning"
set_forward_dnsmasq()
{
local PORT="$1"
@ -29,7 +28,7 @@ set_forward_dnsmasq()
if [ "$server" = "$addr" ]; then
continue
fi
# uci add_list dhcp.@dnsmasq[0].server=$server
uci add_list dhcp.@dnsmasq[0].server=$server
done
uci delete dhcp.@dnsmasq[0].resolvfile 2>/dev/null
uci set dhcp.@dnsmasq[0].noresolv=1
@ -50,7 +49,9 @@ 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
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null
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 delete dhcp.@dnsmasq[0].noresolv 2>/dev/null
fi
uci commit dhcp
@ -62,89 +63,80 @@ set_iptable()
local ipv6_server=$1
local tcp_server=$2
uci -q batch <<-EOF >/dev/null 2>&1
delete firewall.AdGuardHome
delete firewall.AdGuardHome
set firewall.AdGuardHome=include
set firewall.AdGuardHome.type=script
set firewall.AdGuardHome.path=/usr/share/AdGuardHome/firewall.start
set firewall.AdGuardHome.reload=1
commit firewall
EOF
[ "$tcp_server" == "1" ] && iptables -t nat -I PREROUTING 1 -m comment --comment "AdGuardHome" -p tcp --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT
iptables -t nat -I PREROUTING 1 -m comment --comment "AdGuardHome" -p udp --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT
IPS="`ifconfig | grep "inet addr" | grep -v ":127" | grep "Bcast" | awk '{print $2}' | awk -F : '{print $2}'`"
for IP in $IPS
do
if [ "$tcp_server" == "1" ]; then
iptables -t nat -A PREROUTING -p tcp -d $IP --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT >/dev/null 2>&1
fi
iptables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT >/dev/null 2>&1
done
[ "$ipv6_server" == 0 ] && return
if [ "$ipv6_server" == 0 ]; then
return
fi
IPS="`ifconfig | grep "inet6 addr" | grep -v " fe80::" | grep -v " ::1" | grep "Global" | awk '{print $3}'`"
for IP in $IPS
do
if [ "$tcp_server" == "1" ]; then
ip6tables -t nat -A PREROUTING -p tcp -d $IP --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT >/dev/null 2>&1
fi
ip6tables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT >/dev/null 2>&1
done
[ "$tcp_server" == "1" ] && ip6tables -t nat -I PREROUTING 1 -m comment --comment "AdGuardHome" -p tcp --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT
ip6tables -t nat -I PREROUTING 1 -m comment --comment "AdGuardHome" -p udp --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT
}
clear_iptable()
{
uci -q batch <<-EOF >/dev/null 2>&1
delete firewall.AdGuardHome
delete firewall.AdGuardHome
commit firewall
EOF
local OLD_PORT="$1"
local ipv6_server=$2
IPS="`ifconfig | grep "inet addr" | grep -v ":127" | grep "Bcast" | awk '{print $2}' | awk -F : '{print $2}'`"
for IP in $IPS
do
iptables -t nat -D PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-ports $OLD_PORT >/dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp -d $IP --dport 53 -j REDIRECT --to-ports $OLD_PORT >/dev/null 2>&1
done
if [ "$ipv6_server" == 0 ]; then
return
nums=$(iptables -t nat -n -L PREROUTING 2>/dev/null | grep -c "AdGuardHome")
if [ -n "$nums" ]; then
until [ "$nums" = 0 ]
do
rules=$(iptables -t nat -n -L PREROUTING --line-num 2>/dev/null | grep "AdGuardHome" | awk '{print $1}')
for rule in $rules
do
iptables -t nat -D PREROUTING $rule 2> /dev/null
break
done
nums=$(expr $nums - 1)
done
fi
nums=$(ip6tables -t nat -n -L PREROUTING 2>/dev/null | grep -c "AdGuardHome")
if [ -n "$nums" ]; then
until [ "$nums" = 0 ]
do
rules=$(ip6tables -t nat -n -L PREROUTING --line-num 2>/dev/null | grep "AdGuardHome" | awk '{print $1}')
for rule in $rules
do
ip6tables -t nat -D PREROUTING $rule 2> /dev/null
break
done
nums=$(expr $nums - 1)
done
fi
echo "warn ip6tables nat mod is needed"
IPS="`ifconfig | grep "inet6 addr" | grep -v " fe80::" | grep -v " ::1" | grep "Global" | awk '{print $3}'`"
for IP in $IPS
do
ip6tables -t nat -D PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-ports $OLD_PORT >/dev/null 2>&1
ip6tables -t nat -D PREROUTING -p tcp -d $IP --dport 53 -j REDIRECT --to-ports $OLD_PORT >/dev/null 2>&1
done
}
service_triggers() {
procd_add_reload_trigger "$CONFIGURATION"
[ "$(uci get AdGuardHome.AdGuardHome.redirect)" == "redirect" ] && procd_add_reload_trigger firewall
}
isrunning(){
config_load "${CONFIGURATION}"
_isrunning
local r=$?
([ "$r" == "0" ] && echo "running") || ([ "$r" == "1" ] && echo "not run" ) || echo "no bin"
return $r
config_load "${CONFIGURATION}"
_isrunning
local r=$?
([ "$r" == "0" ] && echo "running") || ([ "$r" == "1" ] && echo "not run" ) || echo "no bin"
return $r
}
_isrunning(){
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome"
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
[ ! -f "$binpath" ] && return 2
pgrep $binpath 2>&1 >/dev/null && return 0
return 1
}
force_reload(){
config_load "${CONFIGURATION}"
_isrunning && procd_send_signal "$CONFIGURATION" || start
}
get_tz()
{
SET_TZ=""
@ -186,7 +178,7 @@ rm_port53()
config_editor "dns.port" "$dnsmasq_port" "$configpath"
uci set dhcp.@dnsmasq[0].port="53"
uci commit dhcp
/etc/init.d/dnsmasq reload
/etc/init.d/dnsmasq restart
}
use_port53()
@ -206,15 +198,13 @@ use_port53()
config_editor "dns.port" "53" "$configpath"
uci set dhcp.@dnsmasq[0].port="$AdGuardHome_PORT"
uci commit dhcp
/etc/init.d/dnsmasq reload
/etc/init.d/dnsmasq restart
}
do_redirect()
{
config_load "${CONFIGURATION}"
_do_redirect $1
}
_do_redirect()
{
local section="$CONFIGURATION"
@ -237,6 +227,7 @@ _do_redirect()
config_get "old_port" "$section" "old_port" "0"
config_get "old_enabled" "$section" "old_enabled" "0"
uci get dhcp.@dnsmasq[0].port >/dev/null 2>&1 || uci set dhcp.@dnsmasq[0].port="53" >/dev/null 2>&1
uci commit dhcp
if [ "$old_enabled" = "1" -a "$old_redirect" == "exchange" ]; then
AdGuardHome_PORT=$(uci get dhcp.@dnsmasq[0].port 2>/dev/null)
fi
@ -244,7 +235,7 @@ _do_redirect()
if [ "$old_redirect" != "$redirect" ] || [ "$old_port" != "$AdGuardHome_PORT" ] || [ "$old_enabled" = "1" -a "$enabled" = "0" ]; then
if [ "$old_redirect" != "none" ]; then
if [ "$old_redirect" == "redirect" -a "$old_port" != "0" ]; then
clear_iptable "$old_port" "$ipv6_server"
clear_iptable
elif [ "$old_redirect" == "dnsmasq-upstream" ]; then
stop_forward_dnsmasq "$old_port"
elif [ "$old_redirect" == "exchange" ]; then
@ -253,7 +244,7 @@ _do_redirect()
fi
elif [ "$old_enabled" = "1" -a "$enabled" = "1" ]; then
if [ "$old_redirect" == "redirect" -a "$old_port" != "0" ]; then
clear_iptable "$old_port" "$ipv6_server"
clear_iptable
fi
fi
uci delete AdGuardHome.@AdGuardHome[0].old_redirect 2>/dev/null
@ -275,7 +266,6 @@ _do_redirect()
use_port53
fi
}
get_filesystem()
{
# print out path filesystem
@ -345,7 +335,7 @@ boot_service() {
config_load "${CONFIGURATION}"
config_get waitonboot $CONFIGURATION waitonboot "0"
config_get_bool enabled $CONFIGURATION enabled 0
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome"
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
[ -f "$binpath" ] && start_service
if [ "$enabled" == "1" ] && [ "$waitonboot" == "1" ]; then
procd_open_instance "waitnet"
@ -363,18 +353,16 @@ testbackup(){
restore
fi
}
restore()
{
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get backupwdpath $CONFIGURATION backupwdpath "/etc/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get backupwdpath $CONFIGURATION backupwdpath "/usr/bin/AdGuardHome"
cp -u -r -f $backupwdpath/data $workdir
}
backup() {
config_get backupwdpath $CONFIGURATION backupwdpath "/etc/AdGuardHome"
config_get backupwdpath $CONFIGURATION backupwdpath "/usr/bin/AdGuardHome"
mkdir -p $backupwdpath/data
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get backupfile $CONFIGURATION backupfile ""
for one in $backupfile;
do
@ -398,7 +386,6 @@ backup() {
done
done
}
start_service() {
# Reading config
rm /var/run/AdGserverdis >/dev/null 2>&1
@ -419,7 +406,7 @@ start_service() {
return
fi
#what need to do before reload
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get backupfile $CONFIGURATION backupfile ""
mkdir -p $workdir/data
@ -444,7 +431,7 @@ start_service() {
fi
fi
local ADDITIONAL_ARGS=""
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome"
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
mkdir -p ${binpath%/*}
ADDITIONAL_ARGS="$ADDITIONAL_ARGS -c $configpath"
@ -456,7 +443,7 @@ start_service() {
config_get upprotect $CONFIGURATION upprotect ""
eval upprotect=${upprotect// /\\\\n}
echo -e "$upprotect">/lib/upgrade/keep.d/luci-app-adguardhome
config_get logfile $CONFIGURATION logfile ""
if [ -n "$logfile" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS -l $logfile"
@ -499,16 +486,7 @@ start_service() {
echo "AdGuardHome service enabled"
echo "luci enable switch=$enabled"
(sleep 10 && [ -z "$(pgrep $binpath)" ] && logger "AdGuardHome" "no process in 10s cancel redirect" && _do_redirect 0 )&
if [[ "`uci get bypass.@global[0].global_server 2>/dev/null`" && "`uci get bypass.@global[0].adguardhome 2>/dev/null`" == 1 && "$(uci get dhcp.@dnsmasq[0].port)" == "53" ]]; then
c1=0
while ! netstat -tunlp | grep 53 | grep -i AdGuardHome 2>&1; do
/etc/init.d/bypass restart 2>/dev/null
sleep 1
[ $c1 == 5 ] && break || let c1++
done
fi
}
reload_service()
{
rm /var/run/AdGlucitest >/dev/null 2>&1
@ -517,23 +495,22 @@ reload_service()
}
del_querylog(){
local btarget=$(ls $backupwdpath/data | grep -F "querylog.json" | sort -r | head -n 1)
local wtarget=$(ls $workdir/data | grep -F "querylog.json" | sort -r | head -n 1)
if [ "$btarget"x == "$wtarget"x ]; then
[ -z "$btarget" ] && return 1
rm -f $workdir/data/$wtarget
rm -f $backupwdpath/data/$btarget
return 0
fi
if [ "$btarget" \> "$wtarget" ]; then
rm -f $backupwdpath/data/$btarget
return 0
else
rm -f $workdir/data/$wtarget
return 0
fi
local btarget=$(ls $backupwdpath/data | grep -F "querylog.json" | sort -r | head -n 1)
local wtarget=$(ls $workdir/data | grep -F "querylog.json" | sort -r | head -n 1)
if [ "$btarget"x == "$wtarget"x ]; then
[ -z "$btarget" ] && return 1
rm -f $workdir/data/$wtarget
rm -f $backupwdpath/data/$btarget
return 0
fi
if [ "$btarget" \> "$wtarget" ]; then
rm -f $backupwdpath/data/$btarget
return 0
else
rm -f $workdir/data/$wtarget
return 0
fi
}
stop_service()
{
config_load "${CONFIGURATION}"
@ -547,22 +524,17 @@ stop_service()
fi
echo "AdGuardHome service disabled"
touch /var/run/AdGserverdis
killall -9 AdGuardHome 2>/dev/null
/etc/init.d/dnsmasq restart
}
boot() {
rc_procd boot_service "$@"
if eval "type service_started" 2>/dev/null; then
if eval "type service_started" 2>/dev/null >/dev/null; then
service_started
fi
}
test_crontab(){
config_load "${CONFIGURATION}"
do_crontab
config_load "${CONFIGURATION}"
do_crontab
}
do_crontab(){
config_get_bool enabled $CONFIGURATION enabled 0
config_get crontab $CONFIGURATION crontab ""
@ -573,16 +545,16 @@ do_crontab(){
default="30 3 * * * /usr/share/AdGuardHome/update_core.sh 2>&1"
[ "$enabled" == "0" ] || [ "${crontab//autoupdate/}" == "$crontab" ] && cronenable=0 || cronenable=1
crontab_editor
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get lastworkdir $CONFIGURATION lastworkdir "/etc/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get lastworkdir $CONFIGURATION lastworkdir "/usr/bin/AdGuardHome"
findstr="/usr/share/AdGuardHome/tailto.sh [0-9]* \$(uci get AdGuardHome.AdGuardHome.workdir)/data/querylog.json"
#[ -n "$lastworkdir" ] && findstr="/usr/share/AdGuardHome/tailto.sh [0-9]* $lastworkdir/data/querylog.json" && [ "$lastworkdir" != "$workdir" ] && replace="${lastworkdir//\//\\/}/${workdir//\//\\/}"
default="0 * * * * /usr/share/AdGuardHome/tailto.sh 2000 \$(uci get AdGuardHome.AdGuardHome.workdir)/data/querylog.json"
[ "$enabled" == "0" ] || [ "${crontab//cutquerylog/}" == "$crontab" ] && cronenable=0 || cronenable=1
crontab_editor
#[ "$lastworkdir" != "$workdir" ] && uci set AdGuardHome.AdGuardHome.lastworkdir="$workdir" && commit=1
config_get logfile $CONFIGURATION logfile ""
config_get lastlogfile $CONFIGURATION lastlogfile ""
findstr="/usr/share/AdGuardHome/tailto.sh [0-9]* \$(uci get AdGuardHome.AdGuardHome.logfile)"
@ -591,7 +563,7 @@ do_crontab(){
[ "$logfile" == "syslog" ] || [ "$logfile" == "" ] || [ "$enabled" == "0" ] || [ "${crontab//cutruntimelog/}" == "$crontab" ] && cronenable=0 || cronenable=1
crontab_editor
#[ -n "$logfile" ] && [ "$lastlogfile" != "$logfile" ] && uci set AdGuardHome.AdGuardHome.lastlogfile="$logfile" && commit=1
findstr="/usr/share/AdGuardHome/addhost.sh"
default="0 * * * * /usr/share/AdGuardHome/addhost.sh"
[ "$enabled" == "0" ] || [ "${crontab//autohost/}" == "$crontab" ] && cronenable=0 || cronenable=1
@ -605,7 +577,6 @@ do_crontab(){
[ "$cronreload" -gt 0 ] && /etc/init.d/cron restart
#[ "$commit" -gt 0 ] && uci commit AdGuardHome
}
crontab_editor(){
#usage input:
#findstr=
@ -615,7 +586,7 @@ crontab_editor(){
#output:cronreload:if >1 please /etc/init.d/cron restart manual
local testline reload
local line="$(grep "$findstr" $CRON_FILE)"
[ -n "$replace" ] && [ -n "$line" ] && eval testline="\${line//$replace}" && [ "$testline" != "$line" ] && line="$testline" && reload="1" && replace=""
[ -n "$replace" ] && [ -n "$line" ] && eval testline="\${line//$replace}" && [ "$testline" != "$line" ] && line="$testline" && reload="1" && replace=""
if [ "${line:0:1}" != "#" ]; then
if [ $cronenable -eq 1 ]; then
[ -z "$line" ] && line="$default" && reload="1"
@ -639,4 +610,5 @@ crontab_editor(){
echo "$line" >> $CRON_FILE
fi
fi
}

View File

@ -1,5 +1,4 @@
#!/bin/sh
checkmd5(){
local nowmd5=$(md5sum /etc/hosts)
nowmd5=${nowmd5%% *}
@ -10,7 +9,6 @@ if [ "$nowmd5" != "$lastmd5" ]; then
[ "$1" == "noreload" ] || /etc/init.d/AdGuardHome reload
fi
}
[ "$1" == "del" ] && sed -i '/programaddstart/,/programaddend/d' /etc/hosts && checkmd5 "$2" && exit 0
/usr/bin/awk 'BEGIN{
while ((getline < "/tmp/dhcp.leases") > 0)
@ -32,4 +30,4 @@ else
cat /tmp/tmphost >> /etc/hosts
fi
rm /tmp/tmphost
checkmd5 "$2"
checkmd5 "$2"

View File

@ -1,5 +1,4 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
logread -e AdGuardHome > /tmp/AdGuardHometmp.log
logread -e AdGuardHome -f >> /tmp/AdGuardHometmp.log &
@ -17,4 +16,4 @@ do
else
echo "0">/var/run/AdGuardHomesyslog
fi
done
done

View File

@ -1,7 +1,5 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
checkmd5(){
local nowmd5=$(md5sum /tmp/adguard.list 2>/dev/null)
nowmd5=${nowmd5%% *}
@ -12,7 +10,6 @@ if [ "$nowmd5" != "$lastmd5" ]; then
[ "$1" == "noreload" ] || /etc/init.d/AdGuardHome reload
fi
}
configpath=$(uci get AdGuardHome.AdGuardHome.configpath 2>/dev/null)
[ "$1" == "del" ] && sed -i '/programaddstart/,/programaddend/d' $configpath && checkmd5 "$2" && exit 0
gfwupstream=$(uci get AdGuardHome.AdGuardHome.gfwupstream 2>/dev/null)
@ -23,7 +20,7 @@ if [ ! -f "$configpath" ]; then
echo "please make a config first"
exit 1
fi
wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O- | base64 -d > /tmp/gfwlist.txt
wget --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=="!")
@ -86,4 +83,4 @@ else
sed -i '/upstream_dns:/'r/tmp/adguard.list $configpath
fi
checkmd5 "$2"
rm -f /tmp/gfwlist.txt /tmp/adguard.list
rm -f /tmp/gfwlist.txt /tmp/adguard.list

View File

@ -1,3 +1,3 @@
https://static.adguard.com/adguardhome/beta/AdGuardHome_linux_${Arch}.tar.gz
https://github.com/AdguardTeam/AdGuardHome/releases/download/${latest_ver}/AdGuardHome_linux_${Arch}.tar.gz
https://static.adguard.com/adguardhome/release/AdGuardHome_linux_${Arch}.tar.gz
#https://github.com/AdguardTeam/AdGuardHome/releases/download/${latest_ver}/AdGuardHome_linux_${Arch}.tar.gz
#https://static.adguard.com/adguardhome/beta/AdGuardHome_linux_${Arch}.tar.gz

View File

@ -1,5 +1,4 @@
#!/bin/sh
tail -n $1 "$2" > /var/run/tailtmp
cat /var/run/tailtmp > "$2"
rm /var/run/tailtmp
rm /var/run/tailtmp

View File

@ -1,5 +1,4 @@
#!/bin/bash
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
binpath=$(uci get AdGuardHome.AdGuardHome.binpath)
if [ -z "$binpath" ]; then
@ -16,13 +15,12 @@ check_if_already_running(){
check_wgetcurl(){
which curl && downloader="curl -L -k --retry 2 --connect-timeout 20 -o" && return
which wget-ssl && downloader="wget-ssl --no-check-certificate -t 2 -T 20 -O" && return
which wget && downloader="wget --no-check-certificate -t 2 -T 20 -O" && return
[ -z "$1" ] && opkg update || (echo error opkg && EXIT 1)
[ -z "$1" ] && (opkg remove wget wget-nossl --force-depends ; opkg install wget ; check_wgetcurl 1 ;return)
[ "$1" == "1" ] && (opkg install curl ; check_wgetcurl 2 ; return)
echo error curl and wget && EXIT 1
}
check_latest_version(){
check_wgetcurl
latest_ver="$($downloader - https://api.github.com/repos/AdguardTeam/AdGuardHome/releases/latest 2>/dev/null|grep -E 'tag_name' |grep -E 'v[0-9.]+' -o 2>/dev/null)"
@ -31,79 +29,78 @@ check_latest_version(){
fi
now_ver="$($binpath -c /dev/null --check-config 2>&1| grep -m 1 -E 'v[0-9.]+' -o)"
if [ "${latest_ver}"x != "${now_ver}"x ] || [ "$1" == "force" ]; then
echo -e "Local version: ${now_ver}., cloud version: ${latest_ver}."
echo -e "Local version: ${now_ver}., cloud version: ${latest_ver}."
doupdate_core
else
echo -e "\nLocal version: ${now_ver}, cloud version: ${latest_ver}."
echo -e "You're already using the latest version."
if [ ! -z "$upxflag" ]; then
filesize=$(ls -l $binpath | awk '{ print $5 }')
if [ $filesize -gt 8000000 ]; then
echo -e "start upx may take a long time"
doupx
mkdir -p "/tmp/AdGuardHomeupdate/AdGuardHome" >/dev/null 2>&1
rm -fr /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx $upxflag $binpath -o /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
rm -rf /tmp/upx-${upx_latest_ver}-${Arch}_linux
/etc/init.d/AdGuardHome stop nobackup
rm $binpath
mv -f /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/} $binpath
/etc/init.d/AdGuardHome start
echo -e "finished"
echo -e "\nLocal version: ${now_ver}, cloud version: ${latest_ver}."
echo -e "You're already using the latest version."
if [ ! -z "$upxflag" ]; then
filesize=$(ls -l $binpath | awk '{ print $5 }')
if [ $filesize -gt 8000000 ]; then
echo -e "start upx may take a long time"
doupx
mkdir -p "/tmp/AdGuardHomeupdate/AdGuardHome" >/dev/null 2>&1
rm -fr /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx $upxflag $binpath -o /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
rm -rf /tmp/upx-${upx_latest_ver}-${Arch}_linux
/etc/init.d/AdGuardHome stop nobackup
rm $binpath
mv -f /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/} $binpath
/etc/init.d/AdGuardHome start
echo -e "finished"
fi
fi
fi
EXIT 0
EXIT 0
fi
}
doupx(){
Archt="$(opkg info kernel | grep Architecture | awk -F "[ _]" '{print($2)}')"
case $Archt in
"i386")
Arch="i386"
;;
Arch="i386"
;;
"i686")
Arch="i386"
echo -e "i686 use $Arch may have bug"
;;
Arch="i386"
echo -e "i686 use $Arch may have bug"
;;
"x86")
Arch="amd64"
;;
Arch="amd64"
;;
"mipsel")
Arch="mipsel"
;;
Arch="mipsel"
;;
"mips64el")
Arch="mips64el"
Arch="mipsel"
echo -e "mips64el use $Arch may have bug"
;;
Arch="mips64el"
Arch="mipsel"
echo -e "mips64el use $Arch may have bug"
;;
"mips")
Arch="mips"
;;
Arch="mips"
;;
"mips64")
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
"arm")
Arch="arm"
;;
Arch="arm"
;;
"armeb")
Arch="armeb"
;;
Arch="armeb"
;;
"aarch64")
Arch="arm64"
;;
Arch="arm64"
;;
"powerpc")
Arch="powerpc"
;;
Arch="powerpc"
;;
"powerpc64")
Arch="powerpc64"
;;
Arch="powerpc64"
;;
*)
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
esac
upx_latest_ver="$($downloader - https://api.github.com/repos/upx/upx/releases/latest 2>/dev/null|grep -E 'tag_name' |grep -E '[0-9.]+' -o 2>/dev/null)"
$downloader /tmp/upx-${upx_latest_ver}-${Arch}_linux.tar.xz "https://github.com/upx/upx/releases/download/v${upx_latest_ver}/upx-${upx_latest_ver}-${Arch}_linux.tar.xz" 2>&1
@ -112,65 +109,64 @@ doupx(){
mkdir -p /tmp/upx-${upx_latest_ver}-${Arch}_linux
xz -d -c /tmp/upx-${upx_latest_ver}-${Arch}_linux.tar.xz| tar -x -C "/tmp" >/dev/null 2>&1
if [ ! -e "/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx" ]; then
echo -e "Failed to download upx."
echo -e "Failed to download upx."
EXIT 1
fi
rm /tmp/upx-${upx_latest_ver}-${Arch}_linux.tar.xz
}
doupdate_core(){
echo -e "Updating core..."
echo -e "Updating core..."
mkdir -p "/tmp/AdGuardHomeupdate"
rm -rf /tmp/AdGuardHomeupdate/* >/dev/null 2>&1
Archt="$(opkg info kernel | grep Architecture | awk -F "[ _]" '{print($2)}')"
case $Archt in
"i386")
Arch="386"
;;
Arch="386"
;;
"i686")
Arch="386"
;;
Arch="386"
;;
"x86")
Arch="amd64"
;;
Arch="amd64"
;;
"mipsel")
Arch="mipsle"
;;
Arch="mipsle"
;;
"mips64el")
Arch="mips64le"
Arch="mipsle"
echo -e "mips64el use $Arch may have bug"
;;
Arch="mips64le"
Arch="mipsle"
echo -e "mips64el use $Arch may have bug"
;;
"mips")
Arch="mips"
;;
Arch="mips"
;;
"mips64")
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
"arm")
Arch="arm"
;;
Arch="arm"
;;
"aarch64")
Arch="arm64"
;;
Arch="arm64"
;;
"powerpc")
Arch="ppc"
echo -e "error not support $Archt"
EXIT 1
;;
Arch="ppc"
echo -e "error not support $Archt"
EXIT 1
;;
"powerpc64")
Arch="ppc64"
echo -e "error not support $Archt"
EXIT 1
;;
Arch="ppc64"
echo -e "error not support $Archt"
EXIT 1
;;
*)
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
esac
echo -e "start download"
echo -e "start download"
grep -v "^#" /usr/share/AdGuardHome/links.txt >/tmp/run/AdHlinks.txt
while read link
do
@ -182,14 +178,14 @@ doupdate_core(){
else
local success="1"
break
fi
fi
done < "/tmp/run/AdHlinks.txt"
rm /tmp/run/AdHlinks.txt
[ -z "$success" ] && echo "no download success" && EXIT 1
if [ "${link##*.}" == "gz" ]; then
tar -zxf "/tmp/AdGuardHomeupdate/${link##*/}" -C "/tmp/AdGuardHomeupdate/"
if [ ! -e "/tmp/AdGuardHomeupdate/AdGuardHome" ]; then
echo -e "Failed to download core."
echo -e "Failed to download core."
rm -rf "/tmp/AdGuardHomeupdate" >/dev/null 2>&1
EXIT 1
fi
@ -198,35 +194,34 @@ doupdate_core(){
downloadbin="/tmp/AdGuardHomeupdate/${link##*/}"
fi
chmod 755 $downloadbin
echo -e "download success start copy"
echo -e "download success start copy"
if [ -n "$upxflag" ]; then
echo -e "start upx may take a long time"
echo -e "start upx may take a long time"
doupx
/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx $upxflag $downloadbin
rm -rf /tmp/upx-${upx_latest_ver}-${Arch}_linux
fi
echo -e "start copy"
echo -e "start copy"
/etc/init.d/AdGuardHome stop nobackup
rm "$binpath"
mv -f "$downloadbin" "$binpath"
if [ "$?" == "1" ]; then
echo "mv failed maybe not enough space please use upx or change bin to /tmp/AdGuardHome"
echo "mv failed maybe not enough space please use upx or change bin to /tmp/AdGuardHome"
EXIT 1
fi
/etc/init.d/AdGuardHome start
rm -rf "/tmp/AdGuardHomeupdate" >/dev/null 2>&1
echo -e "Succeeded in updating core."
echo -e "Local version: ${latest_ver}, cloud version: ${latest_ver}.\n"
echo -e "Succeeded in updating core."
echo -e "Local version: ${latest_ver}, cloud version: ${latest_ver}.\n"
EXIT 0
}
EXIT(){
rm /var/run/update_core 2>/dev/null
[ "$1" != "0" ] && touch /var/run/update_core_error
exit $1
}
main(){
check_if_already_running
check_latest_version $1
}

View File

@ -1,5 +1,4 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
count=0
while :
@ -32,4 +31,4 @@ do
break
fi
done
return 0
return 0

View File

@ -1,5 +1,4 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
configpath=$(uci get AdGuardHome.AdGuardHome.configpath)
while :
@ -10,4 +9,4 @@ do
break
fi
done
return 0
return 0

View File

@ -19,6 +19,6 @@ PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=chenhw2 <https://github.com/chenhw2/>
include ../../luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -11,7 +11,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LuCI
SUBMENU:=2. Clash For OpenWRT
TITLE:=LuCI app for clash
DEPENDS:=+luci-base +wget +iptables +coreutils-base64 +coreutils +coreutils-nohup +bash +ipset +libustream-openssl +curl +jsonfilter +ca-certificates +iptables-mod-tproxy +kmod-tun
DEPENDS:=+luci-base +wget +iptables +coreutils-base64 +coreutils +coreutils-nohup +bash +ipset +libustream-openssl +curl +jsonfilter +ca-bundle +iptables-mod-tproxy +kmod-tun
PKGARCH:=all
MAINTAINER:=frainzy1477
endef

View File

@ -16,6 +16,6 @@ LUCI_PKGARCH:=all
PKG_MAINTAINER:=ImmortalWrt
include ../../luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -18,7 +18,7 @@ define Package/$(PKG_NAME)
SUBMENU:=3. Applications
TITLE:=LuCI support for clash
PKGARCH:=all
DEPENDS:=+iptables +dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-certificates +ipset +ip-full +iptables-mod-tproxy +iptables-mod-extra +libcap +ruby +ruby-yaml
DEPENDS:=+iptables +dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-bundle +ipset +ip-full +iptables-mod-tproxy +iptables-mod-extra +libcap +ruby +ruby-yaml
MAINTAINER:=vernesong
endef

View File

@ -21,6 +21,6 @@ help
Version: $(PKG_VERSION)-$(PKG_RELEASE)
endef
include ../../luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -20,6 +20,6 @@ PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
include ../../luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -6,7 +6,7 @@ PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/rofl0r/microsocks/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=5ece77c283e71f73b9530da46302fdb4f72a0ae139aa734c07fe532407a6211a
PKG_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING

View File

@ -10,7 +10,7 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=091fa8129f390cc90530f92b0e9c90f1e7bb131f3f9e5bcda192a782bf7af19e
PKG_HASH:=skip
PKG_LICENSE:=BSD 3-Clause
PKG_LICENSE_FILES:=LICENSE

View File

@ -6,7 +6,7 @@ PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shadowsocks/pdnsd.git
PKG_MIRROR_HASH:=c4093a2a21cc44228f4fad536c3303e5d263f400b5ca6ec04fe17bb705f5b92e
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=a8e46ccba7b0fa2230d6c42ab6dcd92926f6c21d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

View File

@ -18,7 +18,7 @@ PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
PKG_HASH:=cfc8eded35360f4b67e18dc447b0c00cddb29cc57a3cec48b135e5fb87433488
PKG_HASH:=skip
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>

View File

@ -21,41 +21,41 @@ PKG_SOURCE_URL:=https://github.com/shell-script/openwrt-shadowsocks-rust/release
ifeq ($(ARCH),aarch64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=5bcacf189fe1bf87cff5984b71f33d9dceeb0f510fc4661dee70c830278d816f
PKG_HASH:=skip
else ifeq ($(ARCH),arm)
# Referred to golang/golang-values.mk
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
ifeq ($(ARM_CPU_FEATURES),)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabi.$(PKG_SOURCE_FOOTER)
PKG_HASH:=d8e7ca4f5ca1fe035bca61d3e6f9cadbb116e79d5808592d7e5ddf517f253fbb
PKG_HASH:=skip
else ifneq ($(filter $(ARM_CPU_FEATURES),vfp vfpv2),)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER)
PKG_HASH:=2d40dc6d3f6b4a4d1887d718f91db06de33bb61423ad99d0ee06607ba16a652a
PKG_HASH:=skip
else
PKG_SOURCE:=$(PKG_SOURCE_HEADER).armv7-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER)
PKG_HASH:=b66194cd5dd8eee5111bedceea24472a39b2dc3fb8b8dfaeae7a2a6d591c70ff
PKG_HASH:=skip
endif
else ifeq ($(ARCH),i386)
ifeq ($(CONFIG_TARGET_x86_geode)$(CONFIG_TARGET_x86_legacy),y)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).i586-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=b1f3cbace5e6d47b02e4bbcf8432b61a498acca7d161cff4a49292612316cf8d
PKG_HASH:=skip
else
PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=42724898a36f63876ed9037d12b434ef4f409095821493b601661803dd05edd7
PKG_HASH:=skip
endif
else ifeq ($(ARCH),mips)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=6234f30b0bcc550bbf7e8a63a6d07c6f295973e5cee8ba2dce7004869e138fb6
PKG_HASH:=skip
else ifeq ($(ARCH),mipsel)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=b0672aa0fb545e7a8742abd9a0013dcd56fc5efc243fb5a4b14945805af7b450
PKG_HASH:=skip
else ifeq ($(ARCH),x86_64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=cab8a9853b29a96752a38ef774b7fd07d85c60a0387866b19b215a654a989850
PKG_HASH:=skip
# Set the default value to make OpenWrt Package Checker happy
else
PKG_SOURCE:=dummy
PKG_HASH:=dummy
PKG_HASH:=skip
endif
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>

View File

@ -14,7 +14,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shadowsocksrr/shadowsocksr-libev
PKG_SOURCE_DATE:=2018-03-07
PKG_SOURCE_VERSION:=d63ff863800a5645aca4309d5dd5962bd1e95543
PKG_MIRROR_HASH:=34308ed827a5dd4f4e35619914102d55b00604faa44fda051d1d25fb4a319325
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE

View File

@ -13,7 +13,7 @@ PKG_RELEASE:=4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shadowsocks/simple-obfs.git
PKG_MIRROR_HASH:=ea8f2b9825bbb87d5d860524e29bade265141687338db2dbf7ecd32690cf02fc
PKG_MIRROR_HASH:=skip
PKG_SOURCE_VERSION:=486bebd9208539058e57e23a12f23103016e09b4
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

View File

@ -11,7 +11,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://www.github.com/pymumu/smartdns.git
PKG_SOURCE_VERSION:=f50e4dd0813da9300580f7188e44ed72a27ae79c
PKG_MIRROR_HASH:=b4d825a48884101f647cd594f00b714a2d09ac419b958ee0317d302fd31b0038
PKG_MIRROR_HASH:=skip
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
PKG_LICENSE:=GPL-3.0-or-later

View File

@ -11,7 +11,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/tostercx/ssocks.git
PKG_MIRROR_HASH:=0ce65cb7aaea78c97bba9d62af3b40ed0d422938f67cb44a24d522608cfd097c
PKG_MIRROR_HASH:=skip
PKG_SOURCE_VERSION:=c2024789c1ee076d171fd6061d7c133302216ea7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz

View File

@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=license.txt
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Lienol/tcping
PKG_MIRROR_HASH:=79414cd8e1d124422a36b8fe36a1f296b7d9bde99807b2c90ad81bbd65e200e0
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=db9101834732dac9aaa59dbb7fb9c74612dbf723
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

View File

@ -11,7 +11,7 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/p4gefau1t/trojan-go/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=925f02647dda944813f1eab0b71eac98b83eb5964ef5a6f63e89bc7eb4486c1f
PKG_HASH:=skip
PKG_CONFIG_DEPENDS:= \
CONFIG_TROJAN_GO_COMPRESS_GOPROXY \

View File

@ -14,7 +14,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/peter-tank/trojan-plus.git
PKG_SOURCE_DATE:=2020-09-06
PKG_SOURCE_VERSION:=a6394cdd718669b0c7491493a78e61f6f0f899b3
PKG_MIRROR_HASH:=2d37d09fe6d39d7981116ad387706f58f2b30b74a34e27fc5608f267dacc9208
PKG_MIRROR_HASH:=skip
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=openssl

View File

@ -12,7 +12,7 @@ PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/trojan-gfw/trojan/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=86cdb2685bb03a63b62ce06545c41189952f1ec4a0cd9147450312ed70956cbc
PKG_HASH:=skip
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=openssl

View File

@ -13,7 +13,7 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/wangyu-/udp2raw-tunnel/tar.gz/$(PKG_VERSION)?
PKG_HASH:=712b0cb819555cb374206e95005b0ca6b4af86c74d572e0570630f67dfeea313
PKG_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

View File

@ -10,7 +10,7 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=70ffcb2719dd4d692266de75d40009d94a1374ced72546fbd9b0dba33b9bb3ea
PKG_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

View File

@ -14,7 +14,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=e7fabd609b37e87cdf40a191c154802660faec9b6357331ee71988a2757fff31
PKG_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
@ -51,7 +51,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Network
TITLE:=SIP003 plugin for shadowsocks, based on v2ray
URL:=https://github.com/teddysun/v2ray-plugin
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
define Package/$(PKG_NAME)/description

View File

@ -6,11 +6,11 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=54c6a687dd463b25afe8d8eb44d37e18b8177f58308207cd1d74f6cd04619854
PKG_HASH:=skip
#PKG_SOURCE_PROTO:=git
#PKG_SOURCE_URL:=https://github.com/XTLS/xray-core.git
#PKG_MIRROR_HASH:=19f3017d8279acc28d242d18689b95a39ca00a286e72329552d114f04a861ecb
#PKG_MIRROR_HASH:=skip
#PKG_SOURCE_VERSION:=c345d4818efa763b07961d6c132afe1cf91845de
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

View File

@ -14,7 +14,7 @@ PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/xray-plugin/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=a4483fa0e3071935da8b8bd19a9a6b349fc2c221ba2fe777ff2131915debb607
PKG_HASH:=skip
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE