Skip to content

Commit

Permalink
Merge branch 'xiaorouji:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
esaaprillia authored Apr 28, 2024
2 parents e145e15 + 6ba4338 commit 2f100ec
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,13 @@ if singbox_tags:find("with_wireguard") then
o.default = "1420"
o:depends({ [option_name("protocol")] = "wireguard" })

o = s:option(Flag, option_name("wireguard_system_interface"), translate("System interface"))
o.default = 0
o:depends({ [option_name("protocol")] = "wireguard" })

o = s:option(Value, option_name("wireguard_interface_name"), translate("System interface name"))
o:depends({ [option_name("protocol")] = "wireguard" })

o = s:option(Value, option_name("wireguard_reserved"), translate("Reserved"), translate("Decimal numbers separated by \",\" or Base64-encoded strings."))
o:depends({ [option_name("protocol")] = "wireguard" })
end
Expand Down
4 changes: 2 additions & 2 deletions luci-app-passwall2/luasrc/passwall2/util_sing-box.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ function gen_outbound(flag, node, tag, proxy_table)
node.wireguard_reserved = #bytes > 0 and bytes or nil
end
protocol_table = {
system_interface = nil,
interface_name = nil,
system_interface = (node.wireguard_system_interface == "1") and true or false,
interface_name = node.wireguard_interface_name,
local_address = node.wireguard_local_address,
private_key = node.wireguard_secret_key,
peer_public_key = node.wireguard_public_key,
Expand Down
6 changes: 6 additions & 0 deletions luci-app-passwall2/po/zh-cn/passwall2.po
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,12 @@ msgstr "额外的对称加密密钥"
msgid "Local Address"
msgstr "本地地址"

msgid "System interface"
msgstr "系统接口"

msgid "System interface name"
msgstr "系统接口名称"

msgid "Decimal numbers separated by \",\" or Base64-encoded strings."
msgstr "用“,”隔开的十进制数字或 Base64 编码字符串。"

Expand Down
2 changes: 2 additions & 0 deletions luci-app-passwall2/root/usr/share/passwall2/nftables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,12 @@ add_firewall_rule() {
nft "flush chain inet fw4 PSW2_ICMP_REDIRECT"
nft "add rule inet fw4 PSW2_ICMP_REDIRECT ip daddr @$NFTSET_LANLIST counter return"
nft "add rule inet fw4 PSW2_ICMP_REDIRECT ip daddr @$NFTSET_VPSLIST counter return"
[ "${WRITE_IPSET_DIRECT}" = "1" ] && nft "add rule inet fw4 PSW2_ICMP_REDIRECT ip daddr @$nftset_global_whitelist counter return"

[ "$accept_icmpv6" = "1" ] && {
nft "add rule inet fw4 PSW2_ICMP_REDIRECT ip6 daddr @$NFTSET_LANLIST6 counter return"
nft "add rule inet fw4 PSW2_ICMP_REDIRECT ip6 daddr @$NFTSET_VPSLIST6 counter return"
[ "${WRITE_IPSET_DIRECT}" = "1" ] && nft "add rule inet fw4 PSW2_ICMP_REDIRECT ip6 daddr @$nftset_global_whitelist6 counter return"
}

nft "add rule inet fw4 dstnat meta l4proto {icmp,icmpv6} counter jump PSW2_ICMP_REDIRECT"
Expand Down

0 comments on commit 2f100ec

Please sign in to comment.