From e31b8b79a4252be6c36ed1c77b1aaf393e05eb32 Mon Sep 17 00:00:00 2001 From: Ivan K Date: Fri, 13 Dec 2024 19:28:34 +0300 Subject: [PATCH] refactor: Improve proxy config masking --- podkop/files/etc/init.d/podkop | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/podkop/files/etc/init.d/podkop b/podkop/files/etc/init.d/podkop index 80db37d..4df7664 100755 --- a/podkop/files/etc/init.d/podkop +++ b/podkop/files/etc/init.d/podkop @@ -1132,12 +1132,15 @@ check_proxy() { fi jq ' - .outbounds |= map(. + { - uuid: "MASKED-UUID", - server: "MASKED-SERVER", - tls: (if .tls.reality then .tls + {reality: (.reality + {public_key: "MASKED-PUBLIC-KEY"})} else .tls end) - }) - ' $SING_BOX_CONFIG + walk( + if type == "object" then + with_entries( + if [.key] | inside(["uuid", "server", "server_name", "password", "public_key", "short_id"]) then + .value = "MASKED" + else . end + ) + else . end + )' $SING_BOX_CONFIG nolog "Checking proxy connection..."