mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-07 07:06:41 +08:00
Added luci-app-smartdns to go with the smartdns (#227)
This commit is contained in:
parent
50f422530c
commit
72213cff27
38
applications/luci-app-smartdns/Makefile
Normal file
38
applications/luci-app-smartdns/Makefile
Normal file
@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright (C) 2018-2023 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/>.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
|
||||
PKG_VERSION:=1.2023.42
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI for smartdns
|
||||
LUCI_DESCRIPTION:=Provides Luci for smartdns
|
||||
LUCI_DEPENDS:=+smartdns +luci-compat
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
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
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
@ -0,0 +1,57 @@
|
||||
--
|
||||
-- Copyright (C) 2018-2023 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/>.
|
||||
|
||||
module("luci.controller.smartdns", package.seeall)
|
||||
local smartdns = require "luci.model.smartdns"
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/smartdns") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
page = entry({"admin", "services", "smartdns"}, cbi("smartdns/smartdns"), _("SmartDNS"), 60)
|
||||
page.dependent = true
|
||||
page = entry({"admin", "services", "smartdns", "status"}, call("act_status"))
|
||||
page.leaf = true
|
||||
page = entry({"admin", "services", "smartdns", "upstream"}, cbi("smartdns/upstream"), nil)
|
||||
page.leaf = true
|
||||
end
|
||||
|
||||
local function is_running()
|
||||
return luci.sys.call("pidof smartdns >/dev/null") == 0
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
local ipv6_server;
|
||||
local dnsmasq_server = smartdns.get_config_option("dhcp", "dnsmasq", "server", {nil})[1]
|
||||
local auto_set_dnsmasq = smartdns.get_config_option("smartdns", "smartdns", "auto_set_dnsmasq", nil);
|
||||
|
||||
e.auto_set_dnsmasq = auto_set_dnsmasq
|
||||
e.dnsmasq_server = dnsmasq_server
|
||||
e.local_port = smartdns.get_config_option("smartdns", "smartdns", "port", nil);
|
||||
if e.local_port ~= nil and e.local_port ~= "53" and auto_set_dnsmasq ~= nil and auto_set_dnsmasq == "1" then
|
||||
local str;
|
||||
str = "127.0.0.1#" .. e.local_port
|
||||
if dnsmasq_server ~= str then
|
||||
e.dnsmasq_redirect_failure = 1
|
||||
end
|
||||
end
|
||||
e.running = is_running()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
@ -0,0 +1,783 @@
|
||||
--
|
||||
-- Copyright (C) 2018-2023 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/>.
|
||||
|
||||
require ("nixio.fs")
|
||||
require ("luci.http")
|
||||
require ("luci.dispatcher")
|
||||
require ("nixio.fs")
|
||||
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = Map("smartdns")
|
||||
m.title = translate("SmartDNS Server")
|
||||
m.description = translate("SmartDNS is a local high-performance DNS server, supports finding fastest IP, supports ad filtering, and supports avoiding DNS poisoning.")
|
||||
|
||||
m:section(SimpleSection).template = "smartdns/smartdns_status"
|
||||
|
||||
-- Basic
|
||||
s = m:section(TypedSection, "smartdns", translate("Settings"), translate("General Settings"))
|
||||
s.anonymous = true
|
||||
|
||||
s:tab("settings", translate("General Settings"))
|
||||
s:tab("advanced", translate('Advanced Settings'))
|
||||
s:tab("seconddns", translate("Second Server Settings"))
|
||||
s:tab("dns64", translate("DNS64 Server Settings"))
|
||||
s:tab("proxy", translate("Proxy Server Settings"))
|
||||
s:tab("custom", translate("Custom Settings"))
|
||||
|
||||
---- Eanble
|
||||
o = s:taboption("settings", Flag, "enabled", translate("Enable"), translate("Enable or disable smartdns server"))
|
||||
o.default = o.disabled
|
||||
o.rempty = false
|
||||
|
||||
---- server name
|
||||
o = s:taboption("settings", Value, "server_name", translate("Server Name"), translate("Smartdns server name"))
|
||||
o.default = "smartdns"
|
||||
o.datatype = "hostname"
|
||||
o.rempty = false
|
||||
|
||||
---- Port
|
||||
o = s:taboption("settings", Value, "port", translate("Local Port"),
|
||||
translate("Smartdns local server port, smartdns will be automatically set as main dns when the port is 53."))
|
||||
o.placeholder = 53
|
||||
o.default = 53
|
||||
o.datatype = "port"
|
||||
o.rempty = false
|
||||
|
||||
-- Automatically Set Dnsmasq
|
||||
o = s:taboption("settings", Flag, "auto_set_dnsmasq", translate("Automatically Set Dnsmasq"), translate("Automatically set as upstream of dnsmasq when port changes."))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- Speed check mode;
|
||||
o = s:taboption("advanced", Value, "speed_check_mode", translate("Speed Check Mode"), translate("Smartdns speed check mode."));
|
||||
o.rmempty = true;
|
||||
o.placeholder = "default";
|
||||
o.default = o.enabled;
|
||||
o:value("", translate("default"))
|
||||
o:value("ping,tcp:80,tcp:443");
|
||||
o:value("ping,tcp:443,tcp:80");
|
||||
o:value("tcp:80,tcp:443,ping");
|
||||
o:value("tcp:443,tcp:80,ping");
|
||||
o:value("none", translate("None"));
|
||||
function o.validate (section_id, value)
|
||||
if value == "" then
|
||||
return value
|
||||
end
|
||||
|
||||
if value == nil then
|
||||
return nil, translate("Speed check mode is invalid.")
|
||||
end
|
||||
|
||||
if value == "none" then
|
||||
return value
|
||||
end
|
||||
|
||||
local mode = value:split(",");
|
||||
for _, v in ipairs(mode) do repeat
|
||||
if v == "ping" then
|
||||
break
|
||||
end
|
||||
|
||||
if v == nil then
|
||||
return nil, translate("Speed check mode is invalid.")
|
||||
end
|
||||
|
||||
local port = v:split(":");
|
||||
if "tcp" == port[1] then
|
||||
if tonumber(port[2]) then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
return nil, translate("Speed check mode is invalid.")
|
||||
until true end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
---- response mode;
|
||||
o = s:taboption("advanced", ListValue, "response_mode", translate("Response Mode"),
|
||||
translate("Smartdns response mode, First Ping: return the first ping IP, Fastest IP: return the fastest IP, Fastest Response: return the fastest DNS response."))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
o:value("", translate("default"))
|
||||
o:value("first-ping", translate("First Ping"))
|
||||
o:value("fastest-ip", translate("Fastest IP"))
|
||||
o:value("fastest-response", translate("Fastest Response"))
|
||||
|
||||
---- Enable TCP server
|
||||
o = s:taboption("advanced", Flag, "tcp_server", translate("TCP Server"), translate("Enable TCP DNS Server"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- Support IPV6
|
||||
o = s:taboption("advanced", Flag, "ipv6_server", translate("IPV6 Server"), translate("Enable IPV6 DNS Server"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- bind to device;
|
||||
o = s:taboption("advanced", Flag, "bind_device", translate("Bind Device"), translate("Listen only on the specified interfaces."))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- bind device name;
|
||||
o = s:taboption("advanced", Value, "bind_device_name", translate("Bind Device Name"), translate("Name of device name listen on."))
|
||||
o.placeholder = "default"
|
||||
o.rempty = true
|
||||
o.datatype = "string"
|
||||
|
||||
---- Support DualStack ip selection
|
||||
o = s:taboption("advanced", Flag, "dualstack_ip_selection", translate("Dual-stack IP Selection"), translate("Enable IP selection between IPV4 and IPV6"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- Domain prefetch load
|
||||
o = s:taboption("advanced", Flag, "prefetch_domain", translate("Domain prefetch"), translate("Enable domain prefetch, accelerate domain response speed."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- Domain Serve expired
|
||||
o = s:taboption("advanced", 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.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- cache-size
|
||||
o = s:taboption("advanced", Value, "cache_size", translate("Cache Size"), translate("DNS domain result cache size"))
|
||||
o.rempty = true
|
||||
|
||||
---- cache-persist;
|
||||
o = s:taboption("advanced", Flag, "cache_persist", translate("Cache Persist"), translate("Write cache to disk on exit and load on startup."))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
-- cache-size
|
||||
o = s:taboption("advanced", Flag, "resolve_local_hostnames", translate("Resolve Local Hostnames"), translate("Resolve local hostnames by reading Dnsmasq lease file."))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
-- Force AAAA SOA
|
||||
o = s:taboption("advanced", Flag, "force_aaaa_soa", translate("Force AAAA SOA"), translate("Force AAAA SOA."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
-- Force HTTPS SOA
|
||||
o = s:taboption("advanced", Flag, "force_https_soa", translate("Force HTTPS SOA"), translate("Force HTTPS SOA."))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- Ipset no speed.
|
||||
o = s:taboption("advanced", Value, "ipset_no_speed", translate("No Speed IPset Name"),
|
||||
translate("Ipset name, Add domain result to ipset when speed check fails."));
|
||||
o.rmempty = true;
|
||||
o.datatype = "hostname";
|
||||
o.rempty = true;
|
||||
|
||||
---- NFTset no speed.
|
||||
o = s:taboption("advanced", Value, "nftset_no_speed", translate("No Speed NFTset Name"),
|
||||
translate("Nftset name, Add domain result to nftset when speed check fails, format: [#[4|6]:[family#table#set]]"));
|
||||
o.rmempty = true;
|
||||
o.datatype = "string";
|
||||
o.rempty = true;
|
||||
function o.validate(self, value)
|
||||
if (value == "") then
|
||||
return value
|
||||
end
|
||||
|
||||
if (value:match("#[4|6]:[a-zA-Z0-9%-_]+#[a-zA-Z0-9%-_]+#[a-zA-Z0-9%-_]+$")) then
|
||||
return value
|
||||
end
|
||||
|
||||
return nil, translate("NFTset name format error, format: [#[4|6]:[family#table#set]]")
|
||||
end
|
||||
|
||||
---- rr-ttl
|
||||
o = s:taboption("advanced", Value, "rr_ttl", translate("Domain TTL"), translate("TTL for all domain result."))
|
||||
o.rempty = true
|
||||
|
||||
---- rr-ttl-min
|
||||
o = s:taboption("advanced", Value, "rr_ttl_min", translate("Domain TTL Min"), translate("Minimum TTL for all domain result."))
|
||||
o.rempty = true
|
||||
o.placeholder = "600"
|
||||
o.default = 600
|
||||
o.optional = true
|
||||
|
||||
---- rr-ttl-max
|
||||
o = s:taboption("advanced", Value, "rr_ttl_max", translate("Domain TTL Max"), translate("Maximum TTL for all domain result."))
|
||||
o.rempty = true
|
||||
|
||||
---- rr-ttl-reply-max
|
||||
o = s:taboption("advanced", Value, "rr_ttl_reply_max", translate("Reply Domain TTL Max"), translate("Reply maximum TTL for all domain result."))
|
||||
o.rempty = true
|
||||
|
||||
o = s:taboption("advanced", DynamicList, "conf_files", translate("Include Config Files<br>/etc/smartdns/conf.d"),
|
||||
translate("Include other config files from /etc/smartdns/conf.d or custom path, can be downloaded from the download page."));
|
||||
uci:foreach("smartdns", "download-file", function(section)
|
||||
local filetype = section.type
|
||||
if (filetype ~= 'config') then
|
||||
return
|
||||
end
|
||||
|
||||
o:value(section.name);
|
||||
end)
|
||||
|
||||
---- other args
|
||||
o = s:taboption("advanced", Value, "server_flags", translate("Additional Server Args"), translate("Additional server args, refer to the help description of the bind option."))
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
o.optional = 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
|
||||
o.rempty = false
|
||||
|
||||
---- Port
|
||||
o = s:taboption("seconddns", Value, "seconddns_port", translate("Local Port"), translate("Smartdns local server port"))
|
||||
o.placeholder = 6553
|
||||
o.default = 6553
|
||||
o.datatype = "port"
|
||||
o.rempty = false
|
||||
|
||||
---- Enable TCP server
|
||||
o = s:taboption("seconddns", Flag, "seconddns_tcp_server", translate("TCP Server"), translate("Enable TCP DNS Server"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- dns server group
|
||||
o = s:taboption("seconddns", Value, "seconddns_server_group", translate("Server Group"), translate("Query DNS through specific dns server group, such as office, home."))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_speed_check", translate("Skip Speed Check"), translate("Do not check speed."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- skip address rules
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_rule_addr", translate("Skip Address Rules"), translate("Skip address rules."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- skip name server rules
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_rule_nameserver", translate("Skip Nameserver Rule"), translate("Skip nameserver rules."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- skip ipset rules
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_rule_ipset", translate("Skip Ipset Rule"), translate("Skip ipset rules."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- skip soa address rule
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_rule_soa", translate("Skip SOA Address Rule"), translate("Skip SOA address rules."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_dualstack_selection", translate("Skip Dualstack Selection"), translate("Skip Dualstack Selection."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- skip cache
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_cache", translate("Skip Cache"), translate("Skip Cache."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
---- Force AAAA SOA
|
||||
o = s:taboption("seconddns", Flag, "seconddns_force_aaaa_soa", translate("Force AAAA SOA"), translate("Force AAAA SOA."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("seconddns", Value, "seconddns_ipset_name", translate("IPset Name"), translate("IPset name."))
|
||||
o.rmempty = true
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
|
||||
o = s:taboption("seconddns", Value, "seconddns_nftset_name", translate("NFTset Name"), translate("NFTset name, format: [#[4|6]:[family#table#set]]"))
|
||||
o.rmempty = true
|
||||
o.datatype = "string"
|
||||
o.rempty = true
|
||||
function o.validate(self, value)
|
||||
if (value == "") then
|
||||
return value
|
||||
end
|
||||
|
||||
if (value:match("#[4|6]:[a-zA-Z0-9%-_]+#[a-zA-Z0-9%-_]+#[a-zA-Z0-9%-_]+$")) then
|
||||
return value
|
||||
end
|
||||
|
||||
return nil, translate("NFTset name format error, format: [#[4|6]:[family#table#set]]")
|
||||
end
|
||||
|
||||
---- other args
|
||||
o = s:taboption("seconddns", Value, "seconddns_server_flags", translate("Additional Server Args"), translate("Additional server args, refer to the help description of the bind option."))
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
o.optional = true
|
||||
|
||||
----- Proxy server settings
|
||||
o = s:taboption("proxy", Value, "proxy_server", translate("Proxy Server"), translate("Proxy Server URL, format: [socks5|http]://user:pass@ip:port."));
|
||||
o.datatype = 'string';
|
||||
function o.validate(self, value)
|
||||
if (value == "") then
|
||||
return true
|
||||
end
|
||||
|
||||
if (not value:match("^http://") and not value:match("^socks5://")) then
|
||||
return nil, translate("Proxy server URL format error, format: [socks5|http]://user:pass@ip:port.")
|
||||
end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
----- dns64 server settings
|
||||
o = s:taboption("dns64", Value, "dns64", translate("DNS64"));
|
||||
o.placeholder = "64:ff9b::/96"
|
||||
o.datatype = 'ip6addr'
|
||||
o.rmempty = true
|
||||
|
||||
----- custom settings
|
||||
custom = s:taboption("custom", Value, "Custom Settings",
|
||||
translate(""),
|
||||
translate("smartdns custom settings"))
|
||||
|
||||
custom.template = "cbi/tvalue"
|
||||
custom.rows = 20
|
||||
|
||||
function custom.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/smartdns/custom.conf")
|
||||
end
|
||||
|
||||
function custom.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/smartdns/custom.conf", value)
|
||||
end
|
||||
|
||||
o = s:taboption("custom", Flag, "coredump", translate("Generate Coredump"), translate("Generate Coredump file when smartdns crash, coredump file is located at /tmp/smartdns.xxx.core."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("custom", Value, "log_size", translate("Log Size"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
|
||||
o = s:taboption("custom", ListValue, "log_level", translate("Log Level"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
o:value("", translate("default"))
|
||||
o:value("debug")
|
||||
o:value("info")
|
||||
o:value("notice")
|
||||
o:value("warn")
|
||||
o:value("error")
|
||||
o:value("fatal")
|
||||
o:value("off")
|
||||
|
||||
o = s:taboption("custom", Value, "log_num", translate("Log Number"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
|
||||
o = s:taboption("custom", Value, "log_file", translate("Log File"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "/var/log/smartdns/smartdns.log"
|
||||
|
||||
-- Upstream servers
|
||||
s = m:section(TypedSection, "server", translate("Upstream Servers"), translate("Upstream Servers, support UDP, TCP protocol. " ..
|
||||
"Please configure multiple DNS servers, including multiple foreign DNS servers."))
|
||||
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/smartdns/upstream/%s")
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"), translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- name
|
||||
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
|
||||
---- port
|
||||
o = s:option(Value, "port", translate("port"), translate("DNS Server port"))
|
||||
o.placeholder = "default"
|
||||
o.datatype = "port"
|
||||
o.rempty = true
|
||||
o:depends("type", "udp")
|
||||
o:depends("type", "tcp")
|
||||
o:depends("type", "tls")
|
||||
|
||||
---- type
|
||||
o = s:option(ListValue, "type", translate("type"), translate("DNS Server type"))
|
||||
o.placeholder = "udp"
|
||||
o:value("udp", translate("udp"))
|
||||
o:value("tcp", translate("tcp"))
|
||||
o:value("tls", translate("tls"))
|
||||
o:value("https", translate("https"))
|
||||
o.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
---- domain rules;
|
||||
s = m:section(TypedSection, "domain-rule", translate("Domain Rules"), translate("Domain Rules Settings"))
|
||||
s.anonymous = true
|
||||
s.nodescriptions = true
|
||||
|
||||
s:tab("forwarding", translate('DNS Forwarding Setting'))
|
||||
s:tab("block", translate("DNS Block Setting"))
|
||||
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."))
|
||||
|
||||
---- domain forwarding;
|
||||
o = s:taboption("forwarding", Value, "server_group", translate("Server Group"), translate("DNS Server group belongs to, such as office, home."))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
uci:foreach("smartdns", "server", function(section)
|
||||
local server_group = section.server_group
|
||||
if server_group == nil then
|
||||
return
|
||||
end
|
||||
o:value(server_group);
|
||||
end)
|
||||
|
||||
function o.validate (section_id, value)
|
||||
if value == "" then
|
||||
return value
|
||||
end
|
||||
|
||||
if value == nil then
|
||||
return nil, translate('Server Group not exists')
|
||||
end
|
||||
|
||||
local exists = false
|
||||
uci:foreach("smartdns", "server", function(section)
|
||||
local server_group = section.server_group
|
||||
if (exists == true) then
|
||||
return
|
||||
end
|
||||
|
||||
if (value == server_group) then
|
||||
exists = true
|
||||
end
|
||||
end)
|
||||
|
||||
if exists == false then
|
||||
return nil, translate('Server Group not exists')
|
||||
end
|
||||
|
||||
return value;
|
||||
|
||||
end
|
||||
|
||||
o = s:taboption("forwarding", Flag, "no_speed_check", translate("Skip Speed Check"),
|
||||
translate("Do not check speed."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
|
||||
o = s:taboption("forwarding", Flag, "force_aaaa_soa", translate("Force AAAA SOA"), translate("Force AAAA SOA."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
|
||||
o = s:taboption("forwarding", Value, "ipset_name", translate("IPset Name"), translate("IPset name."))
|
||||
o.rmempty = true
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
|
||||
o = s:taboption("forwarding", Value, "nftset_name", translate("NFTset Name"), translate("NFTset name, format: [#[4|6]:[family#table#set]]"))
|
||||
o.rmempty = true
|
||||
o.datatype = "string"
|
||||
o.rempty = true
|
||||
function o.validate(self, value)
|
||||
if (value == "") then
|
||||
return value
|
||||
end
|
||||
|
||||
if (value:match("#[4|6]:[a-zA-Z0-9%-_]+#[a-zA-Z0-9%-_]+#[a-zA-Z0-9%-_]+$")) then
|
||||
return value
|
||||
end
|
||||
|
||||
return nil, translate("NFTset name format error, format: [#[4|6]:[family#table#set]]")
|
||||
end
|
||||
|
||||
---- other args
|
||||
o = s:taboption("forwarding", Value, "addition_flag", translate("Additional Rule Flag"), translate("Additional Flags for rules, read help on domain-rule for more information."))
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
o.modalonly = true;
|
||||
|
||||
o = s:taboption("forwarding", FileUpload, "forwarding_domain_set_file", translate("Domain List File"),
|
||||
translate("Upload domain list file, or configure auto download from Download File Setting page."))
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.rempty = true
|
||||
o.editable = true
|
||||
o.root_directory = "/etc/smartdns/domain-set"
|
||||
|
||||
o = s:taboption("forwarding", TextValue, "domain_forwarding_list",
|
||||
translate("Domain List"), translate("Configure forwarding domain name list."))
|
||||
o.rows = 10
|
||||
o.cols = 64
|
||||
o.monospace = true
|
||||
function o.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/smartdns/domain-forwarding.list")
|
||||
end
|
||||
function o.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/smartdns/domain-forwarding.list", value)
|
||||
end
|
||||
|
||||
---- domain block;
|
||||
o = s:taboption("block", FileUpload, "block_domain_set_file", translate("Domain List File"), translate("Upload domain list file."))
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.rempty = true
|
||||
o.editable = true
|
||||
o.root_directory = "/etc/smartdns/domain-set"
|
||||
|
||||
o = s:taboption("block", TextValue, "domain_block_list",
|
||||
translate("Domain List"), translate("Configure block domain list."))
|
||||
o.rows = 10
|
||||
o.cols = 64
|
||||
function o.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/smartdns/domain-block.list")
|
||||
end
|
||||
function o.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/smartdns/domain-block.list", value)
|
||||
end
|
||||
|
||||
-- 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."))
|
||||
|
||||
addr.template = "cbi/tvalue"
|
||||
addr.rows = 20
|
||||
|
||||
function addr.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/smartdns/address.conf")
|
||||
end
|
||||
|
||||
function addr.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/smartdns/address.conf", value)
|
||||
end
|
||||
|
||||
-- IP Blacklist
|
||||
addr = s:taboption("blackip-list", Value, "blacklist_ip",
|
||||
translate(""),
|
||||
translate("Configure IP blacklists that will be filtered from the results of specific DNS server."))
|
||||
|
||||
addr.template = "cbi/tvalue"
|
||||
addr.rows = 20
|
||||
|
||||
function addr.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/smartdns/blacklist-ip.conf")
|
||||
end
|
||||
|
||||
function addr.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/smartdns/blacklist-ip.conf", value)
|
||||
end
|
||||
|
||||
s = m:section(TypedSection, "smartdns", translate("Download Files Setting"), translate("Download domain list files for domain-rule and include config files, please refresh the page after download to take effect."))
|
||||
s.anonymous = true
|
||||
|
||||
---- download Files Settings
|
||||
o = s:option(Flag, "enable_auto_update", translate("Enable Auto Update"), translate("Enable daily auto update."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.rempty = true
|
||||
|
||||
o = s:option(FileUpload, "upload_conf_file", translate("Upload Config File"),
|
||||
translate("Upload smartdns config file to /etc/smartdns/conf.d"))
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.rempty = true
|
||||
o.editable = true
|
||||
o.root_directory = "/etc/smartdns/conf.d"
|
||||
|
||||
o = s:option(FileUpload, "upload_list_file", translate("Upload Domain List File"),
|
||||
translate("Upload domain list file to /etc/smartdns/domain-set"))
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.rempty = true
|
||||
o.editable = true
|
||||
o.root_directory = "/etc/smartdns/domain-set"
|
||||
|
||||
o = s:option(Button, "_updateate")
|
||||
o.title = translate("Update Files")
|
||||
o.inputtitle = translate("Update Files")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.sys.call("/etc/init.d/smartdns updatefiles >/dev/null 2>&1")
|
||||
end
|
||||
|
||||
s = m:section(TypedSection, "download-file", translate("Download Files"), translate("List of files to download."))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.template = "cbi/tblsection"
|
||||
|
||||
o = s:option(Value, 'name', translate('File Name'), translate('File Name'))
|
||||
o.rmempty = true
|
||||
o.datatype = 'string'
|
||||
|
||||
o = s:option(Value, 'url', translate('URL'), translate('URL'))
|
||||
o.rmempty = true
|
||||
o.datatype = 'string'
|
||||
function o.validate(self, value, section)
|
||||
if value == "" then
|
||||
return nil, translate("URL format error, format: http:// or https://")
|
||||
end
|
||||
|
||||
if value == nil then
|
||||
return nil, translate("URL format error, format: http:// or https://")
|
||||
end
|
||||
|
||||
if value.find(value, "http://") then
|
||||
return value
|
||||
end
|
||||
|
||||
if value.find(value, "https://") then
|
||||
return value
|
||||
end
|
||||
|
||||
return nil, translate("URL format error, format: http:// or https://")
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "type", translate("type"), translate("File Type"))
|
||||
o:value("list", translate("domain list (/etc/smartdns/domain-set)"))
|
||||
o:value("config", translate("smartdns config (/etc/smartdns/conf.d)"))
|
||||
o.default = "list"
|
||||
o.rempty = false
|
||||
|
||||
o = s:option(Value, 'desc', translate('Description'), translate('Description'))
|
||||
o.rmempty = true
|
||||
o.datatype = 'string'
|
||||
|
||||
-- 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
|
||||
|
||||
o = s:option(Button, "web")
|
||||
o.title = translate("SmartDNS official website")
|
||||
o.inputtitle = translate("open website")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.http.redirect("https://pymumu.github.io/smartdns")
|
||||
end
|
||||
|
||||
o = s:option(Button, "report")
|
||||
o.title = translate("Report bugs")
|
||||
o.inputtitle = translate("Report bugs")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.http.redirect("https://github.com/pymumu/smartdns/issues")
|
||||
end
|
||||
|
||||
o = s:option(Button, "Donate")
|
||||
o.title = translate("Donate to smartdns")
|
||||
o.inputtitle = translate("Donate")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.http.redirect("https://pymumu.github.io/smartdns/#donate")
|
||||
end
|
||||
|
||||
o = s:option(Button, "Restart")
|
||||
o.title = translate("Restart Service")
|
||||
o.inputtitle = translate("Restart")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.sys.call("/etc/init.d/smartdns restart >/dev/null 2>&1")
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -0,0 +1,158 @@
|
||||
--
|
||||
-- Copyright (C) 2018-2023 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/>.
|
||||
|
||||
local sid = arg[1]
|
||||
|
||||
m = Map("smartdns", "%s - %s" %{translate("SmartDNS Server"), translate("Upstream DNS Server Configuration")})
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/smartdns")
|
||||
|
||||
if m.uci:get("smartdns", sid) ~= "server" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Edit Server ]]--
|
||||
s = m:section(NamedSection, sid, "server")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
---- name
|
||||
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(host, string)"
|
||||
o.rmempty = false
|
||||
---- port
|
||||
o = s:option(Value, "port", translate("port"), translate("DNS Server port"))
|
||||
o.placeholder = "default"
|
||||
o.datatype = "port"
|
||||
o.rempty = true
|
||||
o:depends("type", "udp")
|
||||
o:depends("type", "tcp")
|
||||
o:depends("type", "tls")
|
||||
|
||||
---- type
|
||||
o = s:option(ListValue, "type", translate("type"), translate("DNS Server type"))
|
||||
o.placeholder = "udp"
|
||||
o:value("udp", translate("udp"))
|
||||
o:value("tcp", translate("tcp"))
|
||||
o:value("tls", translate("tls"))
|
||||
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, such as office, home."))
|
||||
o.rmempty = true
|
||||
o.placeholder = "default"
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
|
||||
---- exclude default group
|
||||
o = s:option(Flag, "exclude_default_group", translate("Exclude Default Group"), translate("Exclude DNS Server from default group."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.editable = true
|
||||
o.modalonly = true
|
||||
|
||||
---- blacklist_ip
|
||||
o = s:option(Flag, "blacklist_ip", translate("IP Blacklist Filtering"), translate("Filtering IP with blacklist"))
|
||||
o.rmempty = true
|
||||
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 = ""
|
||||
o.datatype = "string"
|
||||
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.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
o:depends("type", "tls")
|
||||
o:depends("type", "https")
|
||||
|
||||
---- SNI host name
|
||||
o = s:option(Value, "host_name", translate("TLS SNI name"), translate("Sets the server name indication for query."))
|
||||
o.default = ""
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
o:depends("type", "tls")
|
||||
o:depends("type", "https")
|
||||
|
||||
---- http host
|
||||
o = s:option(Value, "http_host", translate("HTTP Host"), translate("Set the HTTP host used for the query. Use this parameter when the host of the URL address is an IP address."))
|
||||
o.default = ""
|
||||
o.datatype = "hostname"
|
||||
o.rempty = true
|
||||
o:depends("type", "https")
|
||||
|
||||
---- 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
|
||||
-- o.default = o.disabled
|
||||
-- o:depends("type", "udp")
|
||||
-- o.cfgvalue = function(...)
|
||||
-- return Flag.cfgvalue(...) or "0"
|
||||
-- end
|
||||
|
||||
---- SPKI pin
|
||||
o = s:option(Value, "spki_pin", translate("TLS SPKI Pinning"), translate("Used to verify the validity of the TLS server, The value is Base64 encoded SPKI fingerprint, leaving blank to indicate that the validity of TLS is not verified."))
|
||||
o.default = ""
|
||||
o.datatype = "string"
|
||||
o.rempty = true
|
||||
o:depends("type", "tls")
|
||||
o:depends("type", "https")
|
||||
|
||||
---- mark
|
||||
o = s:option(Value, "set_mark", translate("Marking Packets"), translate("Set mark on packets."))
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
o.datatype = "uinteger"
|
||||
|
||||
---- use proxy
|
||||
o = s:option(Flag, "use_proxy", translate("Use Proxy"), translate("Use proxy to connect to upstream DNS server."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
function o.validate(self, value, section)
|
||||
if value == "1" then
|
||||
local proxy = m.uci:get_first("smartdns", "smartdns", "proxy_server")
|
||||
if proxy == nil or proxy == "" then
|
||||
return nil, translate("Please set proxy server first.")
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
---- other args
|
||||
o = s:option(Value, "addition_arg", translate("Additional Server Args"), translate("Additional Args for upstream dns servers"))
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
|
||||
return m
|
31
applications/luci-app-smartdns/luasrc/model/smartdns.lua
Normal file
31
applications/luci-app-smartdns/luasrc/model/smartdns.lua
Normal file
@ -0,0 +1,31 @@
|
||||
--
|
||||
-- Copyright (C) 2018-2023 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/>.
|
||||
|
||||
require ("nixio.fs")
|
||||
require ("luci.http")
|
||||
require ("luci.dispatcher")
|
||||
require ("nixio.fs")
|
||||
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
module("luci.model.smartdns", package.seeall)
|
||||
|
||||
function get_config_option(module, section, option, default)
|
||||
return uci:get_first(module, section, option) or default
|
||||
end
|
||||
|
||||
return m
|
||||
|
@ -0,0 +1,28 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "smartdns", "status")%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('smartdns_status');
|
||||
if (data && tb) {
|
||||
var links = "";
|
||||
if (data.running) {
|
||||
links = '<b><font color=green>SmartDNS - <%:RUNNING%></font></b></em>';
|
||||
if (data.dnsmasq_redirect_failure == 1) {
|
||||
links += "<br></br><b><font color=red><%:Dnsmasq Forwarded To Smartdns Failure%></font></b>"
|
||||
}
|
||||
} else {
|
||||
links = '<b><font color=red>SmartDNS - <%:NOT RUNNING%></font></b>';
|
||||
}
|
||||
|
||||
tb.innerHTML = links;
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="smartdns_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
651
applications/luci-app-smartdns/po/zh-cn/smartdns.po
Normal file
651
applications/luci-app-smartdns/po/zh-cn/smartdns.po
Normal file
@ -0,0 +1,651 @@
|
||||
|
||||
msgid "Additional Args for upstream dns servers"
|
||||
msgstr "额外的上游 DNS 服务器参数"
|
||||
|
||||
msgid ""
|
||||
"Additional Flags for rules, read help on domain-rule for more information."
|
||||
msgstr "额外的规则标识,具体参考domain-rule的帮助说明。"
|
||||
|
||||
msgid "Additional Rule Flag"
|
||||
msgstr "额外规则标识"
|
||||
|
||||
msgid "Additional Server Args"
|
||||
msgstr "额外的服务器参数"
|
||||
|
||||
msgid "Additional server args, refer to the help description of the bind option."
|
||||
msgstr "额外的服务器参数,参考bind选项的帮助说明。"
|
||||
|
||||
msgid "Advanced Settings"
|
||||
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的过期记录,以避免查询等待。"
|
||||
|
||||
msgid "Automatically Set Dnsmasq"
|
||||
msgstr "自动设置Dnsmasq"
|
||||
|
||||
msgid "Automatically set as upstream of dnsmasq when port changes."
|
||||
msgstr "端口更改时自动设为 dnsmasq 的上游。"
|
||||
|
||||
msgid "Bind Device"
|
||||
msgstr "绑定到设备"
|
||||
|
||||
msgid "Bind Device Name"
|
||||
msgstr "绑定的设备名称"
|
||||
|
||||
msgid "Block domain"
|
||||
msgstr "屏蔽域名"
|
||||
|
||||
msgid "Block domain."
|
||||
msgstr "屏蔽域名。"
|
||||
|
||||
msgid "Cache Persist"
|
||||
msgstr "持久化缓存"
|
||||
|
||||
msgid "Cache Size"
|
||||
msgstr "缓存大小"
|
||||
|
||||
msgid "Collecting data ..."
|
||||
msgstr "正在收集数据..."
|
||||
|
||||
msgid ""
|
||||
"Configure IP blacklists that will be filtered from the results of specific "
|
||||
"DNS server."
|
||||
msgstr "配置需要从指定域名服务器结果过滤的IP黑名单。"
|
||||
|
||||
msgid "Configure block domain list."
|
||||
msgstr "配置屏蔽域名列表"
|
||||
|
||||
msgid "Configure domain rule list."
|
||||
msgstr "配置域名规则列表"
|
||||
|
||||
msgid "Configure forwarding domain name list."
|
||||
msgstr "配置分流域名列表"
|
||||
|
||||
msgid "Custom Settings"
|
||||
msgstr "自定义设置"
|
||||
|
||||
msgid "DNS Block Setting"
|
||||
msgstr "域名屏蔽设置"
|
||||
|
||||
msgid "DNS Forwarding Setting"
|
||||
msgstr "域名分流设置"
|
||||
|
||||
msgid "DNS Server Name"
|
||||
msgstr "DNS服务器名称"
|
||||
|
||||
msgid "DNS Server group"
|
||||
msgstr "服务器组"
|
||||
|
||||
msgid "DNS Server group belongs to, such as office, home."
|
||||
msgstr "设置服务器组,例如office,home"
|
||||
|
||||
msgid "DNS Server ip"
|
||||
msgstr "DNS服务器IP"
|
||||
|
||||
msgid "DNS Server port"
|
||||
msgstr "DNS服务器端口"
|
||||
|
||||
msgid "DNS Server type"
|
||||
msgstr "协议类型"
|
||||
|
||||
msgid "DNS domain result cache size"
|
||||
msgstr "缓存DNS的结果,缓存大小,配置零则不缓存。"
|
||||
|
||||
msgid "DNS64"
|
||||
msgstr "DNS64"
|
||||
|
||||
msgid "DNS64 Server Settings"
|
||||
msgstr "DNS64服务器配置"
|
||||
|
||||
msgid "default"
|
||||
msgstr "默认"
|
||||
|
||||
msgid "Description"
|
||||
msgstr "描述"
|
||||
|
||||
msgid "Dnsmasq Forwarded To Smartdns Failure"
|
||||
msgstr "重定向dnsmasq到smartdns失败"
|
||||
|
||||
msgid "Do not check certificate."
|
||||
msgstr "不校验证书的合法性。"
|
||||
|
||||
msgid "Do not check speed."
|
||||
msgstr "禁用测速。"
|
||||
|
||||
msgid "Domain Address"
|
||||
msgstr "域名地址"
|
||||
|
||||
msgid "Domain List"
|
||||
msgstr "域名列表"
|
||||
|
||||
msgid "Domain List File"
|
||||
msgstr "域名列表文件"
|
||||
|
||||
msgid "Domain Rule List"
|
||||
msgstr "域名规则列表"
|
||||
|
||||
msgid "Domain Rule Name"
|
||||
msgstr "域名规则名称"
|
||||
|
||||
msgid "Domain Rules"
|
||||
msgstr "域名规则"
|
||||
|
||||
msgid "Domain Rules Settings"
|
||||
msgstr "域名规则设置"
|
||||
|
||||
msgid "Domain TTL"
|
||||
msgstr "域名TTL"
|
||||
|
||||
msgid "Domain TTL Max"
|
||||
msgstr "域名TTL最大值"
|
||||
|
||||
msgid "Domain TTL Min"
|
||||
msgstr "域名TTL最小值"
|
||||
|
||||
msgid "Domain prefetch"
|
||||
msgstr "域名预加载"
|
||||
|
||||
msgid "Donate"
|
||||
msgstr "捐助"
|
||||
|
||||
msgid "Donate to smartdns"
|
||||
msgstr "捐助smartdns项目"
|
||||
|
||||
msgid "Download Files"
|
||||
msgstr "下载文件"
|
||||
|
||||
msgid "Download Files Setting"
|
||||
msgstr "下载文件设置"
|
||||
|
||||
msgid ""
|
||||
"Download domain list files for domain-rule and include config files, please "
|
||||
"refresh the page after download to take effect."
|
||||
msgstr ""
|
||||
"下载域名规则所需要的域名列表文件和smartdns配置文件,下载完成后刷新页面。"
|
||||
|
||||
msgid "Dual-stack IP Selection"
|
||||
msgstr "双栈IP优选"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Enable Auto Update"
|
||||
msgstr "启用自动更新"
|
||||
|
||||
msgid "Enable IP selection between IPV4 and IPV6"
|
||||
msgstr "启用 IPV4 和 IPV6 间的 IP 优选策略。"
|
||||
|
||||
msgid "Enable IPV6 DNS Server"
|
||||
msgstr "启用IPV6服务器。"
|
||||
|
||||
msgid "Enable TCP DNS Server"
|
||||
msgstr "启用TCP服务器。"
|
||||
|
||||
msgid "Enable daily auto update."
|
||||
msgstr "启用每日自动更新"
|
||||
|
||||
msgid "Enable domain prefetch, accelerate domain response speed."
|
||||
msgstr "启用域名预加载,加速域名响应速度。"
|
||||
|
||||
msgid "Enable or disable second DNS server."
|
||||
msgstr "是否启用第二DNS服务器。"
|
||||
|
||||
msgid "Enable or disable smartdns server"
|
||||
msgstr "启用或禁用SmartDNS服务"
|
||||
|
||||
msgid "Exclude DNS Server from default group."
|
||||
msgstr "从default默认服务器组中排除。"
|
||||
|
||||
msgid "Exclude Default Group"
|
||||
msgstr "从默认组中排除"
|
||||
|
||||
msgid "Fastest IP"
|
||||
msgstr "最快IP"
|
||||
|
||||
msgid "Fastest Response"
|
||||
msgstr "最快响应"
|
||||
|
||||
msgid "File Name"
|
||||
msgstr "文件名"
|
||||
|
||||
msgid "File Type"
|
||||
msgstr "文件类型"
|
||||
|
||||
msgid "Filtering IP with blacklist"
|
||||
msgstr "使用IP黑名单过滤"
|
||||
|
||||
msgid "First Ping"
|
||||
msgstr "最快PING"
|
||||
|
||||
msgid "Force AAAA SOA"
|
||||
msgstr "停用IPV6地址解析"
|
||||
|
||||
msgid "Force AAAA SOA."
|
||||
msgstr "停用IPV6地址解析。"
|
||||
|
||||
msgid "Force HTTPS SOA"
|
||||
msgstr "停用HTTPS地址解析"
|
||||
|
||||
msgid "Force HTTPS SOA."
|
||||
msgstr "停用HTTPS地址解析。"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "常规设置"
|
||||
|
||||
msgid "Generate Coredump"
|
||||
msgstr "生成coredump"
|
||||
|
||||
msgid ""
|
||||
"Generate Coredump file when smartdns crash, coredump file is located at /tmp/"
|
||||
"smartdns.xxx.core."
|
||||
msgstr ""
|
||||
"当smartdns异常时生成coredump文件,coredump文件在/tmp/smartdns.xxx.core."
|
||||
|
||||
msgid "Grant access to LuCI app smartdns"
|
||||
msgstr "授予访问 LuCI 应用 smartdns 的权限"
|
||||
|
||||
msgid "HTTP Host"
|
||||
msgstr "HTTP主机"
|
||||
|
||||
msgid "IP Blacklist"
|
||||
msgstr "IP黑名单"
|
||||
|
||||
msgid "IP Blacklist Filtering"
|
||||
msgstr "IP黑名单过滤"
|
||||
|
||||
msgid "IPV6 Server"
|
||||
msgstr "IPV6服务器"
|
||||
|
||||
msgid "IPset Name"
|
||||
msgstr "IPset名称"
|
||||
|
||||
msgid "IPset name."
|
||||
msgstr "IPset名称。"
|
||||
|
||||
msgid "If you like this software, please buy me a cup of coffee."
|
||||
msgstr "如果本软件对你有帮助,请给作者加个蛋。"
|
||||
|
||||
msgid "Include Config Files<br>/etc/smartdns/conf.d"
|
||||
msgstr "包含配置文件<br>/etc/smartdns/conf.d"
|
||||
|
||||
msgid ""
|
||||
"Include other config files from /etc/smartdns/conf.d or custom path, can be "
|
||||
"downloaded from the download page."
|
||||
msgstr ""
|
||||
"包含配置文件,路径为/etc/smartdns/conf.d,或自定义配置文件路径,可以从下载页"
|
||||
"配置自动下载。面配置自动下载。"
|
||||
|
||||
msgid "Ipset name, Add domain result to ipset when speed check fails."
|
||||
msgstr "IPset名称,当测速失败时,将查询到的结果添加到对应的IPSet集合中。"
|
||||
|
||||
msgid "List of files to download."
|
||||
msgstr "下载文件列表。"
|
||||
|
||||
msgid "Listen only on the specified interfaces."
|
||||
msgstr "监听在指定的设备上,避免非本地网络的DNS查询请求。"
|
||||
|
||||
msgid "Local Port"
|
||||
msgstr "本地端口"
|
||||
|
||||
msgid "Log Size"
|
||||
msgstr "日志大小"
|
||||
|
||||
msgid "Log Level"
|
||||
msgstr "日志级别"
|
||||
|
||||
msgid "Log Number"
|
||||
msgstr "日志数量"
|
||||
|
||||
msgid "Log File"
|
||||
msgstr "日志文件路径"
|
||||
|
||||
msgid "Marking Packets"
|
||||
msgstr "数据包标记"
|
||||
|
||||
msgid "Maximum TTL for all domain result."
|
||||
msgstr "所有域名的最大 TTL 值。"
|
||||
|
||||
msgid "Minimum TTL for all domain result."
|
||||
msgstr "所有域名的最小 TTL 值。"
|
||||
|
||||
msgid "NFTset Name"
|
||||
msgstr "NFTSet名称"
|
||||
|
||||
msgid "NFTset name format error, format: [#[4|6]:[family#table#set]]"
|
||||
msgstr "NFTSet名称格式错误,格式:[#[4|6]:[family#table#set]]"
|
||||
|
||||
msgid "NFTset name, format: [#[4|6]:[family#table#set]]"
|
||||
msgstr "NFTSet名称,格式:[#[4|6]:[family#table#set]]"
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "Name of device name listen on."
|
||||
msgstr "绑定的设备名称。"
|
||||
|
||||
msgid ""
|
||||
"Nftset name, Add domain result to nftset when speed check fails, format: "
|
||||
"[#[4|6]:[family#table#set]]"
|
||||
msgstr "NFTset名称,当测速失败时,将查询到的结果添加到对应的NFTSet集合中。"
|
||||
|
||||
msgid "No"
|
||||
msgstr "否"
|
||||
|
||||
msgid "No Speed IPset Name"
|
||||
msgstr "无速度时IPSet名称"
|
||||
|
||||
msgid "No Speed NFTset Name"
|
||||
msgstr "无速度时NFTSet名称"
|
||||
|
||||
msgid "No check certificate"
|
||||
msgstr "停用证书校验"
|
||||
|
||||
msgid "None"
|
||||
msgstr "无"
|
||||
|
||||
msgid "Only socks5 proxy support udp server."
|
||||
msgstr "仅SOCKS5代理支持UDP服务器。"
|
||||
|
||||
msgid "Please set proxy server first."
|
||||
msgstr "请先设置代理服务器。"
|
||||
|
||||
msgid "Proxy Server"
|
||||
msgstr "代理服务器"
|
||||
|
||||
msgid "Proxy Server Settings"
|
||||
msgstr "代理服务器设置"
|
||||
|
||||
msgid "Proxy Server URL, format: [socks5|http]://user:pass@ip:port."
|
||||
msgstr "代理服务器地址,格式:[socks5|http]://user:pass@ip:port。"
|
||||
|
||||
msgid ""
|
||||
"Proxy server URL format error, format: [socks5|http]://user:pass@ip:port."
|
||||
msgstr "代理服务器地址格式错误,格式:[socks5|http]://user:pass@ip:port。"
|
||||
|
||||
msgid "Query DNS through specific dns server group, such as office, home."
|
||||
msgstr "使用指定服务器组查询,比如office, home。"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "Reply Domain TTL Max"
|
||||
msgstr "回应的域名TTL最大值"
|
||||
|
||||
msgid "Reply maximum TTL for all domain result."
|
||||
msgstr "设置返回给客户端的域名TTL最大值。"
|
||||
|
||||
msgid "Report bugs"
|
||||
msgstr "报告BUG"
|
||||
|
||||
msgid "Resolve Local Hostnames"
|
||||
msgstr "解析本地主机名"
|
||||
|
||||
msgid "Resolve local hostnames by reading Dnsmasq lease file."
|
||||
msgstr "读取Dnsmasq的租约文件解析本地主机名。"
|
||||
|
||||
msgid "Response Mode"
|
||||
msgstr "响应模式"
|
||||
|
||||
msgid "Restart"
|
||||
msgstr "重启"
|
||||
|
||||
msgid "Restart Service"
|
||||
msgstr "重启服务"
|
||||
|
||||
msgid "Second Server Settings"
|
||||
msgstr "第二DNS服务器"
|
||||
|
||||
msgid "Serve expired"
|
||||
msgstr "缓存过期服务"
|
||||
|
||||
msgid "Server Group"
|
||||
msgstr "服务器组"
|
||||
|
||||
msgid "Server Group %s not exists"
|
||||
msgstr "服务器组%s不存在"
|
||||
|
||||
msgid "Server Name"
|
||||
msgstr "服务器名称"
|
||||
|
||||
msgid "Set Specific domain ip address."
|
||||
msgstr "设置指定域名的IP地址。"
|
||||
|
||||
msgid "Set Specific domain rule list."
|
||||
msgstr "设置指定域名的规则列表。"
|
||||
|
||||
msgid "Set Specific ip blacklist."
|
||||
msgstr "设置指定的 IP 黑名单列表。"
|
||||
|
||||
msgid "Set TLS hostname to verify."
|
||||
msgstr "设置校验TLS主机名。"
|
||||
|
||||
msgid "Set mark on packets."
|
||||
msgstr "设置数据包标记。"
|
||||
|
||||
msgid ""
|
||||
"Set the HTTP host used for the query. Use this parameter when the host of "
|
||||
"the URL address is an IP address."
|
||||
msgstr "设置查询时使用的HTTP主机,当URL地址的host是IP地址时,使用此参数。"
|
||||
|
||||
msgid "Sets the server name indication for query. '-' for disable SNI name."
|
||||
msgstr "设置服务器SNI名称,‘-’表示禁用SNI名称。"
|
||||
|
||||
msgid "Settings"
|
||||
msgstr "设置"
|
||||
|
||||
msgid "Skip Address Rules"
|
||||
msgstr "跳过address规则"
|
||||
|
||||
msgid "Skip Cache"
|
||||
msgstr "跳过cache"
|
||||
|
||||
msgid "Skip Cache."
|
||||
msgstr "跳过cache。"
|
||||
|
||||
msgid "Skip Dualstack Selection"
|
||||
msgstr "跳过双栈优选"
|
||||
|
||||
msgid "Skip Dualstack Selection."
|
||||
msgstr "跳过双栈优选。"
|
||||
|
||||
msgid "Skip Ipset Rule"
|
||||
msgstr "跳过ipset规则"
|
||||
|
||||
msgid "Skip Nameserver Rule"
|
||||
msgstr "跳过Nameserver规则"
|
||||
|
||||
msgid "Skip SOA Address Rule"
|
||||
msgstr "跳过address SOA(#)规则"
|
||||
|
||||
msgid "Skip SOA address rules."
|
||||
msgstr "跳过address SOA(#)规则。"
|
||||
|
||||
msgid "Skip Speed Check"
|
||||
msgstr "跳过测速"
|
||||
|
||||
msgid "Skip address rules."
|
||||
msgstr "跳过address规则。"
|
||||
|
||||
msgid "Skip ipset rules."
|
||||
msgstr "跳过ipset规则。"
|
||||
|
||||
msgid "Skip nameserver rules."
|
||||
msgstr "跳过Nameserver规则。"
|
||||
|
||||
msgid "SmartDNS"
|
||||
msgstr "SmartDNS"
|
||||
|
||||
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,支持广告过滤。"
|
||||
|
||||
msgid "SmartDNS official website"
|
||||
msgstr "SmartDNS官方网站"
|
||||
|
||||
msgid "Smartdns local server port"
|
||||
msgstr "SmartDNS本地服务端口"
|
||||
|
||||
msgid ""
|
||||
"Smartdns local server port, smartdns will be automatically set as main dns "
|
||||
"when the port is 53."
|
||||
msgstr ""
|
||||
"SmartDNS本地服务端口,当端口号设置为53时,smartdns将会自动配置为主dns。"
|
||||
|
||||
msgid ""
|
||||
"Smartdns response mode, First Ping: return the first ping IP, Fastest IP: "
|
||||
"return the fastest IP, Fastest Response: return the fastest DNS response."
|
||||
msgstr ""
|
||||
"SmartDNS响应模式,最快PING: 返回最早有ping结果的IP,速度适中;最快IP: 返回"
|
||||
"最快IP,查询请求可能延长; 最快响应:返回最快响应的结果,查询请求时间短。"
|
||||
|
||||
msgid "Smartdns server name"
|
||||
msgstr "SmartDNS的服务器名称,默认为smartdns,留空为主机名"
|
||||
|
||||
msgid "Smartdns speed check mode."
|
||||
msgstr "SmartDNS测速模式。"
|
||||
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
"配置特定域名返回特定的IP地址,域名查询将不到上游服务器请求,直接返回配置的IP"
|
||||
"地址,可用于广告屏蔽。"
|
||||
|
||||
msgid "Speed Check Mode"
|
||||
msgstr "测速模式"
|
||||
|
||||
msgid "Speed check mode is invalid."
|
||||
msgstr "测速模式无效。"
|
||||
|
||||
msgid "TCP Server"
|
||||
msgstr "TCP服务器"
|
||||
|
||||
msgid "TCP port is empty"
|
||||
msgstr "TCP端口号为空"
|
||||
|
||||
msgid "TLS Hostname Verify"
|
||||
msgstr "校验TLS主机名"
|
||||
|
||||
msgid "TLS SNI name"
|
||||
msgstr "TLS SNI名称"
|
||||
|
||||
msgid "TLS SPKI Pinning"
|
||||
msgstr "TLS SPKI 指纹"
|
||||
|
||||
msgid "TTL for all domain result."
|
||||
msgstr "设置所有域名的 TTL 值。"
|
||||
|
||||
msgid "Technical Support"
|
||||
msgstr "技术支持"
|
||||
|
||||
msgid "URL"
|
||||
msgstr "URL"
|
||||
|
||||
msgid "URL format error, format: http:// or https://"
|
||||
msgstr "URL格式错误,格式:http://或https://"
|
||||
|
||||
msgid "Update"
|
||||
msgstr "更新"
|
||||
|
||||
msgid "Update Files"
|
||||
msgstr "更新文件"
|
||||
|
||||
msgid "Upload Config File"
|
||||
msgstr "上传配置文件"
|
||||
|
||||
msgid "Upload Domain List File"
|
||||
msgstr "上传域名列表文件"
|
||||
|
||||
msgid "Upload domain list file to /etc/smartdns/domain-set"
|
||||
msgstr "上传域名列表文件到/etc/smartdns/domain-set"
|
||||
|
||||
msgid ""
|
||||
"Upload domain list file, or configure auto download from Download File "
|
||||
"Setting page."
|
||||
msgstr "上传域名列表文件,或在下载文件设置页面设置自动下载。"
|
||||
|
||||
msgid "Upload domain list file."
|
||||
msgstr "上传域名列表文件"
|
||||
|
||||
msgid "Upload smartdns config file to /etc/smartdns/conf.d"
|
||||
msgstr "上传配置文件到/etc/smartdns/conf.d"
|
||||
|
||||
msgid "Upstream DNS Server Configuration"
|
||||
msgstr "上游DNS服务器配置"
|
||||
|
||||
msgid "Upstream Servers"
|
||||
msgstr "上游服务器"
|
||||
|
||||
msgid ""
|
||||
"Upstream Servers, support UDP, TCP protocol. Please configure multiple DNS "
|
||||
"servers, including multiple foreign DNS servers."
|
||||
msgstr ""
|
||||
"上游 DNS 服务器,支持 UDP,TCP 协议。请配置多个上游 DNS 服务器,包括多个国内"
|
||||
"外服务器。"
|
||||
|
||||
msgid "Use Proxy"
|
||||
msgstr "使用代理"
|
||||
|
||||
msgid "Use proxy to connect to upstream DNS server."
|
||||
msgstr "使用代理连接上游DNS服务器。"
|
||||
|
||||
msgid ""
|
||||
"Used to verify the validity of the TLS server, The value is Base64 encoded "
|
||||
"SPKI fingerprint, leaving blank to indicate that the validity of TLS is not "
|
||||
"verified."
|
||||
msgstr ""
|
||||
"用于校验 TLS 服务器的有效性,数值为 Base64 编码的 SPKI 指纹,留空表示不验证 "
|
||||
"TLS 的合法性。"
|
||||
|
||||
msgid "Write cache to disk on exit and load on startup."
|
||||
msgstr "退出时保存cache到磁盘,启动时加载。"
|
||||
|
||||
msgid "Yes"
|
||||
msgstr "是"
|
||||
|
||||
msgid "default"
|
||||
msgstr "默认"
|
||||
|
||||
msgid "domain list (/etc/smartdns/domain-set)"
|
||||
msgstr "域名列表(/etc/smartdns/domain-set)"
|
||||
|
||||
msgid "https"
|
||||
msgstr "https"
|
||||
|
||||
msgid "ip"
|
||||
msgstr "ip"
|
||||
|
||||
msgid "ipset name format error, format: [#[4|6]:]ipsetname"
|
||||
msgstr "IPset名称格式错误,格式:[#[4|6]:]ipsetname"
|
||||
|
||||
msgid "open website"
|
||||
msgstr "打开网站"
|
||||
|
||||
msgid "port"
|
||||
msgstr "端口"
|
||||
|
||||
msgid "smartdns config (/etc/smartdns/conf.d)"
|
||||
msgstr "smartdns 配置文件(/etc/smartdns/conf.d)"
|
||||
|
||||
msgid "smartdns custom settings"
|
||||
msgstr "smartdns 自定义设置,具体配置参数参考指导"
|
||||
|
||||
msgid "tcp"
|
||||
msgstr "tcp"
|
||||
|
||||
msgid "tls"
|
||||
msgstr "tls"
|
||||
|
||||
msgid "type"
|
||||
msgstr "类型"
|
||||
|
||||
msgid "udp"
|
||||
msgstr "udp"
|
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018-2023 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/>.
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@smartdns[-1]
|
||||
add ucitrack smartdns
|
||||
set ucitrack.@smartdns[-1].init=smartdns
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user