mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-03-18 05:41:47 +01:00
privacy redact debug logs (#2817)
This commit is contained in:
parent
06dbfa3d1f
commit
167264ff50
@ -115,6 +115,7 @@ function release() {
|
||||
function debug() {
|
||||
echo "Printing debug logs. Be patient, this should take maximum 2 minutes ..."
|
||||
/home/admin/config.scripts/blitz.debug.sh > /var/cache/raspiblitz/debug.log
|
||||
/home/admin/config.scripts/blitz.debug.sh redact /var/cache/raspiblitz/debug.log
|
||||
if [ "$1" = "-l" ]||[ "$1" = "--link" ]; then
|
||||
proxy="-X 5 -x localhost:9050"
|
||||
if [ "$2" = "-n" ]||[ "$2" = "--no-tor" ]; then proxy=""; fi
|
||||
|
@ -2,6 +2,42 @@
|
||||
|
||||
# USE THIS SCRIPT FOR BASIC SYSTEM STATUS DEBUG INFO
|
||||
|
||||
if [ "$1" == "redact" ]; then
|
||||
|
||||
# get & check parameters
|
||||
redactFile=$2
|
||||
if [ "${redactFile}" == "" ]; then
|
||||
echo "# FAIL: missing second parameter"
|
||||
exit 1
|
||||
fi
|
||||
echo "# redacting file: ${redactFile}"
|
||||
if [ $(ls ${redactFile} 2>/dev/null | grep -c "${redactFile}") -lt 1 ]; then
|
||||
echo "# FAIL: file does not exist"
|
||||
exi 1
|
||||
fi
|
||||
|
||||
# redact nodeIDs
|
||||
sed -i 's/[a-z0-9]*@/***@/' ${redactFile}
|
||||
|
||||
# redact IPv4s
|
||||
sed -i 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/*.*.*.*/' ${redactFile}
|
||||
|
||||
# redact onion adresses
|
||||
sed -i 's/[a-z0-9]*.onion/***.onion/' ${redactFile}
|
||||
|
||||
# redact hostname
|
||||
sed -i 's/hostname=[^\r\n]*/hostname=*****/' ${redactFile}
|
||||
|
||||
# redact balances
|
||||
sed -i 's/[0-9]* mSAT/* mSAT/' ${redactFile}
|
||||
sed -i 's/[0-9]*.[0-9]* BTC/* BTC/' ${redactFile}
|
||||
sed -i 's/[0-9]*.[0-9]* BTC/* BTC/' ${redactFile}
|
||||
sed -i 's/balance=[^\r\n]*/balance=****/' ${redactFile}
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# load code software version
|
||||
source /home/admin/_version.info
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user