mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-11-19 18:37:41 +01:00
Compare commits
3 Commits
whitebind
...
5122-mempo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bf3a59e66 | ||
|
|
6496a009ab | ||
|
|
8ca5f6192b |
@@ -85,6 +85,9 @@ if [ "$1" == "prestart" ]; then
|
|||||||
sed -i '/^test.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
sed -i '/^test.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||||
sed -i '/^signet.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
|
# make sure bitcoin debug file exists
|
||||||
echo "# make sure bitcoin debug file exists"
|
echo "# make sure bitcoin debug file exists"
|
||||||
touch ${bitcoinlog_path}
|
touch ${bitcoinlog_path}
|
||||||
|
|||||||
@@ -1342,16 +1342,16 @@ if [ "$action" = "copy-system" ]; then
|
|||||||
|
|
||||||
# RASPBERRY PI
|
# RASPBERRY PI
|
||||||
if [ "${computerType}" = "raspberrypi" ]; then
|
if [ "${computerType}" = "raspberrypi" ]; then
|
||||||
echo "# RaspberryPi - set LBA flag" >> ${logFile}
|
echo "# RaspberryPi - set ESP flag" >> ${logFile}
|
||||||
parted /dev/${actionDevice} --script set 1 lba on
|
parted /dev/${actionDevice} --script set 1 esp on
|
||||||
|
|
||||||
# DEBUG: Log partition count after LBA flag
|
# DEBUG: Log partition count after ESP flag
|
||||||
afterLBAPartitionCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterESPPartitionCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG: Partition count after LBA flag: ${afterLBAPartitionCount}" >> ${logFile}
|
echo "# DEBUG: Partition count after ESP flag: ${afterESPPartitionCount}" >> ${logFile}
|
||||||
|
|
||||||
isFlagSetLBA=$(parted /dev/${actionDevice} --script print | grep -c 'fat32.*lba')
|
isFlagSetESP=$(parted /dev/${actionDevice} --script print | grep -c 'esp')
|
||||||
if [ ${isFlagSetLBA} -eq 0 ]; then
|
if [ ${isFlagSetESP} -eq 0 ]; then
|
||||||
echo "error='failed to set LBA flag'"
|
echo "error='failed to set ESP flag'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "# RaspberryPi - Bootorder" >> ${logFile}
|
echo "# RaspberryPi - Bootorder" >> ${logFile}
|
||||||
@@ -1368,25 +1368,14 @@ if [ "$action" = "copy-system" ]; then
|
|||||||
|
|
||||||
# VM & PC
|
# VM & PC
|
||||||
else
|
else
|
||||||
echo "# VM & PC - set BOOT/ESP flag" >> ${logFile}
|
echo "# VM & PC - set ESP flag" >> ${logFile}
|
||||||
parted /dev/${actionDevice} --script set 1 boot on
|
|
||||||
|
|
||||||
# DEBUG: Log partition count after boot flag
|
|
||||||
afterBootPartitionCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
|
||||||
echo "# DEBUG: Partition count after boot flag: ${afterBootPartitionCount}" >> ${logFile}
|
|
||||||
|
|
||||||
parted /dev/${actionDevice} --script set 1 esp on
|
parted /dev/${actionDevice} --script set 1 esp on
|
||||||
|
|
||||||
# DEBUG: Log partition count after setting ESP flag
|
# DEBUG: Log partition count after setting ESP flag
|
||||||
afterESPPartitionCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterESPPartitionCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG: Partition count after ESP flag: ${afterESPPartitionCount}" >> ${logFile}
|
echo "# DEBUG: Partition count after ESP flag: ${afterESPPartitionCount}" >> ${logFile}
|
||||||
|
|
||||||
isFlagSetBOOT=$(parted /dev/${actionDevice} --script print | grep -c 'fat32.*boot')
|
isFlagSetESP=$(parted /dev/${actionDevice} --script print | grep -c 'esp')
|
||||||
if [ ${isFlagSetBOOT} -eq 0 ]; then
|
|
||||||
echo "error='failed to set BOOT flag'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
isFlagSetESP=$(parted /dev/${actionDevice} --script print | grep -c 'fat32.*esp')
|
|
||||||
if [ ${isFlagSetESP} -eq 0 ]; then
|
if [ ${isFlagSetESP} -eq 0 ]; then
|
||||||
echo "error='failed to set ESP flag'"
|
echo "error='failed to set ESP flag'"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1721,7 +1710,7 @@ if [ "$action" = "setup" ]; then
|
|||||||
afterWipeFsCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterWipeFsCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG SETUP SYSTEM: Partition count after wipefs: ${afterWipeFsCount}" >> ${logFile}
|
echo "# DEBUG SETUP SYSTEM: Partition count after wipefs: ${afterWipeFsCount}" >> ${logFile}
|
||||||
|
|
||||||
parted /dev/${actionDevice} --script mklabel msdos
|
parted /dev/${actionDevice} --script mklabel gpt
|
||||||
|
|
||||||
# DEBUG: Log partition count after mklabel
|
# DEBUG: Log partition count after mklabel
|
||||||
afterMklabelCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterMklabelCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
@@ -1770,16 +1759,16 @@ if [ "$action" = "setup" ]; then
|
|||||||
|
|
||||||
# RASPBERRY PI
|
# RASPBERRY PI
|
||||||
if [ "${computerType}" = "raspberrypi" ]; then
|
if [ "${computerType}" = "raspberrypi" ]; then
|
||||||
echo "# RaspberryPi - set LBA flag" >> ${logFile}
|
echo "# RaspberryPi - set ESP flag" >> ${logFile}
|
||||||
parted /dev/${actionDevice} --script set 1 lba on
|
parted /dev/${actionDevice} --script set 1 esp on
|
||||||
|
|
||||||
# DEBUG: Log partition count after LBA flag
|
# DEBUG: Log partition count after ESP flag
|
||||||
afterLBASystemCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterESPSysteemCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG SETUP SYSTEM: Partition count after LBA flag: ${afterLBASystemCount}" >> ${logFile}
|
echo "# DEBUG SETUP SYSTEM: Partition count after ESP flag: ${afterESPSysteemCount}" >> ${logFile}
|
||||||
|
|
||||||
isFlagSetLBA=$(parted /dev/${actionDevice} --script print | grep -c 'fat32.*lba')
|
isFlagSetESP=$(parted /dev/${actionDevice} --script print | grep -c 'esp')
|
||||||
if [ ${isFlagSetLBA} -eq 0 ]; then
|
if [ ${isFlagSetESP} -eq 0 ]; then
|
||||||
echo "error='failed to set LBA flag'"
|
echo "error='failed to set ESP flag'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "# RaspberryPi - Bootorder" >> ${logFile}
|
echo "# RaspberryPi - Bootorder" >> ${logFile}
|
||||||
@@ -1796,25 +1785,14 @@ if [ "$action" = "setup" ]; then
|
|||||||
|
|
||||||
# VM & PC
|
# VM & PC
|
||||||
else
|
else
|
||||||
echo "# VM & PC - set BOOT/ESP flag" >> ${logFile}
|
echo "# VM & PC - set ESP flag" >> ${logFile}
|
||||||
parted /dev/${actionDevice} --script set 1 boot on
|
|
||||||
|
|
||||||
# DEBUG: Log partition count after boot flag
|
|
||||||
afterBootFlagSystemCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
|
||||||
echo "# DEBUG SETUP SYSTEM: Partition count after boot flag: ${afterBootFlagSystemCount}" >> ${logFile}
|
|
||||||
|
|
||||||
parted /dev/${actionDevice} --script set 1 esp on
|
parted /dev/${actionDevice} --script set 1 esp on
|
||||||
|
|
||||||
# DEBUG: Log partition count after setting ESP flag
|
# DEBUG: Log partition count after setting ESP flag
|
||||||
afterESPFlagSystemCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterESPFlagSystemCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG SETUP SYSTEM: Partition count after ESP flag: ${afterESPFlagSystemCount}" >> ${logFile}
|
echo "# DEBUG SETUP SYSTEM: Partition count after ESP flag: ${afterESPFlagSystemCount}" >> ${logFile}
|
||||||
|
|
||||||
isFlagSetBOOT=$(parted /dev/${actionDevice} --script print | grep -c 'fat32.*boot')
|
isFlagSetESP=$(parted /dev/${actionDevice} --script print | grep -c 'esp')
|
||||||
if [ ${isFlagSetBOOT} -eq 0 ]; then
|
|
||||||
echo "error='failed to set BOOT flag'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
isFlagSetESP=$(parted /dev/${actionDevice} --script print | grep -c 'fat32.*esp')
|
|
||||||
if [ ${isFlagSetESP} -eq 0 ]; then
|
if [ ${isFlagSetESP} -eq 0 ]; then
|
||||||
echo "error='failed to set ESP flag'"
|
echo "error='failed to set ESP flag'"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1843,7 +1821,7 @@ if [ "$action" = "setup" ]; then
|
|||||||
afterWipeFsStorageCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterWipeFsStorageCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG SETUP STORAGE: Partition count after wipefs: ${afterWipeFsStorageCount}" >> ${logFile}
|
echo "# DEBUG SETUP STORAGE: Partition count after wipefs: ${afterWipeFsStorageCount}" >> ${logFile}
|
||||||
|
|
||||||
parted /dev/${actionDevice} --script mklabel msdos >> ${logFile}
|
parted /dev/${actionDevice} --script mklabel gpt >> ${logFile}
|
||||||
|
|
||||||
# DEBUG: Log partition count after mklabel
|
# DEBUG: Log partition count after mklabel
|
||||||
afterMklabelStorageCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterMklabelStorageCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
@@ -1938,7 +1916,7 @@ if [ "$action" = "setup" ]; then
|
|||||||
afterWipeFsNoBootCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterWipeFsNoBootCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG SETUP STORAGE NO-BOOT: Partition count after wipefs: ${afterWipeFsNoBootCount}" >> ${logFile}
|
echo "# DEBUG SETUP STORAGE NO-BOOT: Partition count after wipefs: ${afterWipeFsNoBootCount}" >> ${logFile}
|
||||||
|
|
||||||
parted /dev/${actionDevice} --script mklabel msdos >> ${logFile}
|
parted /dev/${actionDevice} --script mklabel gpt >> ${logFile}
|
||||||
|
|
||||||
# DEBUG: Log partition count after mklabel
|
# DEBUG: Log partition count after mklabel
|
||||||
afterMklabelNoBootCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterMklabelNoBootCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
@@ -2007,7 +1985,7 @@ if [ "$action" = "setup" ]; then
|
|||||||
afterWipeFsDataCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterWipeFsDataCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
echo "# DEBUG SETUP DATA: Partition count after wipefs: ${afterWipeFsDataCount}" >> ${logFile}
|
echo "# DEBUG SETUP DATA: Partition count after wipefs: ${afterWipeFsDataCount}" >> ${logFile}
|
||||||
|
|
||||||
parted /dev/${actionDevice} --script mklabel msdos
|
parted /dev/${actionDevice} --script mklabel gpt
|
||||||
|
|
||||||
# DEBUG: Log partition count after mklabel
|
# DEBUG: Log partition count after mklabel
|
||||||
afterMklabelDataCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
afterMklabelDataCount=$(partx -g /dev/"${actionDevice}" 2>/dev/null | wc -l)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ function NBXplorerConfig() {
|
|||||||
sudo -u btcpay mkdir -p /home/btcpay/.nbxplorer/Main
|
sudo -u btcpay mkdir -p /home/btcpay/.nbxplorer/Main
|
||||||
echo "\
|
echo "\
|
||||||
network=mainnet
|
network=mainnet
|
||||||
|
btcnodeendpoint=127.0.0.1:8336
|
||||||
btc.rpc.user=${RPC_USER}
|
btc.rpc.user=${RPC_USER}
|
||||||
btc.rpc.password=${PASSWORD_B}
|
btc.rpc.password=${PASSWORD_B}
|
||||||
postgres=User ID=nbxplorer;Host=localhost;Port=5432;Application Name=nbxplorer;MaxPoolSize=20;Database=nbxplorermainnet;Password='raspiblitz';
|
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
|
NBXplorerConfig
|
||||||
|
|
||||||
# whitelist localhost in bitcoind
|
# whitelist connection in bitcoind
|
||||||
if ! sudo grep -Eq "^whitelist=127.0.0.1" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then
|
if ! sudo grep -Eq "^whitebind=127.0.0.1:8336" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then
|
||||||
echo "whitelist=127.0.0.1" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
echo "whitebind=127.0.0.1:8336" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||||
bitcoindRestart=yes
|
bitcoindRestart=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -376,6 +376,7 @@ index-batch-size = 10
|
|||||||
wait_duration_secs = 10
|
wait_duration_secs = 10
|
||||||
jsonrpc_timeout_secs = 15
|
jsonrpc_timeout_secs = 15
|
||||||
db_dir = \"/mnt/hdd/app-storage/electrs/db\"
|
db_dir = \"/mnt/hdd/app-storage/electrs/db\"
|
||||||
|
daemon_p2p_addr = \"127.0.0.1:8335\"
|
||||||
auth = \"${RPC_USER}:${PASSWORD_B}\"
|
auth = \"${RPC_USER}:${PASSWORD_B}\"
|
||||||
# allow BTC-RPC-explorer show tx-s for addresses with a history of more than 100
|
# allow BTC-RPC-explorer show tx-s for addresses with a history of more than 100
|
||||||
txid_limit = 1000
|
txid_limit = 1000
|
||||||
@@ -497,9 +498,9 @@ WantedBy=multi-user.target
|
|||||||
/home/admin/config.scripts/tor.onion-service.sh electrs 50002 50002 50001 50001
|
/home/admin/config.scripts/tor.onion-service.sh electrs 50002 50002 50001 50001
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# whitelist downloading to localhost from bitcoind
|
# whitelist connection in bitcoind
|
||||||
if ! sudo grep -Eq "^whitelist=download@127.0.0.1" /mnt/hdd/app-data/bitcoin/bitcoin.conf; then
|
if ! sudo grep -Eq "^whitebind=download@127.0.0.1:8335" /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
|
echo "whitebind=download@127.0.0.1:8335" | sudo tee -a /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||||
bitcoindRestart=yes
|
bitcoindRestart=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,11 @@ if [ "$1" = "install" ]; then
|
|||||||
echo "# npm install for mempool explorer (frontend)"
|
echo "# npm install for mempool explorer (frontend)"
|
||||||
|
|
||||||
cd frontend || exit 1
|
cd frontend || exit 1
|
||||||
|
|
||||||
|
# patch to fix #5122 - remove on next mempool update because they fixed it
|
||||||
|
sudo -u mempool sed -i '/^function download(filename, url) {/a\ if (!url) return;' sync-assets.js
|
||||||
|
# end patch
|
||||||
|
|
||||||
if ! sudo -u mempool NG_CLI_ANALYTICS=false npm ci; then
|
if ! sudo -u mempool NG_CLI_ANALYTICS=false npm ci; then
|
||||||
echo "FAIL - npm install did not run correctly, aborting"
|
echo "FAIL - npm install did not run correctly, aborting"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user