luci: fix some problems
This commit is contained in:
parent
3ca7d8095e
commit
55f3d0c53c
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=luci-app-passwall
|
PKG_NAME:=luci-app-passwall
|
||||||
PKG_VERSION:=4.54
|
PKG_VERSION:=4.54
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS:= \
|
PKG_CONFIG_DEPENDS:= \
|
||||||
CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \
|
CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \
|
||||||
|
@ -523,6 +523,7 @@ end
|
|||||||
if remote_dns_server or remote_dns_doh_url or remote_dns_fake then
|
if remote_dns_server or remote_dns_doh_url or remote_dns_fake then
|
||||||
local rules = {}
|
local rules = {}
|
||||||
local _remote_dns_proto = "tcp"
|
local _remote_dns_proto = "tcp"
|
||||||
|
local _remote_dns_host
|
||||||
|
|
||||||
if not routing then
|
if not routing then
|
||||||
routing = {
|
routing = {
|
||||||
@ -554,6 +555,7 @@ if remote_dns_server or remote_dns_doh_url or remote_dns_fake then
|
|||||||
if remote_dns_doh_url and remote_dns_doh_host then
|
if remote_dns_doh_url and remote_dns_doh_host then
|
||||||
if remote_dns_server and remote_dns_doh_host ~= remote_dns_server and not api.is_ip(remote_dns_doh_host) then
|
if remote_dns_server and remote_dns_doh_host ~= remote_dns_server and not api.is_ip(remote_dns_doh_host) then
|
||||||
dns.hosts[remote_dns_doh_host] = remote_dns_server
|
dns.hosts[remote_dns_doh_host] = remote_dns_server
|
||||||
|
_remote_dns_host = remote_dns_doh_host
|
||||||
end
|
end
|
||||||
_remote_dns.address = remote_dns_doh_url
|
_remote_dns.address = remote_dns_doh_url
|
||||||
_remote_dns.port = tonumber(remote_dns_port)
|
_remote_dns.port = tonumber(remote_dns_port)
|
||||||
@ -667,20 +669,25 @@ if remote_dns_server or remote_dns_doh_url or remote_dns_fake then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if dns_outboundTag == "direct" then
|
table.insert(rules, {
|
||||||
table.insert(routing.rules, {
|
type = "field",
|
||||||
type = "field",
|
inboundTag = {
|
||||||
ip = {
|
"dns-in1"
|
||||||
remote_dns_server
|
},
|
||||||
},
|
ip = {
|
||||||
port = tonumber(remote_dns_port),
|
remote_dns_server
|
||||||
outboundTag = dns_outboundTag
|
},
|
||||||
})
|
port = tonumber(remote_dns_port),
|
||||||
else
|
outboundTag = dns_outboundTag
|
||||||
|
})
|
||||||
|
if _remote_dns_host then
|
||||||
table.insert(rules, {
|
table.insert(rules, {
|
||||||
type = "field",
|
type = "field",
|
||||||
ip = {
|
inboundTag = {
|
||||||
remote_dns_server
|
"dns-in1"
|
||||||
|
},
|
||||||
|
domain = {
|
||||||
|
_remote_dns_host
|
||||||
},
|
},
|
||||||
port = tonumber(remote_dns_port),
|
port = tonumber(remote_dns_port),
|
||||||
outboundTag = dns_outboundTag
|
outboundTag = dns_outboundTag
|
||||||
|
@ -59,7 +59,7 @@ o.cfgvalue = function(t, n)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---- TCP Proxy Mode
|
---- TCP Proxy Mode
|
||||||
tcp_proxy_mode = s:option(ListValue, "tcp_proxy_mode", translatef("%s Proxy Mode", "TCP"))
|
tcp_proxy_mode = s:option(ListValue, "tcp_proxy_mode", "TCP " .. translate("Proxy Mode"))
|
||||||
tcp_proxy_mode.default = "default"
|
tcp_proxy_mode.default = "default"
|
||||||
tcp_proxy_mode.rmempty = false
|
tcp_proxy_mode.rmempty = false
|
||||||
tcp_proxy_mode:value("default", translate("Default"))
|
tcp_proxy_mode:value("default", translate("Default"))
|
||||||
@ -74,7 +74,7 @@ end
|
|||||||
tcp_proxy_mode:value("direct/proxy", translate("Only use direct/proxy list"))
|
tcp_proxy_mode:value("direct/proxy", translate("Only use direct/proxy list"))
|
||||||
|
|
||||||
---- UDP Proxy Mode
|
---- UDP Proxy Mode
|
||||||
udp_proxy_mode = s:option(ListValue, "udp_proxy_mode", translatef("%s Proxy Mode", "UDP"))
|
udp_proxy_mode = s:option(ListValue, "udp_proxy_mode", "UDP " .. translate("Proxy Mode"))
|
||||||
udp_proxy_mode.default = "default"
|
udp_proxy_mode.default = "default"
|
||||||
udp_proxy_mode.rmempty = false
|
udp_proxy_mode.rmempty = false
|
||||||
udp_proxy_mode:value("default", translate("Default"))
|
udp_proxy_mode:value("default", translate("Default"))
|
||||||
|
@ -135,36 +135,6 @@ sources.validate = function(self, value, t)
|
|||||||
end
|
end
|
||||||
sources.write = dynamicList_write
|
sources.write = dynamicList_write
|
||||||
|
|
||||||
---- TCP Proxy Mode
|
|
||||||
tcp_proxy_mode = s:option(ListValue, "tcp_proxy_mode", translatef("%s Proxy Mode", "TCP"))
|
|
||||||
tcp_proxy_mode.default = "default"
|
|
||||||
tcp_proxy_mode.rmempty = false
|
|
||||||
tcp_proxy_mode:value("default", translate("Default"))
|
|
||||||
tcp_proxy_mode:value("disable", translate("No Proxy"))
|
|
||||||
tcp_proxy_mode:value("global", translate("Global Proxy"))
|
|
||||||
if has_chnlist and global_proxy_mode:find("returnhome") then
|
|
||||||
tcp_proxy_mode:value("returnhome", translate("China List"))
|
|
||||||
else
|
|
||||||
tcp_proxy_mode:value("gfwlist", translate("GFW List"))
|
|
||||||
tcp_proxy_mode:value("chnroute", translate("Not China List"))
|
|
||||||
end
|
|
||||||
tcp_proxy_mode:value("direct/proxy", translate("Only use direct/proxy list"))
|
|
||||||
|
|
||||||
---- UDP Proxy Mode
|
|
||||||
udp_proxy_mode = s:option(ListValue, "udp_proxy_mode", translatef("%s Proxy Mode", "UDP"))
|
|
||||||
udp_proxy_mode.default = "default"
|
|
||||||
udp_proxy_mode.rmempty = false
|
|
||||||
udp_proxy_mode:value("default", translate("Default"))
|
|
||||||
udp_proxy_mode:value("disable", translate("No Proxy"))
|
|
||||||
udp_proxy_mode:value("global", translate("Global Proxy"))
|
|
||||||
if has_chnlist and global_proxy_mode:find("returnhome") then
|
|
||||||
udp_proxy_mode:value("returnhome", translate("China List"))
|
|
||||||
else
|
|
||||||
udp_proxy_mode:value("gfwlist", translate("GFW List"))
|
|
||||||
udp_proxy_mode:value("chnroute", translate("Not China List"))
|
|
||||||
end
|
|
||||||
udp_proxy_mode:value("direct/proxy", translate("Only use direct/proxy list"))
|
|
||||||
|
|
||||||
---- TCP No Redir Ports
|
---- TCP No Redir Ports
|
||||||
o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports"))
|
o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports"))
|
||||||
o.default = "default"
|
o.default = "default"
|
||||||
@ -208,6 +178,36 @@ o:value("default", translate("Default"))
|
|||||||
o:value("1:65535", translate("All"))
|
o:value("1:65535", translate("All"))
|
||||||
o:value("53", "53")
|
o:value("53", "53")
|
||||||
|
|
||||||
|
---- TCP Proxy Mode
|
||||||
|
tcp_proxy_mode = s:option(ListValue, "tcp_proxy_mode", "TCP " .. translate("Proxy Mode"))
|
||||||
|
tcp_proxy_mode.default = "default"
|
||||||
|
tcp_proxy_mode.rmempty = false
|
||||||
|
tcp_proxy_mode:value("default", translate("Default"))
|
||||||
|
tcp_proxy_mode:value("disable", translate("No Proxy"))
|
||||||
|
tcp_proxy_mode:value("global", translate("Global Proxy"))
|
||||||
|
if has_chnlist and global_proxy_mode:find("returnhome") then
|
||||||
|
tcp_proxy_mode:value("returnhome", translate("China List"))
|
||||||
|
else
|
||||||
|
tcp_proxy_mode:value("gfwlist", translate("GFW List"))
|
||||||
|
tcp_proxy_mode:value("chnroute", translate("Not China List"))
|
||||||
|
end
|
||||||
|
tcp_proxy_mode:value("direct/proxy", translate("Only use direct/proxy list"))
|
||||||
|
|
||||||
|
---- UDP Proxy Mode
|
||||||
|
udp_proxy_mode = s:option(ListValue, "udp_proxy_mode", "UDP " .. translate("Proxy Mode"))
|
||||||
|
udp_proxy_mode.default = "default"
|
||||||
|
udp_proxy_mode.rmempty = false
|
||||||
|
udp_proxy_mode:value("default", translate("Default"))
|
||||||
|
udp_proxy_mode:value("disable", translate("No Proxy"))
|
||||||
|
udp_proxy_mode:value("global", translate("Global Proxy"))
|
||||||
|
if has_chnlist and global_proxy_mode:find("returnhome") then
|
||||||
|
udp_proxy_mode:value("returnhome", translate("China List"))
|
||||||
|
else
|
||||||
|
udp_proxy_mode:value("gfwlist", translate("GFW List"))
|
||||||
|
udp_proxy_mode:value("chnroute", translate("Not China List"))
|
||||||
|
end
|
||||||
|
udp_proxy_mode:value("direct/proxy", translate("Only use direct/proxy list"))
|
||||||
|
|
||||||
tcp_node = s:option(ListValue, "tcp_node", "<a style='color: red'>" .. translate("TCP Node") .. "</a>")
|
tcp_node = s:option(ListValue, "tcp_node", "<a style='color: red'>" .. translate("TCP Node") .. "</a>")
|
||||||
tcp_node.default = "default"
|
tcp_node.default = "default"
|
||||||
tcp_node:value("default", translate("Default"))
|
tcp_node:value("default", translate("Default"))
|
||||||
@ -268,6 +268,7 @@ if has_v2ray or has_xray then
|
|||||||
o.default = "https://1.1.1.1/dns-query"
|
o.default = "https://1.1.1.1/dns-query"
|
||||||
o.validate = function(self, value, t)
|
o.validate = function(self, value, t)
|
||||||
if value ~= "" then
|
if value ~= "" then
|
||||||
|
value = api.trim(value)
|
||||||
local flag = 0
|
local flag = 0
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local val = util.split(value, ",")
|
local val = util.split(value, ",")
|
||||||
|
@ -37,6 +37,7 @@ end)
|
|||||||
|
|
||||||
local doh_validate = function(self, value, t)
|
local doh_validate = function(self, value, t)
|
||||||
if value ~= "" then
|
if value ~= "" then
|
||||||
|
value = api.trim(value)
|
||||||
local flag = 0
|
local flag = 0
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local val = util.split(value, ",")
|
local val = util.split(value, ",")
|
||||||
|
Loading…
Reference in New Issue
Block a user