From 29c729b873035d988a69cb7075eb3f7467201e59 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Mon, 15 Sep 2025 01:16:34 +0200 Subject: [PATCH] use whitebind for electrs and btcpay --- home.admin/config.scripts/bitcoin.check.sh | 3 +++ home.admin/config.scripts/bonus.btcpayserver.sh | 7 ++++--- home.admin/config.scripts/bonus.electrs.sh | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/home.admin/config.scripts/bitcoin.check.sh b/home.admin/config.scripts/bitcoin.check.sh index d3d9511d9..f73a6b3ae 100755 --- a/home.admin/config.scripts/bitcoin.check.sh +++ b/home.admin/config.scripts/bitcoin.check.sh @@ -85,6 +85,9 @@ if [ "$1" == "prestart" ]; then sed -i '/^test.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf sed -i '/^signet.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf + # remove any whitelist entries (whitebind is used instead) + sed -i '/^whitelist=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf + # make sure bitcoin debug file exists echo "# make sure bitcoin debug file exists" touch ${bitcoinlog_path} diff --git a/home.admin/config.scripts/bonus.btcpayserver.sh b/home.admin/config.scripts/bonus.btcpayserver.sh index f06750c64..e90187c9d 100644 --- a/home.admin/config.scripts/bonus.btcpayserver.sh +++ b/home.admin/config.scripts/bonus.btcpayserver.sh @@ -59,6 +59,7 @@ function NBXplorerConfig() { sudo -u btcpay mkdir -p /home/btcpay/.nbxplorer/Main echo "\ network=mainnet +btcnodeendpoint=127.0.0.1:8336 btc.rpc.user=${RPC_USER} btc.rpc.password=${PASSWORD_B} postgres=User ID=nbxplorer;Host=localhost;Port=5432;Application Name=nbxplorer;MaxPoolSize=20;Database=nbxplorermainnet;Password='raspiblitz'; @@ -670,9 +671,9 @@ WantedBy=multi-user.target NBXplorerConfig - # whitelist localhost in bitcoind - if ! sudo grep -Eq "^whitelist=127.0.0.1" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then - echo "whitelist=127.0.0.1" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf + # whitelist connection in bitcoind + if ! sudo grep -Eq "^whitebind=127.0.0.1:8336" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then + echo "whitebind=127.0.0.1:8336" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf bitcoindRestart=yes fi diff --git a/home.admin/config.scripts/bonus.electrs.sh b/home.admin/config.scripts/bonus.electrs.sh index e8e33c5cf..b9138ff8c 100755 --- a/home.admin/config.scripts/bonus.electrs.sh +++ b/home.admin/config.scripts/bonus.electrs.sh @@ -376,6 +376,7 @@ index-batch-size = 10 wait_duration_secs = 10 jsonrpc_timeout_secs = 15 db_dir = \"/mnt/hdd/app-storage/electrs/db\" +daemon_p2p_addr = \"127.0.0.1:8335\" auth = \"${RPC_USER}:${PASSWORD_B}\" # allow BTC-RPC-explorer show tx-s for addresses with a history of more than 100 txid_limit = 1000 @@ -497,9 +498,9 @@ WantedBy=multi-user.target /home/admin/config.scripts/tor.onion-service.sh electrs 50002 50002 50001 50001 fi - # whitelist downloading to localhost from bitcoind - if ! sudo grep -Eq "^whitelist=download@127.0.0.1" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then - echo "whitelist=download@127.0.0.1" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf + # whitelist connection in bitcoind + if ! sudo grep -Eq "^whitebind=download@127.0.0.1:8335" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then + echo "whitebind=download@127.0.0.1:8335" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf bitcoindRestart=yes fi