mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-09-14 04:14:40 +08:00
update 2026-08-29 00:27:35
This commit is contained in:
@@ -2098,10 +2098,10 @@ msgid "Access Control:"
|
||||
msgstr "访问控制:"
|
||||
|
||||
msgid "Add node to the load balancer is directly connected to %s[%s]."
|
||||
msgstr "加入负载均衡的节点到%s[%s]直连完成。"
|
||||
msgstr "加入负载均衡节点IP到%s[%s]直连豁免(防回环)完成。"
|
||||
|
||||
msgid "Add all %s nodes to %s[%s] direct connection complete."
|
||||
msgstr "加入所有%s节点到%s[%s]直连完成。"
|
||||
msgstr "加入所有%s节点服务器IP到%s[%s]直连豁免(防回环)完成。"
|
||||
|
||||
msgid "Starting to load %s firewall rules..."
|
||||
msgstr "开始加载 %s 防火墙规则..."
|
||||
|
||||
@@ -557,6 +557,7 @@ load_acl() {
|
||||
}
|
||||
|
||||
filter_haproxy() {
|
||||
[ "$(config_n_get @global_haproxy[0] balancing_enable 0)" != "1" ] && return
|
||||
for item in $(uci show $CONFIG | grep ".lbss=" | cut -d "'" -f 2); do
|
||||
local ip=$(get_host_ip ipv4 $(echo $item | awk -F ":" '{print $1}') 1)
|
||||
[ -n "$ip" ] && ipset -q add $IPSET_VPS $ip
|
||||
@@ -565,10 +566,16 @@ filter_haproxy() {
|
||||
}
|
||||
|
||||
filter_vpsip() {
|
||||
uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep -v "^127\.0\.0\.1$" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_VPS &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
#log 1 "$(i18n "Add all %s nodes to %s[%s] direct connection complete." "IPv4" "ipset" "${$IPSET_VPS}")"
|
||||
uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_VPS6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
#log 1 "$(i18n "Add all %s nodes to %s[%s] direct connection complete." "IPv6" "ipset" "${$IPSET_VPS6}")"
|
||||
local ipv4_addrs=$(uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep -v "^127\.0\.0\.1$")
|
||||
[ -n "$ipv4_addrs" ] && {
|
||||
echo "$ipv4_addrs" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_VPS &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
log 1 "$(i18n "Add all %s nodes to %s[%s] direct connection complete." "IPv4" "ipset" "${IPSET_VPS}")"
|
||||
}
|
||||
local ipv6_addrs=$(uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}")
|
||||
[ -n "$ipv6_addrs" ] && {
|
||||
echo "$ipv6_addrs" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_VPS6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
|
||||
log 1 "$(i18n "Add all %s nodes to %s[%s] direct connection complete." "IPv6" "ipset" "${IPSET_VPS6}")"
|
||||
}
|
||||
}
|
||||
|
||||
filter_server_port() {
|
||||
|
||||
@@ -585,6 +585,7 @@ load_acl() {
|
||||
}
|
||||
|
||||
filter_haproxy() {
|
||||
[ "$(config_n_get @global_haproxy[0] balancing_enable 0)" != "1" ] && return
|
||||
for item in $(uci show $CONFIG | grep ".lbss=" | cut -d "'" -f 2); do
|
||||
get_host_ip ipv4 $(echo $item | awk -F ":" '{print $1}') 1
|
||||
done | insert_nftset $NFTSET_VPS "-1"
|
||||
@@ -602,10 +603,16 @@ filter_vps_addr() {
|
||||
}
|
||||
|
||||
filter_vpsip() {
|
||||
uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep -v "^127\.0\.0\.1$" | insert_nftset $NFTSET_VPS "-1"
|
||||
#log 1 "$(i18n "Add all %s nodes to %s[%s] direct connection complete." "IPv4" "nftset" "${$NFTSET_VPS}")"
|
||||
uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | insert_nftset $NFTSET_VPS6 "-1"
|
||||
#log 1 "$(i18n "Add all %s nodes to %s[%s] direct connection complete." "IPv6" "nftset" "${$NFTSET_VPS6}")"
|
||||
local ipv4_addrs=$(uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep -v "^127\.0\.0\.1$")
|
||||
[ -n "$ipv4_addrs" ] && {
|
||||
echo "$ipv4_addrs" | insert_nftset $NFTSET_VPS "-1"
|
||||
log_i18n 1 "Add all %s nodes to %s[%s] direct connection complete." "IPv4" "nftset" "${NFTSET_VPS}"
|
||||
}
|
||||
local ipv6_addrs=$(uci show $CONFIG | grep -E "(.address=|.download_address=)" | cut -d "'" -f 2 | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}")
|
||||
[ -n "$ipv6_addrs" ] && {
|
||||
echo "$ipv6_addrs" | insert_nftset $NFTSET_VPS6 "-1"
|
||||
log_i18n 1 "Add all %s nodes to %s[%s] direct connection complete." "IPv6" "nftset" "${NFTSET_VPS6}"
|
||||
}
|
||||
}
|
||||
|
||||
filter_server_port() {
|
||||
|
||||
Reference in New Issue
Block a user