From 3ec94e0a834fe2a493983e41be7b2415ce8ecda1 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 12 Mar 2021 16:27:20 +0100 Subject: [PATCH] Anonymize config data in all settings tab --- .../luasrc/view/openmptcprouter/debug.htm | 2 +- .../root/bin/anonymous_config.sh | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 luci-app-openmptcprouter/root/bin/anonymous_config.sh diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/debug.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/debug.htm index 8a5f894c4..96db8aaa9 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/debug.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/debug.htm @@ -4,7 +4,7 @@

<%:All router settings%>

-
<%=luci.sys.exec("uci show")%>
+
<%=luci.sys.exec("sh /bin/anonymous_config.sh")%>
<%+footer%> diff --git a/luci-app-openmptcprouter/root/bin/anonymous_config.sh b/luci-app-openmptcprouter/root/bin/anonymous_config.sh new file mode 100755 index 000000000..80e67487c --- /dev/null +++ b/luci-app-openmptcprouter/root/bin/anonymous_config.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +uci show | \ + sed -e "/password=/s/......$/xxxxxx/" \ + -e "/detected_public_ipv4=/s/......$/xxxxxx/" \ + -e "/detected_ss_ipv4=/s/......$/xxxxxx/" \ + -e "/detected_public_ipv6=/s/......$/xxxxxx/" \ + -e "/detected_ss_ipv6=/s/......$/xxxxxx/" \ + -e "/publicip=/s/......$/xxxxxx/" \ + -e "/\.host=/s/......$/xxxxxx/" \ + -e "/\.ip=/s/......$/xxxxxx/" \ + -e "/\.ipv6=/s/......$/xxxxxx/" \ + -e "/user_id=/s/......$/xxxxxx/" \ + -e "/openvpn\.omr\.remote=/s/......$/xxxxxx/" \ + -e "/shadowsocks-libev\.sss.*\.server=/s/......$/xxxxxx/" \ + -e "/shadowsocks-libev\.sss.*\.key=/s/......$/xxxxxx/" \ + -e "/external_ip=/s/......$/xxxxxx/" \ + -e "/obfs_host=/s/......$/xxxxxx/" \ + -e "/vmess_address=/s/......$/xxxxxx/" \ + -e "/vless_address=/s/......$/xxxxxx/" \ + -e "/vpn\.key=/s/......$/xxxxxx/" \ + -e "/vps\.key=/s/......$/xxxxxx/" \ + -e "/token=/s/............$/xxxxxx/" \ No newline at end of file