浏览代码

luci-app-ssr-plus: Add WireGuard `kernelMode` `reserved` `keepalive` ` allowedips` argument

whether to use the virtual NIC TUN of the Linux kernel!Virtual NIC TUN of Linux kernel can be used only when system supports and have root permission.
Some routes cannot be connected if they are used.
zxlhhyccc 1 年之前
父节点
当前提交
c0abcd2647
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24 0
      luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

+ 24 - 0
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

@@ -831,11 +831,22 @@ o:depends("transport", "kcp")
 o.rmempty = true
 o.rmempty = true
 
 
 -- [[ WireGuard 部分 ]]--
 -- [[ WireGuard 部分 ]]--
+o = s:option(Flag, "kernelmode", translate("Enabled Kernel virtual NIC TUN(optional)"))
+o.description = translate("Virtual NIC TUN of Linux kernel can be used only when system supports and have root permission. If used, IPv6 routing table 1023 is occupied.")
+o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
+o.default = "0"
+o.rmempty = true
+
 o = s:option(DynamicList, "local_addresses", translate("Local addresses"))
 o = s:option(DynamicList, "local_addresses", translate("Local addresses"))
 o.datatype = "cidr"
 o.datatype = "cidr"
 o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
 o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
 o.rmempty = true
 o.rmempty = true
 
 
+o = s:option(DynamicList, "reserved", translate("Reserved bytes(optional)"))
+o.description = translate("Wireguard reserved bytes.")
+o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
+o.rmempty = true
+
 o = s:option(Value, "private_key", translate("Private key"))
 o = s:option(Value, "private_key", translate("Private key"))
 o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
 o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
 o.password = true
 o.password = true
@@ -850,6 +861,19 @@ o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
 o.password = true
 o.password = true
 o.rmempty = true
 o.rmempty = true
 
 
+o = s:option(Value, "keepalive", translate("Heartbeat interval(second)"))
+o.description = translate("Default value 0 indicatesno heartbeat.")
+o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
+o.default = "0"
+o.rmempty = true
+
+o = s:option(DynamicList, "allowedips", translate("allowedIPs(optional)"))
+o.description = translate("Wireguard allows only traffic from specific source IP.")
+o.datatype = "cidr"
+o:depends({type = "v2ray", v2ray_protocol = "wireguard"})
+o.default = "0.0.0.0/0"
+o.rmempty = true
+
 -- [[ TLS ]]--
 -- [[ TLS ]]--
 o = s:option(Flag, "tls", translate("TLS"))
 o = s:option(Flag, "tls", translate("TLS"))
 o.rmempty = true
 o.rmempty = true