smartdns1.2020.30

This commit is contained in:
SirPdboy 2021-09-08 10:30:18 +08:00 committed by GitHub
parent 448d95d514
commit a2249aeba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 61 additions and 81 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
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
PKG_VERSION:=1.2020.30
PKG_RELEASE:=1
LUCI_TITLE:=LuCI for smartdns
LUCI_DESCRIPTION:=Provides Luci for smartdns
LUCI_DEPENDS:=+smartdns
LUCI_PKGARCH:=all
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

@ -68,7 +68,7 @@ function act_status()
end
elseif e.redirect == 2 then
local str;
local dnsmasq_server = luci.sys.exec("uci -q get dhcp.@dnsmasq[0].server")
local dnsmasq_server = luci.sys.exec("uci get dhcp.@dnsmasq[0].server")
if e.local_port ~= nil then
str = "127.0.0.1#" .. e.local_port
if string.sub(dnsmasq_server,1,string.len(str)) == str then

View File

@ -83,8 +83,9 @@ 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.cfgvalue = function(...)
@ -127,8 +128,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
@ -147,7 +148,6 @@ o.placeholder = "default"
o.datatype = "hostname"
o.rempty = true
---- skip speed test
o = s:taboption("seconddns", Flag, "seconddns_no_speed_check", translate("Skip Speed Check"), translate("Do not check speed."))
o.rmempty = false
o.default = o.disabled
@ -257,8 +257,7 @@ s:option(Value, "name", translate("DNS Server Name"), translate("DNS Server Name
---- IP address
o = s:option(Value, "ip", translate("ip"), translate("DNS Server ip"))
o.datatype = "or(ipaddr, string)"
o.rmempty = false
o.rmempty = false
---- port
o = s:option(Value, "port", translate("port"), translate("DNS Server port"))
o.placeholder = "default"
@ -278,13 +277,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 +301,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 +317,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
@ -344,3 +339,4 @@ o.write = function()
end
return m

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
@ -120,7 +110,6 @@ o.rempty = true
o:depends("type", "tls")
o:depends("type", "https")
---- other args
o = s:option(Value, "addition_arg", translate("Additional Server Args"), translate("Additional Args for upstream dns servers"))
o.default = ""

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的过期记录以避免查询等待。"
@ -172,12 +181,6 @@ msgstr "跳过cache"
msgid "Skip Cache."
msgstr "跳过cache。"
msgid "Force AAAA SOA"
msgstr "停用IPV6地址解析"
msgid "Force AAAA SOA."
msgstr "停用IPV6地址解析。"
msgid "Upstream Servers"
msgstr "上游服务器"
@ -211,12 +214,6 @@ msgstr "校验TLS主机名"
msgid "Set TLS hostname to verify."
msgstr "设置校验TLS主机名。"
msgid "No check certificate"
msgstr "停用证书校验"
msgid "Do not check certificate."
msgstr "不校验证书的合法性。"
msgid "TLS SNI name"
msgstr "TLS SNI名称"

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]