diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/1_sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/1_sing-box.lua index 47a4a249..ac8b945b 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/1_sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/1_sing-box.lua @@ -80,6 +80,12 @@ end o:value("direct", "Direct") o:depends({ custom = false }) +o = s:option(DummyValue, "is_endpoint", "") +o.not_rewrite = true +o.template = m:template_path("/cbi/hidevalue") +o.value = "1" +o:depends({ custom = false, protocol = "wireguard" }) + o = s:option(Value, "port", translate("Listen Port")) o.datatype = "port" o:depends({ custom = false }) @@ -452,7 +458,7 @@ end o = s:option(Flag, "bind_local", translate("Bind Local"), translate("When selected, it can only be accessed localhost.")) o.default = "0" -o:depends({ custom = false }) +o:depends({ custom = false, is_endpoint = "" }) o = s:option(Flag, "accept_lan", translate("Accept LAN Access"), translate("When selected, it can accessed lan , this will not be safe!")) o.default = "0" diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/2_xray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/2_xray.lua index 89363d00..01186b1c 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/2_xray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/2_xray.lua @@ -11,6 +11,10 @@ if not s1.fields["type"].default then s1.fields["type"].default = type_name end +if not s1.val["type"] then + s1.val["type"] = type_name +end + if s1.val["type"] and s1.val["type"] ~= type_name then return end @@ -62,11 +66,16 @@ o:value("wireguard", "WireGuard") o:value("dokodemo-door", "dokodemo-door") o:depends({ custom = false }) +o = s:option(DummyValue, "is_endpoint", "") +o.not_rewrite = true +o.template = m:template_path("/cbi/hidevalue") +o.value = "1" +o:depends({ custom = false, protocol = "wireguard" }) + o = s:option(Value, "port", translate("Listen Port")) o.datatype = "port" o:depends({ custom = false }) - o = s:option(DynamicList, "users", translate("User")) for i, v in ipairs(user_list) do o:value(v[".name"], v.username) @@ -402,7 +411,7 @@ end --[[acceptProxyProtocol]] o = s:option(Flag, "acceptProxyProtocol", translate("acceptProxyProtocol"), translate("Whether to receive PROXY protocol, when this node want to be fallback or forwarded by proxy, it must be enable, otherwise it cannot be used.")) o.default = "0" -o:depends({ custom = false }) +o:depends({ custom = false, is_endpoint = "" }) --[[Fast Open]] o = s:option(Flag, "tcp_fast_open", "TCP " .. translate("Fast Open")) diff --git a/luci-app-passwall/root/usr/share/passwall/utils.sh b/luci-app-passwall/root/usr/share/passwall/utils.sh index 72dd3ed8..4f7db842 100755 --- a/luci-app-passwall/root/usr/share/passwall/utils.sh +++ b/luci-app-passwall/root/usr/share/passwall/utils.sh @@ -479,7 +479,7 @@ ln_run() { echolog " - 找不到 ${ln_name},无法启动..." return 1 } - [ "${output}" != "/dev/null" ] && [ -n "$(echo "${output}" | grep -E "default|SOCKS_")" ] && [ "${ln_name}" != "chinadns-ng" ] && { + [ "${output}" != "/dev/null" ] && [ -n "$(echo "${output}" | grep -E "default|socks_")" ] && [ "${ln_name}" != "chinadns-ng" ] && { local persist_log_path=$(config_t_get global persist_log_path) local sys_log=$(config_t_get global sys_log "0") }