mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-20 02:09:15 +01:00
1341 acme over tor by curl default proxy (#2110)
This commit is contained in:
parent
a1cf9b97ce
commit
b761e830d3
@ -21,6 +21,18 @@ ACME_CERT_HOME="${ACME_CONFIG_HOME}/certs"
|
||||
|
||||
ACME_IS_INSTALLED=0
|
||||
|
||||
# if Tor is on test that CURL is by default running over Tor
|
||||
if [ "${runBehindTor}" == "on" ]; then
|
||||
echo "# checking if Tor proxy for CURL is working ..."
|
||||
checkTor=$(curl -s https://check.torproject.org | grep -c "Congratulations")
|
||||
if [ ${checkTor} -eq 0 ]; then
|
||||
echo "err='curl tor proxy not working'"
|
||||
exit 1
|
||||
else
|
||||
echo "# OK Tor proxy for CURL"
|
||||
fi
|
||||
fi
|
||||
|
||||
###################
|
||||
# FUNCTIONS
|
||||
###################
|
||||
|
@ -173,6 +173,16 @@ fi
|
||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
echo "# switching Tor ON"
|
||||
|
||||
# *** CURL TOR PROXY ***
|
||||
echo "socks5-hostname localhost:9050" > .curlrc.tmp
|
||||
sudo cp ./.curlrc.tmp /root/.curlrc
|
||||
sudo chown root:root /home/admin/.curlrc
|
||||
sudo cp ./.curlrc.tmp /home/pi/.curlrc
|
||||
sudo chown pi:pi /home/pi/.curlrc
|
||||
sudo cp ./.curlrc.tmp /home/admin/.curlrc
|
||||
sudo chown admin:admin /home/admin/.curlrc
|
||||
rm .curlrc.tmp
|
||||
|
||||
# make sure the network was set (by sourcing raspiblitz.conf)
|
||||
if [ ${#network} -eq 0 ]; then
|
||||
echo "!! FAIL - unknown network due to missing /mnt/hdd/raspiblitz.conf"
|
||||
@ -384,6 +394,11 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
# setting value in raspi blitz config
|
||||
sudo sed -i "s/^runBehindTor=.*/runBehindTor=off/g" /mnt/hdd/raspiblitz.conf
|
||||
|
||||
# *** CURL TOR PROXY ***
|
||||
sudo rm /root/.curlrc
|
||||
sudo rm /home/pi/.curlrc
|
||||
sudo rm /home/admin/.curlrc
|
||||
|
||||
# disable TOR service
|
||||
echo "# *** Disable Tor service ***"
|
||||
sudo systemctl disable tor@default
|
||||
|
Loading…
Reference in New Issue
Block a user