mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Tricorder: Insecure Opt-out
* Check to see if Tricorder is being called directly * Provide opt-out for insecure transmission of debug log * Remove mention of internal function from help menu
This commit is contained in:
parent
703ff09a91
commit
da9ff0cc66
1 changed files with 15 additions and 2 deletions
17
pihole
17
pihole
|
@ -269,10 +269,24 @@ piholeCheckoutFunc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
tricorderFunc() {
|
tricorderFunc() {
|
||||||
|
if [ ! -p "/dev/stdin" ]; then
|
||||||
|
echo "Please do not call Tricorder directly."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v openssl &> /dev/null; then
|
if command -v openssl &> /dev/null; then
|
||||||
openssl s_client -quiet -connect tricorder.pi-hole.net:9998 2> /dev/null < /dev/stdin
|
openssl s_client -quiet -connect tricorder.pi-hole.net:9998 2> /dev/null < /dev/stdin
|
||||||
else
|
else
|
||||||
nc tricorder.pi-hole.net 9999 < /dev/stdin
|
echo "The debug log will be transmitted insecurely via plain-text"
|
||||||
|
echo "If you wish to cancel, press Ctrl-C to exit within 10 seconds"
|
||||||
|
secs="10"
|
||||||
|
while [ "$secs" -gt 0 ]; do
|
||||||
|
echo -ne "."
|
||||||
|
sleep 1
|
||||||
|
: $((secs--))
|
||||||
|
done
|
||||||
|
echo " "
|
||||||
|
nc tricorder.pi-hole.net 9999 < /dev/stdin < /dev/stdin
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +324,6 @@ helpFunc() {
|
||||||
::: 'pihole disable 5m' - will disable blocking for 5 minutes
|
::: 'pihole disable 5m' - will disable blocking for 5 minutes
|
||||||
::: restartdns Restart dnsmasq
|
::: restartdns Restart dnsmasq
|
||||||
::: checkout Check out different branches
|
::: checkout Check out different branches
|
||||||
::: tricorder Upload log to Pi-hole's medical tricorder (uses SSL when possible)
|
|
||||||
EOM
|
EOM
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue