#2247 fix IP2Tor/Letsencrypt subscriptions (#2298)

This commit is contained in:
/rootzoll 2021-05-13 18:45:09 +02:00 committed by GitHub
parent be19c565cb
commit a64c3c2922
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 12 deletions

View file

@ -46,8 +46,8 @@ cfg.reload()
# todo: make sure that also ACME script uses TOR if activated
session = requests.session()
if cfg.run_behind_tor.value:
session.proxies = {'http': 'socks5h://127.0.0.1:9050', 'https': 'socks5h://127.0.0.1:9050'}
# if cfg.run_behind_tor.value:
# session.proxies = {'http': 'socks5h://127.0.0.1:9050', 'https': 'socks5h://127.0.0.1:9050'}
#####################

View file

@ -22,16 +22,17 @@ 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
# TODO: issue https://github.com/rootzoll/raspiblitz/issues/1341
#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
@ -139,13 +140,18 @@ function refresh_certs_with_nginx() {
fi
certsDirectories=$(sudo ls ${ACME_CERT_HOME})
echo "# certsDirectories(${certsDirectories})"
directoryArray=(`echo "${certsDirectories}" | tr ' ' ' '`)
for i in "${directoryArray[@]}"; do
FQDN=$(echo "${i}" | cut -d "_" -f1)
echo "# i(${i})"
echo "# FQDN(${FQDN})"
# check if there is a LetsEncrypt Subscription for this domain
details=$(/home/admin/config.scripts/blitz.subscriptions.letsencrypt.py subscription-detail $FQDN)
if [ ${#details} -gt 10 ]; then
echo "# details(${details})"
# get target for that domain
options=$(echo "${details}" | jq -r ".target")