luci-app-shadowsocks-libev: hide key, password value in instance overview
[project/luci.git] / applications / luci-app-shadowsocks-libev / luasrc / model / shadowsocks-libev.lua
index b11890f..0a14f33 100644 (file)
@@ -132,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
@@ -154,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>' % {