luci-app-shadowsocks-libev: hide key, password value in instance overview
authorYousong Zhou <yszhou4tech@gmail.com>
Tue, 8 Aug 2017 03:20:20 +0000 (11:20 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Tue, 8 Aug 2017 03:25:22 +0000 (11:25 +0800)
This is mainly for ss_server section

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua

index 63f7ba3c25b6d6b30c18a1cc59a5bab1a34bd466..0a14f33554b8766c2231524c67f4e6f776737278 100644 (file)
@@ -156,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>' % {