summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-08-20 08:09:25 +0300
committerGitHub <noreply@github.com>2017-08-20 08:09:25 +0300
commit818959efdcebf9467ab1b8bd10e33b2f877b2f6c (patch)
tree4fb3fadf91fa65b6ebae378968088c231c08af22
parent57117c99598095ba6285c75b45e5b3ac64e68005 (diff)
parentf5ae714d9d7e33436613912c75fae6fc99c195ba (diff)
Merge pull request #1315 from yousong/shadowsocks-libev
luci-app-shadowsocks-libev: sync with shadowsocks-libev config changes
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua12
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua23
2 files changed, 24 insertions, 11 deletions
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua
index 5df59cb0a..998579017 100644
--- a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua
+++ b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua
@@ -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
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua
index 6608ee8d3..650ff6356 100644
--- a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua
+++ b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua
@@ -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",