summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-shadowsocks-libev/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-shadowsocks-libev/luasrc')
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua6
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/rules.lua7
-rw-r--r--applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua12
3 files changed, 19 insertions, 6 deletions
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua
index d9a61d0bf7..22f3106d03 100644
--- a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua
+++ b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev/instance-details.lua
@@ -24,6 +24,7 @@ s:tab("general", translate("General Settings"))
s:tab("advanced", translate("Advanced Settings"))
s:taboption("general", Flag, "disabled", translate("Disable"))
ss.option_install_package(s, "general")
+ss.options_common(s, "advanced")
if stype == "ss_server" then
ss.options_server(s, "general")
@@ -42,8 +43,11 @@ else
translate("Tunnel address"),
translate("The address ss-tunnel will forward traffic to"))
o.datatype = "hostport"
+ elseif stype == "ss_redir" then
+ o = s:taboption("advanced", Flag, "disable_sni",
+ translate("Disable SNI"),
+ translate("Disable parsing HTTP/HTTPS payload to find then resolve hostname at remote server"))
end
end
-ss.options_common(s, "advanced")
return m
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 fe5f9c31b8..5df59cb0ad 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
@@ -16,8 +16,13 @@ m = Map("shadowsocks-libev",
If the prior check results in action <em>checkdst</em>, packets will continue \
to have their destination addresses checked."))
+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)
+end
-s = m:section(NamedSection, "ss_rules", "ss-rules")
+s = m:section(NamedSection, "ss_rules", "ss_rules")
s:tab("general", translate("General Settings"))
s:tab("srcip", translate("Source Settings"))
s:tab("dstip", translate("Destination Settings"))
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 2753f458b5..6608ee8d35 100644
--- a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua
+++ b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua
@@ -22,7 +22,7 @@ end
function values_redir(o, xmode)
o.map.uci.foreach("shadowsocks-libev", "ss_redir", function(sdata)
local sname = sdata[".name"]
- local mode = sdata["mode"]
+ local mode = sdata["mode"] or "tcp_only"
if mode and mode:find(xmode) then
local desc = "%s - %s" % {sname, mode}
o:value(sname, desc)
@@ -108,6 +108,7 @@ function options_common(s, tab)
s:taboption(tab, Value, "user", translate("Run as"))
s:taboption(tab, Flag, "verbose", translate("Verbose"))
+ s:taboption(tab, Flag, "ipv6_first", translate("IPv6 First"), translate("Prefer IPv6 addresses when resolving names"))
s:taboption(tab, Flag, "fast_open", translate("Enable TCP Fast Open"))
s:taboption(tab, Flag, "reuse_port", translate("Enable SO_REUSEPORT"))
end
@@ -131,6 +132,8 @@ function cfgvalue_overview(sdata)
cfgvalue_overview_(sdata, lines, names_options_client)
if stype == "ss_tunnel" then
cfgvalue_overview_(sdata, lines, {"tunnel_address"})
+ elseif stype == "ss_redir" then
+ cfgvalue_overview_(sdata, lines, {"disable_sni"})
end
cfgvalue_overview_(sdata, lines, names_options_common)
else
@@ -153,6 +156,9 @@ function cfgvalue_overview_(sdata, lines, names)
for _, n in ipairs(names) do
local v = sdata[n]
if v ~= nil then
+ if n == "key" or n == "password" then
+ v = translate("<hidden>")
+ end
local fv = "<var>%s</var>" % ut.pcdata(v)
if sdata[".type"] ~= "ss_server" and n == "server" then
fv = '<a class="label" href="%s">%s</a>' % {
@@ -205,6 +211,7 @@ names_options_client = {
names_options_common = {
"verbose",
+ "ipv6_first",
"fast_open",
"reuse_port",
"mode",
@@ -247,7 +254,4 @@ methods = {
"salsa20",
"chacha20",
"chacha20-ietf",
- "aes-128-gcm",
- "aes-192-gcm",
- "aes-256-gcm",
}