Merge pull request #1315 from yousong/shadowsocks-libev
luci-app-shadowsocks-libev: sync with shadowsocks-libev config changes
This commit is contained in:
commit
818959efdc
2 changed files with 24 additions and 11 deletions
|
@ -19,7 +19,7 @@ m = Map("shadowsocks-libev",
|
|||
local sdata = m:get('ss_rules')
|
||||
if not sdata then
|
||||
m:set('ss_rules', nil, 'ss_rules')
|
||||
m:set('ss_rules', 'ss_rules', 'disabled', true)
|
||||
m:set('ss_rules', 'disabled', true)
|
||||
end
|
||||
|
||||
s = m:section(NamedSection, "ss_rules", "ss_rules")
|
||||
|
@ -39,8 +39,12 @@ ss.values_redir(o, 'udp')
|
|||
|
||||
o = s:taboption('general', ListValue, "local_default",
|
||||
translate("Local-out default"),
|
||||
translate("Default action for locally generated packets"))
|
||||
translate("Default action for locally generated TCP packets"))
|
||||
ss.values_actions(o)
|
||||
o = s:taboption('general', DynamicList, "ifnames",
|
||||
translate("Ingress interfaces"),
|
||||
translate("Only apply rules on packets from these network interfaces"))
|
||||
ss.values_ifnames(o)
|
||||
s:taboption('general', Value, "ipt_args",
|
||||
translate("Extra arguments"),
|
||||
translate("Passes additional arguments to iptables. Use with care!"))
|
||||
|
@ -74,5 +78,9 @@ s:taboption('dstip', FileBrowser, "dst_ips_forward_file",
|
|||
translate("Dst ip forward file"),
|
||||
translate("File containing ip addresses for the purposes as with <em>Dst ip forward</em>"))
|
||||
o.datatype = "file"
|
||||
o = s:taboption('dstip', ListValue, "dst_default",
|
||||
translate("Dst default"),
|
||||
translate("Default action for packets whose destination addresses do not match any of the destination ip list"))
|
||||
ss.values_actions(o)
|
||||
|
||||
return m
|
||||
|
|
|
@ -14,8 +14,10 @@ module("luci.model.shadowsocks-libev", function(m)
|
|||
end)
|
||||
|
||||
function values_actions(o)
|
||||
for _, a in ipairs(actions) do
|
||||
o:value(a)
|
||||
o:value("bypass")
|
||||
o:value("forward")
|
||||
if o.option ~= "dst_default" then
|
||||
o:value("checkdst")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -43,7 +45,6 @@ function values_serverlist(o)
|
|||
end
|
||||
|
||||
function values_ipaddr(o)
|
||||
local keys, vals = {}, {}
|
||||
for _, v in ipairs(nw:get_interfaces()) do
|
||||
for _, a in ipairs(v:ipaddrs()) do
|
||||
o:value(a:host():string(), '%s (%s)' %{ a:host(), v:shortname() })
|
||||
|
@ -51,6 +52,14 @@ function values_ipaddr(o)
|
|||
end
|
||||
end
|
||||
|
||||
function values_ifnames(o)
|
||||
for _, v in ipairs(nw:get_interfaces()) do
|
||||
if v.dev then
|
||||
o:value(v.dev.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function options_client(s, tab)
|
||||
local o
|
||||
|
||||
|
@ -226,17 +235,13 @@ modes = {
|
|||
"udp_only",
|
||||
}
|
||||
|
||||
actions = {
|
||||
"bypass",
|
||||
"forward",
|
||||
"checkdst",
|
||||
}
|
||||
|
||||
methods = {
|
||||
-- aead
|
||||
"aes-128-gcm",
|
||||
"aes-192-gcm",
|
||||
"aes-256-gcm",
|
||||
"chacha20-ietf-poly1305",
|
||||
"xchacha20-ietf-poly1305",
|
||||
-- stream
|
||||
"table",
|
||||
"rc4",
|
||||
|
|
Loading…
Reference in a new issue