mirror of
https://github.com/sirpdboy/sirpdboy-package.git
synced 2025-01-05 10:27:11 +08:00
up luci-app-smartdns 1.2024.45
This commit is contained in:
parent
1d21c4c34b
commit
1a48544008
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018-2023 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
# Copyright (C) 2018-2024 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
|
||||
@ -18,7 +18,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Nick Peng <pymumu@gmail.com>
|
||||
PKG_VERSION:=1.2023.43
|
||||
PKG_VERSION:=1.2024.45
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI for smartdns
|
||||
|
@ -1,5 +1,5 @@
|
||||
--
|
||||
-- Copyright (C) 2018-2023 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
-- Copyright (C) 2018-2024 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
|
||||
@ -69,7 +69,6 @@ end
|
||||
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");
|
||||
@ -130,6 +129,56 @@ o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- Enable DOT server;
|
||||
o = s:taboption("advanced", Flag, "tls_server", translate("DOT Server"), translate("Enable DOT DNS Server"))
|
||||
o.rmempty = false
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("advanced", Value, "tls_server_port", translate("DOT Server Port"), translate("Smartdns DOT server port."))
|
||||
o.placeholder = 853
|
||||
o.default = 853
|
||||
o.datatype = "port"
|
||||
o.rempty = false
|
||||
o:depends('tls_server', '1')
|
||||
|
||||
---- Enable DOH server;
|
||||
o = s:taboption("advanced", Flag, "doh_server", translate("DOH Server"), translate("Enable DOH DNS Server"))
|
||||
o.rmempty = false
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("advanced", Value, "doh_server_port", translate("DOH Server Port"), translate("Smartdns DOH server port."))
|
||||
o.placeholder = 843
|
||||
o.default = 843
|
||||
o.datatype = "port"
|
||||
o.rempty = false
|
||||
o:depends('doh_server', '1')
|
||||
|
||||
o = s:taboption("advanced", Value, "bind_cert", translate("Server Cert"), translate("Server certificate file path."))
|
||||
o.datatype = "string"
|
||||
o.placeholder = "/var/etc/smartdns/smartdns/smartdns-cert.pem"
|
||||
o.rempty = true
|
||||
o:depends('tls_server', '1')
|
||||
o:depends('doh_server', '1')
|
||||
|
||||
o = s:taboption("advanced", Value, "bind_cert_key", translate("Server Cert Key"), translate("Server certificate key file path."))
|
||||
o.datatype = "string"
|
||||
o.placeholder = "/var/etc/smartdns/smartdns/smartdns-key.pem"
|
||||
o.rempty = false
|
||||
o:depends('tls_server', '1')
|
||||
o:depends('doh_server', '1')
|
||||
|
||||
o = s:taboption("advanced", Value, "bind_cert_key_pass", translate("Server Cert Key Pass"), translate("Server certificate key file password."))
|
||||
o.datatype = "string"
|
||||
o.rempty = false
|
||||
o:depends('tls_server', '1')
|
||||
o:depends('doh_server', '1')
|
||||
|
||||
---- Support IPV6
|
||||
o = s:taboption("advanced", Flag, "ipv6_server", translate("IPV6 Server"), translate("Enable IPV6 DNS Server"))
|
||||
o.rmempty = false
|
||||
@ -189,7 +238,7 @@ o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
-- cache-size
|
||||
-- resolve local hostname
|
||||
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
|
||||
@ -197,6 +246,14 @@ o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
-- resolve local network hostname via mDNS
|
||||
o = s:taboption("advanced", Flag, "mdns_lookup", translate("mDNS Lookup"), translate("Resolve local network hostname via mDNS protocol."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
-- Force AAAA SOA
|
||||
o = s:taboption("advanced", Flag, "force_aaaa_soa", translate("Force AAAA SOA"), translate("Force AAAA SOA."))
|
||||
o.rmempty = true
|
||||
@ -213,6 +270,11 @@ o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:taboption("advanced", Value, "ipset_name", translate("IPset Name"), translate("IPset name."))
|
||||
o.rmempty = true
|
||||
o.datatype = "string"
|
||||
o.rempty = true
|
||||
|
||||
---- 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."));
|
||||
@ -220,6 +282,22 @@ o.rmempty = true;
|
||||
o.datatype = "hostname";
|
||||
o.rempty = true;
|
||||
|
||||
o = s:taboption("advanced", 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
|
||||
|
||||
---- 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]]"));
|
||||
@ -258,7 +336,8 @@ o = s:taboption("advanced", Value, "rr_ttl_reply_max", translate("Reply Domain T
|
||||
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."));
|
||||
translate("Include other config files from /etc/smartdns/conf.d or custom path, can be downloaded from the download page."))
|
||||
o.rmempty = true
|
||||
uci:foreach("smartdns", "download-file", function(section)
|
||||
local filetype = section.type
|
||||
if (filetype ~= 'config') then
|
||||
@ -268,6 +347,17 @@ uci:foreach("smartdns", "download-file", function(section)
|
||||
o:value(section.name);
|
||||
end)
|
||||
|
||||
o = s:taboption("advanced", DynamicList, "hosts_files", translate("Hosts File"), translate("Include hosts file."))
|
||||
o.rmempty = true
|
||||
uci:foreach("smartdns", "download-file", function(section)
|
||||
local filetype = section.type
|
||||
if (filetype ~= 'other') 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 = ""
|
||||
@ -364,9 +454,23 @@ o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("seconddns", Flag, "seconddns_force_https_soa", translate("Force HTTPS SOA"), translate("Force HTTPS SOA."))
|
||||
o.rmempty = false
|
||||
o.default = o.disabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:taboption("seconddns", Flag, "seconddns_no_ip_alias", translate("Skip IP Alias"))
|
||||
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.datatype = "string"
|
||||
o.rempty = true
|
||||
|
||||
o = s:taboption("seconddns", Value, "seconddns_nftset_name", translate("NFTset Name"), translate("NFTset name, format: [#[4|6]:[family#table#set]]"))
|
||||
@ -436,10 +540,6 @@ 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"
|
||||
@ -452,13 +552,53 @@ 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", ListValue, "log_output_mode", translate("Log Output Mode"));
|
||||
o.rmempty = true;
|
||||
o.placeholder = translate("file");
|
||||
o:value("file", translate("file"));
|
||||
o:value("syslog", translate("syslog"));
|
||||
|
||||
o = s:taboption("custom", Value, "log_size", translate("Log Size"));
|
||||
o.rmempty = true;
|
||||
o.placeholder = "default";
|
||||
o:depends("log_output_mode", "file");
|
||||
|
||||
o = s:taboption("custom", Value, "log_num", translate("Log Number"));
|
||||
o.rmempty = true;
|
||||
o.placeholder = "default";
|
||||
o:depends("log_output_mode", "file");
|
||||
|
||||
o = s:taboption("custom", Value, "log_file", translate("Log File"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "/var/log/smartdns/smartdns.log"
|
||||
o:depends("log_output_mode", "file");
|
||||
|
||||
o = s:taboption("custom", Flag, "enable_audit_log", translate("Enable Audit Log"));
|
||||
o.rmempty = true;
|
||||
o.default = o.disabled;
|
||||
o.rempty = true;
|
||||
|
||||
o = s:taboption("custom", ListValue, "audit_log_output_mode", translate("Audit Log Output Mode"));
|
||||
o.rmempty = true;
|
||||
o.placeholder = translate("file");
|
||||
o:value("file", translate("file"));
|
||||
o:value("syslog", translate("syslog"));
|
||||
o:depends("enable_audit_log", "1");
|
||||
|
||||
o = s:taboption("custom", Value, "audit_log_size", translate("Audit Log Size"));
|
||||
o.rmempty = true;
|
||||
o.placeholder = "default";
|
||||
o:depends({enable_audit_log = "1", audit_log_output_mode = "file"});
|
||||
|
||||
o = s:taboption("custom", Value, "audit_log_num", translate("Audit Log Number"));
|
||||
o.rmempty = true;
|
||||
o.placeholder = "default";
|
||||
o:depends({enable_audit_log = "1", audit_log_output_mode = "file"});
|
||||
|
||||
o = s:taboption("custom", Value, "audit_log_file", translate("Audit Log File"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "/var/log/smartdns/smartdns-audit.log"
|
||||
o:depends({enable_audit_log = "1", audit_log_output_mode = "file"});
|
||||
|
||||
-- Upstream servers
|
||||
s = m:section(TypedSection, "server", translate("Upstream Servers"), translate("Upstream Servers, support UDP, TCP protocol. " ..
|
||||
@ -503,6 +643,179 @@ o:value("https", translate("https"))
|
||||
o.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
-- client rules;
|
||||
s = m:section(TypedSection, "client-rule", translate("Client Rules"), translate("Client Rules Settings, can achieve parental control functionality."))
|
||||
s.anonymous = true;
|
||||
s.nodescriptions = true;
|
||||
|
||||
s:tab("basic", translate('Basic Settings'))
|
||||
s:tab("advanced", translate('Advanced Settings'))
|
||||
s:tab("block", translate("DNS Block Setting"))
|
||||
|
||||
o = s:taboption("basic", Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false;
|
||||
o.default = o.disabled;
|
||||
|
||||
o = s:taboption("basic", DynamicList, "client_addr", translate("Client Address"),
|
||||
translate("If a client address is specified, only that client will apply this rule. You can enter an IP address, such as 1.2.3.4, or a MAC address, such as aa:bb:cc:dd:ee:ff."))
|
||||
o.rempty = true
|
||||
o.rmempty = true;
|
||||
o.datatype = "string"
|
||||
|
||||
o = s:taboption("basic", FileUpload, "client_addr_file", translate("Client Address File"),
|
||||
translate("Upload client address file, same as Client Address function."))
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.rempty = true
|
||||
o.root_directory = "/etc/smartdns/ip-set"
|
||||
|
||||
o = s:taboption("basic", 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
|
||||
|
||||
-- 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: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
|
||||
|
||||
-- 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
|
||||
|
||||
-- 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
|
||||
|
||||
-- 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
|
||||
|
||||
-- ipset name
|
||||
o = s:taboption("advanced", Value, "ipset_name", translate("IPset Name"), translate("IPset name."))
|
||||
o.rmempty = true
|
||||
o.datatype = "string"
|
||||
o.rempty = true
|
||||
|
||||
-- NFTset name
|
||||
o = s:taboption("advanced", 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
|
||||
|
||||
-- include config
|
||||
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."))
|
||||
o.rmempty = true
|
||||
uci:foreach("smartdns", "download-file", function(section)
|
||||
local filetype = section.type
|
||||
if (filetype ~= 'config') then
|
||||
return
|
||||
end
|
||||
|
||||
o:value(section.name);
|
||||
end)
|
||||
|
||||
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"
|
||||
|
||||
---- domain rules;
|
||||
s = m:section(TypedSection, "domain-rule", translate("Domain Rules"), translate("Domain Rules Settings"))
|
||||
s.anonymous = true
|
||||
@ -511,6 +824,7 @@ 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("ip-alias", translate('IP Alias Setting'))
|
||||
s:tab("blackip-list", translate("IP Blacklist"), translate("Set Specific ip blacklist."))
|
||||
|
||||
---- domain forwarding;
|
||||
@ -556,10 +870,50 @@ function o.validate (section_id, 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", Value, "speed_check_mode", translate("Speed Check Mode"), translate("Smartdns speed check mode."))
|
||||
o.rmempty = true;
|
||||
o.placeholder = "default";
|
||||
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
|
||||
|
||||
o = s:taboption("forwarding", Flag, "force_aaaa_soa", translate("Force AAAA SOA"), translate("Force AAAA SOA."))
|
||||
o.rmempty = true
|
||||
@ -634,7 +988,7 @@ function o.write(self, section, value)
|
||||
end
|
||||
|
||||
-- Doman addresss
|
||||
addr = s:taboption("domain-address", Value, "address",
|
||||
addr = s:taboption("domain-address", Value, "dummy_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."))
|
||||
|
||||
@ -650,10 +1004,71 @@ function addr.write(self, section, value)
|
||||
nixio.fs.writefile("/etc/smartdns/address.conf", value)
|
||||
end
|
||||
|
||||
---- ip rules;
|
||||
s = m:section(TypedSection, "ip-rule", translate("IP Rules"), translate("IP Rules Settings"))
|
||||
s.anonymous = true
|
||||
s.nodescriptions = true
|
||||
|
||||
s:tab("ip-alias", translate('IP Alias Setting'))
|
||||
s:tab("blackip-list", translate("IP Blacklist"), translate("Set Specific ip blacklist."))
|
||||
|
||||
-- enable flag;
|
||||
o = s:taboption("ip-alias", Flag, "enabled", translate("Enable"), translate("Enable"));
|
||||
o.rmempty = false;
|
||||
o.default = o.enabled;
|
||||
o.editable = true;
|
||||
|
||||
-- name;
|
||||
o = s:taboption("ip-alias", Value, "name", translate("IP Rule Name"), translate("IP Rule Name"));
|
||||
o.rmempty = true;
|
||||
o.datatype = "string";
|
||||
|
||||
o = s:taboption("ip-alias", FileUpload, "ip_set_file", translate("IP Set File"), translate("Upload IP set file."));
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.modalonly = true;
|
||||
o.root_directory = "/etc/smartdns/ip-set"
|
||||
|
||||
o = s:taboption("ip-alias", DynamicList, "ip_addr", translate("IP Addresses"), translate("IP addresses, CIDR format."));
|
||||
o.rmempty = true;
|
||||
o.datatype = "ipaddr"
|
||||
o.modalonly = true;
|
||||
|
||||
o = s:taboption("ip-alias", Flag, "whitelist_ip", translate("Whitelist IP"), translate("Whitelist IP Rule, Accept IP addresses within the range."));
|
||||
o.rmempty = true;
|
||||
o.default = o.disabled;
|
||||
o.modalonly = true;
|
||||
|
||||
o = s:taboption("ip-alias", Flag, "blacklist_ip", translate("Blacklist IP"), translate("Blacklist IP Rule, Decline IP addresses within the range."));
|
||||
o.rmempty = true;
|
||||
o.default = o.disabled;
|
||||
o.modalonly = true;
|
||||
|
||||
o = s:taboption("ip-alias", Flag, "ignore_ip", translate("Ignore IP"), translate("Do not use these IP addresses."));
|
||||
o.rmempty = true;
|
||||
o.default = o.disabled;
|
||||
o.modalonly = true;
|
||||
|
||||
o = s:taboption("ip-alias", Flag, "bogus_nxdomain", translate("Bogus nxdomain"), translate("Return SOA when the requested result contains a specified IP address."));
|
||||
o.rmempty = true;
|
||||
o.default = o.disabled;
|
||||
o.modalonly = true;
|
||||
|
||||
o = s:taboption("ip-alias", DynamicList, "ip_alias", translate("IP alias"), translate("IP Address Mapping, Can be used for CDN acceleration with Anycast IP, such as Cloudflare's CDN."));
|
||||
o.rmempty = true;
|
||||
o.datatype = 'ipaddr("nomask")';
|
||||
o.modalonly = true;
|
||||
|
||||
-- other args
|
||||
o = s:taboption("ip-alias", Value, "addition_flag", translate("Additional Rule Flag"), translate("Additional Flags for rules, read help on ip-rule for more information."))
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
o.modalonly = true;
|
||||
|
||||
-- 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 = s:taboption("blackip-list", Value, "dummy_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
|
||||
@ -663,7 +1078,7 @@ function addr.cfgvalue(self, section)
|
||||
end
|
||||
|
||||
function addr.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
-- value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/smartdns/blacklist-ip.conf", value)
|
||||
end
|
||||
|
||||
@ -671,12 +1086,23 @@ s = m:section(TypedSection, "smartdns", translate("Download Files Setting"), tra
|
||||
s.anonymous = true
|
||||
|
||||
---- download Files Settings
|
||||
o = s:option(Flag, "enable_auto_update", translate("Enable Auto Update"), translate("Enable daily auto update."))
|
||||
o = s:option(Flag, "enable_auto_update", translate("Enable Auto Update"), translate("Enable daily(week) auto update."))
|
||||
o.rmempty = true
|
||||
o.default = o.disabled
|
||||
o.rempty = true
|
||||
|
||||
o = s:option(ListValue, "auto_update_day_time", translate("Update time (every day)"))
|
||||
o = s:option(ListValue, "auto_update_week_time", translate("Update Time (Every Week)"))
|
||||
o:value("*", translate("Every Day"))
|
||||
o:value("1", translate("Every Monday"))
|
||||
o:value("2", translate("Every Tuesday"))
|
||||
o:value("3", translate("Every Wednesday"))
|
||||
o:value("4", translate("Every Thursday"))
|
||||
o:value("5", translate("Every Friday"))
|
||||
o:value("6", translate("Every Saturday"))
|
||||
o:value("0", translate("Every Sunday"))
|
||||
o.default = "*"
|
||||
|
||||
o = s:option(ListValue, "auto_update_day_time", translate("Update Time (Every Day)"))
|
||||
for i = 0, 23 do o:value(i, i .. ":00") end
|
||||
o.default = 5
|
||||
|
||||
@ -696,6 +1122,13 @@ o.rempty = true
|
||||
o.editable = true
|
||||
o.root_directory = "/etc/smartdns/domain-set"
|
||||
|
||||
o = s:option(FileUpload, "upload_other_file", translate("Upload File"))
|
||||
o.rmempty = true
|
||||
o.datatype = "file"
|
||||
o.rempty = true
|
||||
o.editable = true
|
||||
o.root_directory = "/etc/smartdns/download"
|
||||
|
||||
o = s:option(Button, "_updateate")
|
||||
o.title = translate("Update Files")
|
||||
o.inputtitle = translate("Update Files")
|
||||
@ -739,6 +1172,8 @@ 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:value("ip-set", translate("ip-set file (/etc/smartdns/ip-set)"))
|
||||
o:value("other", translate("other file (/etc/smartdns/download)"))
|
||||
o.default = "list"
|
||||
o.rempty = false
|
||||
|
||||
@ -784,4 +1219,3 @@ o.write = function()
|
||||
end
|
||||
|
||||
return m
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
--
|
||||
-- Copyright (C) 2018-2023 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
-- Copyright (C) 2018-2024 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
|
||||
@ -155,4 +155,4 @@ o = s:option(Value, "addition_arg", translate("Additional Server Args"), transla
|
||||
o.default = ""
|
||||
o.rempty = true
|
||||
|
||||
return m
|
||||
return m
|
||||
|
@ -6,6 +6,10 @@ msgid ""
|
||||
"Additional Flags for rules, read help on domain-rule for more information."
|
||||
msgstr "额外的规则标识,具体参考domain-rule的帮助说明。"
|
||||
|
||||
msgid ""
|
||||
"Additional Flags for rules, read help on ip-rule for more information."
|
||||
msgstr "额外的规则标识,具体参考ip-rule的帮助说明。"
|
||||
|
||||
msgid "Additional Rule Flag"
|
||||
msgstr "额外规则标识"
|
||||
|
||||
@ -18,6 +22,18 @@ msgstr "额外的服务器参数,参考bind选项的帮助说明。"
|
||||
msgid "Advanced Settings"
|
||||
msgstr "高级设置"
|
||||
|
||||
msgid "Audit Log Output Mode"
|
||||
msgstr "审计日志输出模式"
|
||||
|
||||
msgid "Audit Log Size"
|
||||
msgstr "审计日志大小"
|
||||
|
||||
msgid "Audit Log Number"
|
||||
msgstr "审计日志数量"
|
||||
|
||||
msgid "Audit Log File"
|
||||
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."
|
||||
@ -29,12 +45,24 @@ msgstr "自动设置Dnsmasq"
|
||||
msgid "Automatically set as upstream of dnsmasq when port changes."
|
||||
msgstr "端口更改时自动设为 dnsmasq 的上游。"
|
||||
|
||||
msgid "Basic Settings"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Bind Device"
|
||||
msgstr "绑定到设备"
|
||||
|
||||
msgid "Bind Device Name"
|
||||
msgstr "绑定的设备名称"
|
||||
|
||||
msgid "Bogus nxdomain"
|
||||
msgstr "假冒IP"
|
||||
|
||||
msgid "Blacklist IP"
|
||||
msgstr "黑名单"
|
||||
|
||||
msgid "Blacklist IP Rule, Decline IP addresses within the range."
|
||||
msgstr "黑名单规则,拒绝指定范围的IP地址。"
|
||||
|
||||
msgid "Block domain"
|
||||
msgstr "屏蔽域名"
|
||||
|
||||
@ -47,6 +75,18 @@ msgstr "持久化缓存"
|
||||
msgid "Cache Size"
|
||||
msgstr "缓存大小"
|
||||
|
||||
msgid "Client Rules"
|
||||
msgstr "客户端规则"
|
||||
|
||||
msgid "Client Address"
|
||||
msgstr "客户端地址"
|
||||
|
||||
msgid "Client Address File"
|
||||
msgstr "客户端地址文件"
|
||||
|
||||
msgid "Client Rules Settings, can achieve parental control functionality."
|
||||
msgstr "客户端规则设置,可以实现家长控制功能。"
|
||||
|
||||
msgid "Collecting data ..."
|
||||
msgstr "正在收集数据..."
|
||||
|
||||
@ -67,6 +107,21 @@ msgstr "配置分流域名列表"
|
||||
msgid "Custom Settings"
|
||||
msgstr "自定义设置"
|
||||
|
||||
msgid "Do not use these IP addresses."
|
||||
msgstr "忽略这些IP地址"
|
||||
|
||||
msgid "DOH Server"
|
||||
msgstr "DOH服务器"
|
||||
|
||||
msgid "DOH Server Port"
|
||||
msgstr "DOH服务器端口"
|
||||
|
||||
msgid "DOT Server"
|
||||
msgstr "DOT服务器"
|
||||
|
||||
msgid "DOT Server Port"
|
||||
msgstr "DOT服务器端口"
|
||||
|
||||
msgid "DNS Block Setting"
|
||||
msgstr "域名屏蔽设置"
|
||||
|
||||
@ -184,12 +239,48 @@ msgstr "启用IPV6服务器。"
|
||||
msgid "Enable TCP DNS Server"
|
||||
msgstr "启用TCP服务器。"
|
||||
|
||||
msgid "Enable daily auto update."
|
||||
msgstr "启用每日自动更新"
|
||||
msgid "Enable daily(week) auto update."
|
||||
msgstr "启用每天(每周)自动更新。"
|
||||
|
||||
msgid "Update time (every day)"
|
||||
msgid "Enable DOH DNS Server"
|
||||
msgstr "启用DOH服务器。"
|
||||
|
||||
msgid "Enable DOT DNS Server"
|
||||
msgstr "启用DOT服务器。"
|
||||
|
||||
msgid "Update Time (Every Week)"
|
||||
msgstr "更新时间(每周)"
|
||||
|
||||
msgid "Every Day"
|
||||
msgstr "每天"
|
||||
|
||||
msgid "Every Monday"
|
||||
msgstr "每周一"
|
||||
|
||||
msgid "Every Tuesday"
|
||||
msgstr "每周二"
|
||||
|
||||
msgid "Every Wednesday"
|
||||
msgstr "每周三"
|
||||
|
||||
msgid "Every Thursday"
|
||||
msgstr "每周四"
|
||||
|
||||
msgid "Every Friday"
|
||||
msgstr "每周五"
|
||||
|
||||
msgid "Every Saturday"
|
||||
msgstr "每周六"
|
||||
|
||||
msgid "Every Sunday"
|
||||
msgstr "每周日"
|
||||
|
||||
msgid "Update Time (Every Day)"
|
||||
msgstr "更新时间(每天)"
|
||||
|
||||
msgid "Enable Audit Log"
|
||||
msgstr "启用审计日志"
|
||||
|
||||
msgid "Enable domain prefetch, accelerate domain response speed."
|
||||
msgstr "启用域名预加载,加速域名响应速度。"
|
||||
|
||||
@ -205,6 +296,9 @@ msgstr "从default默认服务器组中排除。"
|
||||
msgid "Exclude Default Group"
|
||||
msgstr "从默认组中排除"
|
||||
|
||||
msgid "file"
|
||||
msgstr "文件"
|
||||
|
||||
msgid "Fastest IP"
|
||||
msgstr "最快IP"
|
||||
|
||||
@ -230,10 +324,10 @@ msgid "Force AAAA SOA."
|
||||
msgstr "停用IPV6地址解析。"
|
||||
|
||||
msgid "Force HTTPS SOA"
|
||||
msgstr "停用HTTPS地址解析"
|
||||
msgstr "停用HTTPS记录解析"
|
||||
|
||||
msgid "Force HTTPS SOA."
|
||||
msgstr "停用HTTPS地址解析。"
|
||||
msgstr "停用HTTPS记录解析。"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "常规设置"
|
||||
@ -250,15 +344,48 @@ msgstr ""
|
||||
msgid "Grant access to LuCI app smartdns"
|
||||
msgstr "授予访问 LuCI 应用 smartdns 的权限"
|
||||
|
||||
msgid "Hosts File"
|
||||
msgstr "Hosts文件"
|
||||
|
||||
msgid "HTTP Host"
|
||||
msgstr "HTTP主机"
|
||||
|
||||
msgid "IP alias"
|
||||
msgstr "IP别名"
|
||||
|
||||
msgid "IP Alias Setting"
|
||||
msgstr "IP别名设置"
|
||||
|
||||
msgid "IP Blacklist"
|
||||
msgstr "IP黑名单"
|
||||
|
||||
msgid "IP Blacklist Filtering"
|
||||
msgstr "IP黑名单过滤"
|
||||
|
||||
msgid "IP Addresses"
|
||||
msgstr "IP地址"
|
||||
|
||||
msgid "IP Address Mapping, Can be used for CDN acceleration with Anycast IP, such as Cloudflare's CDN."
|
||||
msgstr "IP地址映射,可用于支持AnyCast IP的CDN加速,比如Cloudflare的CDN。"
|
||||
|
||||
msgid "Ignore IP"
|
||||
msgstr "忽略IP"
|
||||
|
||||
msgid "IP Rules"
|
||||
msgstr "IP规则"
|
||||
|
||||
msgid "IP Rules Settings"
|
||||
msgstr "IP规则设置"
|
||||
|
||||
msgid "IP Rule Name"
|
||||
msgstr "IP规则名称"
|
||||
|
||||
msgid "IP Set File"
|
||||
msgstr "IP集合列表文件"
|
||||
|
||||
msgid "IP addresses, CIDR format."
|
||||
msgstr "IP地址,CIDR格式。"
|
||||
|
||||
msgid "IPV6 Server"
|
||||
msgstr "IPV6服务器"
|
||||
|
||||
@ -268,12 +395,22 @@ msgstr "IPset名称"
|
||||
msgid "IPset name."
|
||||
msgstr "IPset名称。"
|
||||
|
||||
msgid ""
|
||||
"If a client address is specified, only that client will apply this "
|
||||
"rule. You can enter an IP address, such as 1.2.3.4, or a MAC address, "
|
||||
"such as aa:bb:cc:dd:ee:ff."
|
||||
msgstr ""
|
||||
"如果指定了客户端,那么对应的客户端会应用相应的规则,可以输入IP地址,如:1.2.3.4,或MAC地址,如:aa:bb:cc:dd:ee:ff。"
|
||||
|
||||
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 hosts file."
|
||||
msgstr "包含hosts文件。"
|
||||
|
||||
msgid ""
|
||||
"Include other config files from /etc/smartdns/conf.d or custom path, can be "
|
||||
"downloaded from the download page."
|
||||
@ -293,6 +430,9 @@ msgstr "监听在指定的设备上,避免非本地网络的DNS查询请求。
|
||||
msgid "Local Port"
|
||||
msgstr "本地端口"
|
||||
|
||||
msgid "Log Output Mode"
|
||||
msgstr "日志输出模式"
|
||||
|
||||
msgid "Log Size"
|
||||
msgstr "日志大小"
|
||||
|
||||
@ -305,6 +445,9 @@ msgstr "日志数量"
|
||||
msgid "Log File"
|
||||
msgstr "日志文件路径"
|
||||
|
||||
msgid "mDNS Lookup"
|
||||
msgstr "mDNS查询"
|
||||
|
||||
msgid "Marking Packets"
|
||||
msgstr "数据包标记"
|
||||
|
||||
@ -383,12 +526,18 @@ msgstr "设置返回给客户端的域名TTL最大值。"
|
||||
msgid "Report bugs"
|
||||
msgstr "报告BUG"
|
||||
|
||||
msgid "Return SOA when the requested result contains a specified IP address."
|
||||
msgstr "当结果包含对应范围的IP时,返回SOA。"
|
||||
|
||||
msgid "Resolve Local Hostnames"
|
||||
msgstr "解析本地主机名"
|
||||
|
||||
msgid "Resolve local hostnames by reading Dnsmasq lease file."
|
||||
msgstr "读取Dnsmasq的租约文件解析本地主机名。"
|
||||
|
||||
msgid "Resolve local network hostname via mDNS protocol."
|
||||
msgstr "使用mDNS协议解析本地网络主机名。"
|
||||
|
||||
msgid "Response Mode"
|
||||
msgstr "响应模式"
|
||||
|
||||
@ -398,9 +547,21 @@ msgstr "重启"
|
||||
msgid "Restart Service"
|
||||
msgstr "重启服务"
|
||||
|
||||
msgid "syslog"
|
||||
msgstr "系统日志"
|
||||
|
||||
msgid "Second Server Settings"
|
||||
msgstr "第二DNS服务器"
|
||||
|
||||
msgid "Server certificate file path."
|
||||
msgstr "服务器证书文件路径。"
|
||||
|
||||
msgid "Server certificate key file path."
|
||||
msgstr "服务器证书私钥文件路径。"
|
||||
|
||||
msgid "Server certificate key file password."
|
||||
msgstr "服务器证书私钥文件密码。"
|
||||
|
||||
msgid "Serve expired"
|
||||
msgstr "缓存过期服务"
|
||||
|
||||
@ -413,6 +574,15 @@ msgstr "服务器组%s不存在"
|
||||
msgid "Server Name"
|
||||
msgstr "服务器名称"
|
||||
|
||||
msgid "Server Cert"
|
||||
msgstr "服务器证书"
|
||||
|
||||
msgid "Server Cert Key"
|
||||
msgstr "服务器证书私钥"
|
||||
|
||||
msgid "Server Cert Key Pass"
|
||||
msgstr "服务器证书私钥密码"
|
||||
|
||||
msgid "Set Specific domain ip address."
|
||||
msgstr "设置指定域名的IP地址。"
|
||||
|
||||
@ -454,6 +624,9 @@ msgstr "跳过双栈优选"
|
||||
msgid "Skip Dualstack Selection."
|
||||
msgstr "跳过双栈优选。"
|
||||
|
||||
msgid "Skip IP Alias"
|
||||
msgstr "跳过IP别名"
|
||||
|
||||
msgid "Skip Ipset Rule"
|
||||
msgstr "跳过ipset规则"
|
||||
|
||||
@ -481,6 +654,12 @@ msgstr "跳过Nameserver规则。"
|
||||
msgid "SmartDNS"
|
||||
msgstr "SmartDNS"
|
||||
|
||||
msgid "Smartdns DOH server port."
|
||||
msgstr "Smartdns DOH服务器端口号。
|
||||
|
||||
msgid "Smartdns DOT server port."
|
||||
msgstr "Smartdns DOT服务器端口号。"
|
||||
|
||||
msgid "SmartDNS Server"
|
||||
msgstr "SmartDNS 服务器"
|
||||
|
||||
@ -561,6 +740,9 @@ msgstr "更新"
|
||||
msgid "Update Files"
|
||||
msgstr "更新文件"
|
||||
|
||||
msgid "Upload client address file, same as Client Address function."
|
||||
msgstr "上传客户端地址文件,与客户端地址功能相同。"
|
||||
|
||||
msgid "Upload Config File"
|
||||
msgstr "上传配置文件"
|
||||
|
||||
@ -578,6 +760,12 @@ msgstr "上传域名列表文件,或在下载文件设置页面设置自动下
|
||||
msgid "Upload domain list file."
|
||||
msgstr "上传域名列表文件"
|
||||
|
||||
msgid "Upload File"
|
||||
msgstr "上传文件"
|
||||
|
||||
msgid "Upload IP set file."
|
||||
msgstr "上传IP集合列表文件。"
|
||||
|
||||
msgid "Upload smartdns config file to /etc/smartdns/conf.d"
|
||||
msgstr "上传配置文件到/etc/smartdns/conf.d"
|
||||
|
||||
@ -608,6 +796,12 @@ msgstr ""
|
||||
"用于校验 TLS 服务器的有效性,数值为 Base64 编码的 SPKI 指纹,留空表示不验证 "
|
||||
"TLS 的合法性。"
|
||||
|
||||
msgid "Whitelist IP"
|
||||
msgstr "白名单"
|
||||
|
||||
msgid "Whitelist IP Rule, Accept IP addresses within the range."
|
||||
msgstr "白名单规则,接受指定范围的IP地址。"
|
||||
|
||||
msgid "Write cache to disk on exit and load on startup."
|
||||
msgstr "退出时保存cache到磁盘,启动时加载。"
|
||||
|
||||
@ -620,12 +814,18 @@ msgstr "默认"
|
||||
msgid "domain list (/etc/smartdns/domain-set)"
|
||||
msgstr "域名列表(/etc/smartdns/domain-set)"
|
||||
|
||||
msgid "other file (/etc/smartdns/download)"
|
||||
msgstr "其它文件(/etc/smartdns/download)"
|
||||
|
||||
msgid "https"
|
||||
msgstr "https"
|
||||
|
||||
msgid "ip"
|
||||
msgstr "ip"
|
||||
|
||||
msgid "ip-set file (/etc/smartdns/ip-set)"
|
||||
msgstr "IP集合列表文件(/etc/smartdns/ip-set)"
|
||||
|
||||
msgid "ipset name format error, format: [#[4|6]:]ipsetname"
|
||||
msgstr "IPset名称格式错误,格式:[#[4|6]:]ipsetname"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user