mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-26 21:02:53 +08:00
update 2026-08-31 18:23:00
This commit is contained in:
1 parent
be2557c9dc
commit
f959ff8b68
1959 files changed
+24
-1523250
No files matched your search
@@ -151,8 +151,8 @@ end
|
||||
|
||||
o = s:taboption("Main", Value, "node_socks_port", translate("Node") .. " Socks " .. translate("Listen Port"))
|
||||
o.default = 1070
|
||||
o.placeholder = 1070
|
||||
o.datatype = "range(1,65535)"
|
||||
o.rmempty = false
|
||||
o:depends({ node = "", ["!reverse"] = true })
|
||||
--[[
|
||||
if has_singbox or has_xray then
|
||||
|
||||
@@ -47,8 +47,8 @@ o:depends("console_auth", true)
|
||||
---- Console Port
|
||||
o = s:option(Value, "console_port", translate("Console Port"), translate("In the browser input routing IP plus port access, such as:192.168.1.1:1188"))
|
||||
o.default = 1188
|
||||
o.placeholder = 1188
|
||||
o.datatype = "range(1,65535)"
|
||||
o.rmempty = false
|
||||
o:depends("balancing_enable", true)
|
||||
|
||||
o = s:option(Flag, "bind_local", translate("Haproxy Port") .. " " .. translate("Bind Local"), translate("When selected, it can only be accessed localhost."))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
local map = self.map
|
||||
local api = map.api
|
||||
local haproxy_enable = map:get("@global_haproxy[0]", "balancing_enable") or "0"
|
||||
local console_port = map:get("@global_haproxy[0]", "console_port") or ""
|
||||
local console_port = map:get("@global_haproxy[0]", "console_port") or "1188"
|
||||
-%>
|
||||
<p id="_status"></p>
|
||||
|
||||
|
||||
@@ -1064,7 +1064,6 @@ start_dns() {
|
||||
esac
|
||||
|
||||
# 追加直连DNS到iptables/nftables
|
||||
[ "$(config_n_get @global_haproxy[0] balancing_enable 0)" != "1" ] && IPT_APPEND_DNS=
|
||||
add_default_port() {
|
||||
[ -z "$1" ] && echo "" || echo "$1" | awk -F',' '{for(i=1;i<=NF;i++){if($i !~ /#/) $i=$i"#53";} print $0;}' OFS=','
|
||||
}
|
||||
@@ -1330,7 +1329,7 @@ start_haproxy() {
|
||||
fi
|
||||
local haproxy_path=$TMP_PATH/haproxy
|
||||
local haproxy_conf="config.cfg"
|
||||
lua $APP_PATH/haproxy.lua -path ${haproxy_path} -conf ${haproxy_conf} -dns ${LOCAL_DNS}
|
||||
lua $APP_PATH/haproxy.lua -path ${haproxy_path} -conf ${haproxy_conf}
|
||||
ln_run "$(first_type haproxy)" haproxy "/dev/null" -f "${haproxy_path}/${haproxy_conf}"
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ local fs = api.fs
|
||||
local uci = api.uci
|
||||
local sys = api.sys
|
||||
|
||||
local log = function(...)
|
||||
api.log(...)
|
||||
end
|
||||
local log = api.log
|
||||
|
||||
function get_ip_port_from(str)
|
||||
local result_port = sys.exec("echo -n " .. str .. " | sed -n 's/^.*[:#]\\([0-9]*\\)$/\\1/p'")
|
||||
@@ -19,13 +17,13 @@ end
|
||||
local var = api.get_args(arg)
|
||||
local haproxy_path = var["-path"]
|
||||
local haproxy_conf = var["-conf"]
|
||||
local haproxy_dns = var["-dns"] or "119.29.29.29:53,223.5.5.5:53"
|
||||
local haproxy_dns = "127.0.0.1"
|
||||
|
||||
local cpu_thread = sys.exec('echo -n $(cat /proc/cpuinfo | grep "processor" | wc -l)') or "1"
|
||||
local health_check_type = api.uci_get_c("@global_haproxy[0]", "health_check_type") or "tcp"
|
||||
local health_check_inter = api.uci_get_c("@global_haproxy[0]", "health_check_inter") or "20"
|
||||
local balancingStrategy = api.uci_get_c("@global_haproxy[0]", "balancingStrategy") or "roundrobin"
|
||||
local console_port = api.uci_get_c("@global_haproxy[0]", "console_port")
|
||||
local console_port = api.uci_get_c("@global_haproxy[0]", "console_port") or "1188"
|
||||
local bind_local = api.uci_get_c("@global_haproxy[0]", "bind_local") or "0"
|
||||
local bind_address = "0.0.0.0"
|
||||
if bind_local == "1" then bind_address = "127.0.0.1" end
|
||||
@@ -54,7 +52,7 @@ defaults
|
||||
log global
|
||||
option tcplog
|
||||
option dontlognull
|
||||
option http-server-close
|
||||
option abortonclose
|
||||
#option forwardfor except 127.0.0.0/8
|
||||
option redispatch
|
||||
retries 2
|
||||
|
||||
Reference in new issue
Block a user