up2022-06-26 smartdns

This commit is contained in:
SirPdboy 2022-08-17 16:22:02 +08:00 committed by GitHub
parent afbbbfa546
commit 393b24df8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 117 additions and 70 deletions

View File

@ -1,14 +1,25 @@
# This is free software, licensed under the Apache License, Version 2.0 .
#
# Copyright 2018-2020 Nick Peng <pymumu@gmail.com>
# Licensed to the public under the GPL V3 License.
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Luci for smartdns server
LUCI_TITLE:=LuCI for smartdns
LUCI_DESCRIPTION:=Provides Luci for smartdns
LUCI_DEPENDS:=+smartdns
LUCI_PKGARCH:=all
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
PKG_VERSION:=1.2020.30
PKG_RELEASE:=1
PKG_DATE:=2022-06-26
PKG_NAME:=luci-app-smartdns
PKG_VERSION:=1
PKG_RELEASE:=3
define Package/$(PKG_NAME)/config
# shown in make menuconfig <Help>
help
$(LUCI_TITLE)
Version: $(PKG_VERSION)-$(PKG_RELEASE)
endef
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -1,5 +1,5 @@
--
-- Copyright (C) 2018-2020 Ruilin Peng (Nick) <pymumu@gmail.com>.
-- Copyright (C) 2018-2022 Ruilin Peng (Nick) <pymumu@gmail.com>.
--
-- smartdns is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@ -70,7 +70,7 @@ end
---- Support DualStack ip selection
o = s:taboption("settings", Flag, "dualstack_ip_selection", translate("Dual-stack IP Selection"), translate("Enable IP selection between IPV4 and IPV6"))
o.rmempty = false
o.default = o.disabled
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
@ -83,10 +83,11 @@ o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
---- Serve expired
o = s:taboption("settings", Flag, "serve_expired", translate("Serve expired"), translate("Attempts to serve old responses from cache with a TTL of 0 in the response without waiting for the actual resolution to finish."))
---- Domain Serve expired
o = s:taboption("settings", Flag, "serve_expired", translate("Serve expired"),
translate("Attempts to serve old responses from cache with a TTL of 0 in the response without waiting for the actual resolution to finish."))
o.rmempty = false
o.default = o.disabled
o.default = o.enabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
@ -102,24 +103,74 @@ o.rempty = false
---- cache-size
o = s:taboption("settings", Value, "cache_size", translate("Cache Size"), translate("DNS domain result cache size"))
o.placeholder = "512"
o.default = 512
o.rempty = true
---- rr-ttl
o = s:taboption("settings", Value, "rr_ttl", translate("Domain TTL"), translate("TTL for all domain result."))
o.placeholder = "600"
o.default = 600
o.rempty = true
---- rr-ttl-min
o = s:taboption("settings", Value, "rr_ttl_min", translate("Domain TTL Min"), translate("Minimum TTL for all domain result."))
o.rempty = true
o.placeholder = "300"
o.default = 300
o.placeholder = "60"
o.default = 60
o.optional = true
---- second dns server
---- rr-ttl-max
o = s:taboption("settings", Value, "rr_ttl_max", translate("Domain TTL Max"), translate("Maximum TTL for all domain result."))
o.placeholder = "600"
o.default = 600
o.rempty = true
---- rr-ttl-reply-max
o = s:taboption("settings", Value, "rr_ttl_reply_max", translate("Domain Reply TTL Max"), translate("Maximum Reply TTL for all domain result."))
o.placeholder = "60"
o.default = 60
o.rempty = true
---- max-reply-ip-num
o = s:taboption("settings", Value, "max_reply_ip_num", translate("Max Reply IP Num"), translate("Maximum number of IPs returned to the client"))
o.datatype = "range(1,16)"
o.default = 1
o.rempty = true
---- log-level
o = s:taboption("settings", ListValue, "log_level", translate("log level"))
o:value("fatal", translate("fatal"))
o:value("error", translate("error"))
o:value("warn", translate("warn"))
o:value("notice", translate("notice"))
o:value("info", translate("info"))
o:value("debug", translate("debug"))
o.default = "error"
o.rempty = false
---- log-size
o = s:taboption("settings", ListValue, "log_size", translate("log size"))
o:value("128k")
o:value("256k")
o:value("512k")
o:value("1024k")
o.default = "128k"
o.rempty = false
---- log-num
o = s:taboption("settings", Value, "log_num", translate("log num"))
o.datatype = "range(1,9)"
o.default = 2
o.rempty = true
---- log-file
o = s:taboption("settings", Value, "log_file", translate("log file"))
o.placeholder = translate("/var/log/smartdns.log")
o.default = "/var/log/smartdns.log"
o.rempty = true
---- second dns server
---- Eanble
o = s:taboption("seconddns", Flag, "seconddns_enabled", translate("Enable"), translate("Enable or disable second DNS server."))
o.default = o.disabled
@ -127,8 +178,8 @@ o.rempty = false
---- Port
o = s:taboption("seconddns", Value, "seconddns_port", translate("Local Port"), translate("Smartdns local server port"))
o.placeholder = 7053
o.default = 7053
o.placeholder = 6553
o.default = 6553
o.datatype = "port"
o.rempty = false
@ -278,13 +329,14 @@ o:value("https", translate("https"))
o.default = "udp"
o.rempty = false
-- Doman addresss
s = m:section(TypedSection, "smartdns", translate("Domain Address"),
translate("Set Specific domain ip address."))
s.anonymous = true
s = m:section(TypedSection, "smartdns", translate("Advanced Settings"), translate("Advanced Settings"));
s.anonymous = true;
---- address
addr = s:option(Value, "address",
s:tab("domain-address", translate("Domain Address"), translate("Set Specific domain ip address."));
s:tab("blackip-list", translate("IP Blacklist"), translate("Set Specific ip blacklist."));
-- Doman addresss
addr = s:taboption("domain-address", Value, "address",
translate(""),
translate("Specify an IP address to return for any host in the given domains, Queries in the domains are never forwarded and always replied to with the specified IP address which may be IPv4 or IPv6."))
@ -301,12 +353,7 @@ function addr.write(self, section, value)
end
-- IP Blacklist
s = m:section(TypedSection, "smartdns", translate("IP Blacklist"),
translate("Set Specific ip blacklist."))
s.anonymous = true
---- blacklist
addr = s:option(Value, "blacklist_ip",
addr = s:taboption("blackip-list", Value, "blacklist_ip",
translate(""),
translate("Configure IP blacklists that will be filtered from the results of specific DNS server."))
@ -322,7 +369,7 @@ function addr.write(self, section, value)
nixio.fs.writefile("/etc/smartdns/blacklist-ip.conf", value)
end
-- Doman addresss
-- Technical Support
s = m:section(TypedSection, "smartdns", translate("Technical Support"),
translate("If you like this software, please buy me a cup of coffee."))
s.anonymous = true

View File

@ -55,6 +55,21 @@ o:value("https", translate("https"))
o.default = "udp"
o.rempty = false
---- server group
o = s:option(Value, "server_group", translate("Server Group"), translate("DNS Server group belongs to, used with nameserver, such as office, home."))
o.rmempty = true
o.placeholder = "default"
o.datatype = "hostname"
o.rempty = true
---- blacklist_ip
o = s:option(Flag, "blacklist_ip", translate("IP Blacklist Filtering"), translate("Filtering IP with blacklist"))
o.rmempty = false
o.default = o.disabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
---- TLS host verify
o = s:option(Value, "tls_host_verify", translate("TLS Hostname Verify"), translate("Set TLS hostname to verify."))
o.default = ""
@ -63,16 +78,6 @@ o.rempty = true
o:depends("type", "tls")
o:depends("type", "https")
---- Certificate verify
o = s:option(Flag, "no_check_certificate", translate("No check certificate"), translate("Do not check certificate."))
o.default = o.disabled
o.rmempty = false
o:depends("type", "tls")
o:depends("type", "https")
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
---- SNI host name
o = s:option(Value, "host_name", translate("TLS SNI name"), translate("Sets the server name indication for query."))
o.default = ""
@ -88,21 +93,6 @@ o.datatype = "hostname"
o.rempty = true
o:depends("type", "https")
---- server group
o = s:option(Value, "server_group", translate("Server Group"), translate("DNS Server group belongs to, used with nameserver, such as office, home."))
o.rmempty = true
o.placeholder = "default"
o.datatype = "hostname"
o.rempty = true
---- blacklist_ip
o = s:option(Flag, "blacklist_ip", translate("IP Blacklist Filtering"), translate("Filtering IP with blacklist"))
o.rmempty = false
o.default = o.disabled
o.cfgvalue = function(...)
return Flag.cfgvalue(...) or "0"
end
---- anti-Answer-Forgery
-- o = s:option(Flag, "check_edns", translate("Anti Answer Forgery"), translate("Anti answer forgery, if DNS does not work properly after enabling, please turn off this feature"))
-- o.rmempty = false

View File

@ -11,11 +11,20 @@ msgid "SmartDNS Server"
msgstr "SmartDNS 服务器"
msgid "SmartDNS is a local high-performance DNS server, supports finding fastest IP, supports ad filtering, and supports avoiding DNS poisoning."
msgstr "SmartDNS是一个本地高性能DNS服务器支持避免域名污染,支持返回最快IP支持广告过滤。"
msgstr "SmartDNS是一个本地高性能DNS服务器支持返回最快IP支持广告过滤。"
msgid "Custom Settings"
msgstr "自定义设置"
msgid "General Settings"
msgstr "基本设置"
msgid "Settings"
msgstr "设置"
msgid "Advanced Settings"
msgstr "高级设置"
msgid "Generate Coredump"
msgstr "生成coredump"
@ -74,7 +83,7 @@ msgid "Enable domain prefetch, accelerate domain response speed."
msgstr "启用域名预加载,加速域名响应速度。"
msgid "Serve expired"
msgstr "缓存过期服务"
msgstr "过期缓存服务"
msgid "Attempts to serve old responses from cache with a TTL of 0 in the response without waiting for the actual resolution to finish."
msgstr "查询性能优化有请求时尝试回应TTL为0的过期记录以避免查询等待。"
@ -115,6 +124,9 @@ msgstr "域名TTL最大值"
msgid "Maximum TTL for all domain result."
msgstr "设置所有域名的TTL最大值"
msgid "Maximum Reply TTL for all domain result."
msgstr "设置返回给客户端的TTL最大值"
msgid "smartdns custom settings"
msgstr "smartdns 自定义设置,具体配置参数参考指导"

View File

@ -1,19 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2020 Ruilin Peng (Nick) <pymumu@gmail.com>.
#
# smartdns is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# smartdns is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Copyright 2018-2020 Nick Peng <pymumu@gmail.com>
# Licensed to the public under the GPL V3 License.
uci -q batch <<-EOF >/dev/null
delete ucitrack.@smartdns[-1]