mirror of
https://github.com/dennisreimann/kindle-display.git
synced 2026-08-13 12:33:45 +02:00
Add option to require Tor for outside API calls
This commit is contained in:
parent
2b180c5f71
commit
df178f4e4d
2 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,9 @@
|
|||
# Server port
|
||||
DISPLAY_SERVER_PORT=3030
|
||||
|
||||
# Require Tor for outside API calls
|
||||
DISPLAY_FORCE_TOR=false
|
||||
|
||||
# Bitcoin RPC credentials for getting the blockcount.
|
||||
# Omit these setting to use blockchain.info as a fallback.
|
||||
# DISPLAY_BITCOIN_RPC_USER="bitcoin-rpc-user"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ torCheck=$(torsocks curl -s https://check.torproject.org/ 2>/dev/null | grep -c
|
|||
if [ ${torCheck} -gt 0 ]; then
|
||||
tor="torsocks"
|
||||
fi
|
||||
if [[ -z "${tor}" && ${DISPLAY_FORCE_TOR} = true ]]; then
|
||||
echo >&2 'Tor is required, but not available.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get block height using RPC connection or Blockchain.info as fallback
|
||||
if [[ "${DISPLAY_BITCOIN_RPC_USER}" && "${DISPLAY_BITCOIN_RPC_PASS}" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue