From 424779f67a49000bf386616bc031ac106d922586 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 27 Jun 2020 14:39:43 +0200 Subject: [PATCH 01/40] #1165 ThunderHub Update Info --- FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index f15b5f2e5..375803209 100644 --- a/FAQ.md +++ b/FAQ.md @@ -16,7 +16,7 @@ - New: Balance of Satoshis v5.39.4 (with update option) [details](https://github.com/alexbosworth/balanceofsatoshis) - New: Faraday [details](https://github.com/lightninglabs/faraday) - New: Let's Encrypt client [details](FAQ.md#how-to-use-the-lets-encrypt-client) -- New: ThunderHub v0.8.0 (with update option) [details](https://www.thunderhub.io) +- New: ThunderHub v0.8.4 (with update option) [details](https://www.thunderhub.io) - New: JoininBox (terminal based GUI for JoinMarket) [details](https://github.com/openoms/joininbox) - New: ZeroTier [details](https://zerotier.com/manual/) - Fix: DropBox StaticChannelBackup From 3610760fe3b28ae08fbeb12cb1cfed580f4b293c Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 27 Jun 2020 15:03:50 +0200 Subject: [PATCH 02/40] #1258 remove old btcsetdomain script --- .../config.scripts/bonus.btcpaysetdomain.sh | 373 ------------------ 1 file changed, 373 deletions(-) delete mode 100644 home.admin/config.scripts/bonus.btcpaysetdomain.sh diff --git a/home.admin/config.scripts/bonus.btcpaysetdomain.sh b/home.admin/config.scripts/bonus.btcpaysetdomain.sh deleted file mode 100644 index cf55a7820..000000000 --- a/home.admin/config.scripts/bonus.btcpaysetdomain.sh +++ /dev/null @@ -1,373 +0,0 @@ -#!/bin/bash - -source /mnt/hdd/raspiblitz.conf - -# script to set up nginx and the SSL certificate for BTCPay Server -# calls the config.scripts/internet.hiddenservice.sh for the Tor connection - -HEIGHT=20 -WIDTH=73 -CHOICE_HEIGHT=2 -BACKTITLE="RaspiBlitz" -TITLE="BTCPay Server Install" -MENU="Choose 'TOR' if you want to set up BTCPayServer -as a Tor Hidden service and use a self signed SSL certificate.\n\n -Choose 'DOMAIN' if you want to use a Domain Name or dynamicDNS -pointing to your public IP. You will need to forward ports from your -router to your RaspiBlitz and an email address to be used for -communication about the SSL certificate (very experimental).\n\n -For details or troubleshoot check for 'BTCPay' -in README of https://github.com/rootzoll/raspiblitz" -OPTIONS=(TOR "Tor access and a self-signed certificate"\ - DOMAIN "(Dynamic) Domain Name (experimental)") - -CHOICE=$(dialog --clear \ - --backtitle "$BACKTITLE" \ - --title "$TITLE" \ - --menu "$MENU" \ - $HEIGHT $WIDTH $CHOICE_HEIGHT \ - "${OPTIONS[@]}" \ - 2>&1 >/dev/tty) - -dialogcancel=$? -echo "done dialog" -clear - -# check if user canceled dialog -echo "dialogcancel(${dialogcancel})" -if [ ${dialogcancel} -eq 1 ]; then - echo "user cancelled" - exit 1 -fi - -clear -case $CHOICE in - - DOMAIN) - echo "setting up with own domain" - ownDomain=1 - ;; - TOR) - echo "setting up for Tor only" - if [ "${runBehindTor}" != "on" ]; then - whiptail --title " TOR needs be installed first " --msgbox "\ -Please activate TOR service first to use this option. -Use 'Run behind TOR' in the SERVICES submenu. -Once TOR is running, choose this option again. -" 9 58 - exit 1 - fi - ownDomain=0 - ;; -esac - -if [ ${#ownDomain} -eq 0 ]; then - echo "user cancelled" - exit 1 -fi - -# add default value to raspi config if needed -if ! grep -Eq "^BTCPayDomain=" /mnt/hdd/raspiblitz.conf; then - echo "BTCPayDomain=off" >> /mnt/hdd/raspiblitz.conf -fi - -echo "" -echo "***" -echo "Setting up Nginx and Certbot" -echo "***" -echo "" - -if [ $ownDomain -eq 1 ]; then - localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') - echo "" - echo "***" - echo "Confirm that the ports 80, 443 and 9735 are forwarded to your RaspiBlitz" - echo "" - echo "Press [ENTER] to continue or use [CTRL + C] to exit" - echo "" - echo "Example settings for your router:" - echo "forward the port 443 to port 443 on ${localip}" - echo "forward the port 9735 to port 9735 on ${localip}" - echo "forward the port 80 to port 80 on ${localip}" - read key - - echo "" - echo "***" - echo "Type your domain or dynamicDNS pointing to your public IP and press [ENTER] or use [CTRL + C] to exit" - echo "" - echo "Example:" - echo "btcpay.example.com" - read YOUR_DOMAIN - - echo "" - echo "***" - echo "Type an email address that will be used to message about the expiration of the SSL certificate and press [ENTER] or use [CTRL + C] to exit" - echo "" - echo "Example:" - echo "name@email.com" - read YOUR_EMAIL - - echo "" - echo "***" - echo "Creating the btcpay user" - echo "***" - echo "" - - # install nginx and certbot - sudo apt-get install nginx-full certbot -y - - sudo ufw allow 80 comment 'HTTP web server' - sudo ufw allow 443 comment 'btcpayserver SSL' - - # get SSL cert - sudo systemctl stop certbot 2>/dev/null - sudo certbot certonly -a standalone -m $YOUR_EMAIL --agree-tos -d $YOUR_DOMAIN -n --pre-hook "service nginx stop" --post-hook "service nginx start" - - # set nginx - sudo rm -f /etc/nginx/sites-enabled/default - sudo rm -f /etc/nginx/sites-enabled/btcpayserver - sudo rm -f /etc/nginx/sites-available/btcpayserver - - echo " -# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the -# scheme used to connect to this server -map \$http_x_forwarded_proto \$proxy_x_forwarded_proto { - default \$http_x_forwarded_proto; - '' \$scheme; -} -# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the -# server port the client connected to -map \$http_x_forwarded_port \$proxy_x_forwarded_port { - default \$http_x_forwarded_port; - '' \$server_port; -} -# If we receive Upgrade, set Connection to \"upgrade\"; otherwise, delete any -# Connection header that may have been passed to this server -map \$http_upgrade \$proxy_connection { - default upgrade; - '' close; -} -# Apply fix for very long server names -#server_names_hash_bucket_size 128; -# Prevent Nginx Information Disclosure -server_tokens off; -# Default dhparam -# Set appropriate X-Forwarded-Ssl header -map \$scheme \$proxy_x_forwarded_ssl { - default off; - https on; -} - -gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; -log_format vhost '\$host \$remote_addr - \$remote_user [\$time_local] ' - '\"\$request\" \$status \$body_bytes_sent ' - '\"\$http_referer\" \"\$http_user_agent\"'; -access_log off; -# HTTP 1.1 support -proxy_http_version 1.1; -proxy_buffering off; -proxy_set_header Host \$http_host; -proxy_set_header Upgrade \$http_upgrade; -proxy_set_header Connection \$proxy_connection; -proxy_set_header X-Real-IP \$remote_addr; -proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; -proxy_set_header X-Forwarded-Proto \$proxy_x_forwarded_proto; -proxy_set_header X-Forwarded-Ssl \$proxy_x_forwarded_ssl; -proxy_set_header X-Forwarded-Port \$proxy_x_forwarded_port; -# Mitigate httpoxy attack (see README for details) -proxy_set_header Proxy \"\"; - - -server { - listen 80 default_server; - server_name _; - return 301 https://\$host\$request_uri; -} - -server { - listen 443 ssl; - server_name $YOUR_DOMAIN; - ssl on; - - ssl_certificate /etc/letsencrypt/live/$YOUR_DOMAIN/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/$YOUR_DOMAIN/privkey.pem; - ssl_session_timeout 1d; - ssl_session_cache shared:SSL:50m; - ssl_session_tickets off; - ssl_protocols TLSv1.1 TLSv1.2; - ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK'; - ssl_prefer_server_ciphers on; - ssl_stapling on; - ssl_stapling_verify on; - ssl_trusted_certificate /etc/letsencrypt/live/$YOUR_DOMAIN/chain.pem; - - location / { - proxy_set_header Host \$host; - proxy_set_header X-Real-IP \$remote_addr; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - proxy_pass http://localhost:23000; - } -} -" | sudo tee -a /etc/nginx/sites-available/btcpayserver - - sudo ln -s /etc/nginx/sites-available/btcpayserver /etc/nginx/sites-enabled/ 2>/dev/null - - sudo systemctl restart nginx - - echo "" - echo "***" - echo "Setting up certbot-auto renewal service" - echo "***" - echo "" - - sudo rm -f /etc/systemd/system/certbot.timer - echo " -[Unit] -Description=Certbot-auto renewal service - -[Timer] -OnBootSec=20min -OnCalendar=*-*-* 4:00:00 - -[Install] -WantedBy=timers.target -" | sudo tee -a /etc/systemd/system/certbot.timer - - sudo rm -f /etc/systemd/system/certbot.service - echo " -[Unit] -Description=Certbot-auto renewal service -After=bitcoind.service - -[Service] -WorkingDirectory=/home/admin/ -ExecStart=sudo certbot renew --pre-hook \"service nginx stop\" --post-hook \"service nginx start\" - -User=admin -Group=admin -Type=simple -KillMode=process -TimeoutSec=60 -Restart=always -RestartSec=60 -" | sudo tee -a /etc/systemd/system/certbot.service - - sudo systemctl enable certbot.timer - -elif [ $ownDomain -eq 0 ]; then - YOUR_DOMAIN=localhost - - # disable certbot - sudo systemctl stop certbot.timer 2>/dev/null - sudo systemctl disable certbot.timer 2>/dev/null - sudo systemctl stop certbot 2>/dev/null - sudo systemctl disable certbot 2>/dev/null - - # create a self-signed ssl certificate - /home/admin/config.scripts/internet.selfsignedcert.sh - - # allow the HTTPS connection through the firewall - sudo ufw allow 443 comment 'Nginx' - - # set nginx - sudo rm -f /etc/nginx/sites-enabled/default - sudo rm -f /etc/nginx/sites-enabled/btcpayserver - sudo rm -f /etc/nginx/sites-available/btcpayserver - - echo " -# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the -# scheme used to connect to this server -map \$http_x_forwarded_proto \$proxy_x_forwarded_proto { - default \$http_x_forwarded_proto; - '' \$scheme; -} -# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the -# server port the client connected to -map \$http_x_forwarded_port \$proxy_x_forwarded_port { - default \$http_x_forwarded_port; - '' \$server_port; -} -# If we receive Upgrade, set Connection to \"upgrade\"; otherwise, delete any -# Connection header that may have been passed to this server -map \$http_upgrade \$proxy_connection { - default upgrade; - '' close; -} -# Apply fix for very long server names -#server_names_hash_bucket_size 128; -# Prevent Nginx Information Disclosure -server_tokens off; -# Default dhparam -# Set appropriate X-Forwarded-Ssl header -map \$scheme \$proxy_x_forwarded_ssl { - default off; - https on; -} - -gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; -log_format vhost '\$host \$remote_addr - \$remote_user [\$time_local] ' - '\"\$request\" \$status \$body_bytes_sent ' - '\"\$http_referer\" \"\$http_user_agent\"'; -access_log off; -# HTTP 1.1 support -proxy_http_version 1.1; -proxy_buffering off; -proxy_set_header Host \$http_host; -proxy_set_header Upgrade \$http_upgrade; -proxy_set_header Connection \$proxy_connection; -proxy_set_header X-Real-IP \$remote_addr; -proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; -proxy_set_header X-Forwarded-Proto \$proxy_x_forwarded_proto; -proxy_set_header X-Forwarded-Ssl \$proxy_x_forwarded_ssl; -proxy_set_header X-Forwarded-Port \$proxy_x_forwarded_port; -# Mitigate httpoxy attack (see README for details) -proxy_set_header Proxy \"\"; - - -server { - listen 23001 default_server; - server_name _; - return 301 https://\$host\$request_uri; -} - -server { - listen 443 ssl; - server_name $YOUR_DOMAIN; - ssl on; - - ssl_certificate /etc/ssl/certs/localhost.crt; - ssl_certificate_key /etc/ssl/private/localhost.key; - ssl_session_timeout 1d; - ssl_session_cache shared:SSL:50m; - ssl_session_tickets off; - ssl_protocols TLSv1.1 TLSv1.2; - ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK'; - ssl_prefer_server_ciphers on; - ssl_stapling off; - ssl_stapling_verify on; - - location / { - proxy_set_header Host \$host; - proxy_set_header X-Real-IP \$remote_addr; - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; - proxy_pass http://localhost:23000; - } -} -" | sudo tee -a /etc/nginx/sites-available/btcpayserver - - sudo ln -s /etc/nginx/sites-available/btcpayserver /etc/nginx/sites-enabled/ 2>/dev/null - - sudo systemctl restart nginx -fi - -# setting value in raspi blitz config -sudo sed -i "s/^BTCPayDomain=.*/BTCPayDomain=$YOUR_DOMAIN/g" /mnt/hdd/raspiblitz.conf - -if [ $ownDomain -eq 0 ]; then - # Hidden Service for BTCPay if Tor active - /home/admin/config.scripts/internet.hiddenservice.sh btcpay 80 23000 -fi - -echo "OK done - check the new option 'BTCPAY' on main menu for more info." From 3e5b6157f4cce95838af39370f4d320cc9237080 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 27 Jun 2020 21:19:56 +0200 Subject: [PATCH 03/40] #1275 keep old wallet.dat --- home.admin/XXcleanHDD.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home.admin/XXcleanHDD.sh b/home.admin/XXcleanHDD.sh index f20a09ecf..e856e6640 100755 --- a/home.admin/XXcleanHDD.sh +++ b/home.admin/XXcleanHDD.sh @@ -42,16 +42,20 @@ elif [ "${extraParameter}" = "-blockchain" ]; then echo "" echo "# DELETING ..." - # delete bitcoin blockchain (but keep config) + # delete bitcoin blockchain (but keep config & wallet) sudo mv /mnt/hdd/bitcoin/bitcoin.conf /mnt/hdd/bitcoin.conf 2>/dev/null + sudo mv /mnt/hdd/bitcoin/wallet.dat /mnt/hdd/wallet.dat 2>/dev/null sudo rm -f -r /mnt/hdd/bitcoin/* sudo mv /mnt/hdd/bitcoin.conf /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null + sudo mv /mnt/hdd/wallet.dat /mnt/hdd/bitcoin/wallet.dat 2>/dev/null sudo chown -R bitcoin:bitcoin /mnt/hdd/bitcoin - # delete litecoin blockchain (but keep config) + # delete litecoin blockchain (but keep config & wallet) sudo mv /mnt/hdd/litecoin/litecoin.conf /mnt/hdd/litecoin.conf 2>/dev/null + sudo mv /mnt/hdd/litecoin/wallet.dat /mnt/hdd/wallet.dat 2>/dev/null sudo rm -f -r /mnt/hdd/litecoin/* sudo mv /mnt/hdd/litecoin.conf /mnt/hdd/litecoin/litecoin.conf 2>/dev/null + sudo mv /mnt/hdd/wallet.dat /mnt/hdd/litecoin/wallet.dat 2>/dev/null sudo chown -R bitcoin:bitcoin /mnt/hdd/litecoin echo "OK Blockchain data deleted - you may want now run: /home/admin/98repairBlockchain.sh" From 0f8f8c2e6ef349b0beacd8c0464e00f1efcb976d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 27 Jun 2020 22:20:34 +0200 Subject: [PATCH 04/40] #1179 prevent TUI restart during COPY over LAN --- home.admin/_background.sh | 45 ++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/home.admin/_background.sh b/home.admin/_background.sh index 38a986fa6..1bd9fd76c 100644 --- a/home.admin/_background.sh +++ b/home.admin/_background.sh @@ -165,27 +165,38 @@ do recheckBlitzTUI=$(($counter % 30)) if [ "${touchscreen}" == "1" ] && [ ${recheckBlitzTUI} -eq 1 ]; then echo "BlitzTUI Monitoring Check" - if [ -d "/var/cache/raspiblitz" ]; then + + # prevent restart if COPY OVER LAN is running + # see: https://github.com/rootzoll/raspiblitz/issues/1179#issuecomment-646079467 + source ${infoFile} + if [ "${state}" == "copysource" ]; then + echo "- skip BlitzTUI check while COPY over LAN is running" + else + + if [ -d "/var/cache/raspiblitz" ]; then latestHeartBeatLine=$(sudo tail -n 300 /var/cache/raspiblitz/pi/blitz-tui.log | grep beat | tail -n 1) - else + else latestHeartBeatLine=$(sudo tail -n 300 /home/pi/blitz-tui.log | grep beat | tail -n 1) - fi - if [ ${#blitzTUIHeartBeatLine} -gt 0 ]; then - #echo "blitzTUIHeartBeatLine(${blitzTUIHeartBeatLine})" - #echo "latestHeartBeatLine(${latestHeartBeatLine})" - if [ "${blitzTUIHeartBeatLine}" == "${latestHeartBeatLine}" ]; then - echo "FAIL - still no new heart beat .. restarting BlitzTUI" - blitzTUIRestarts=$(($blitzTUIRestarts +1)) - if [ $(sudo cat /home/admin/raspiblitz.info | grep -c 'blitzTUIRestarts=') -eq 0 ]; then - echo "blitzTUIRestarts=0" >> /home/admin/raspiblitz.info - fi - sudo sed -i "s/^blitzTUIRestarts=.*/blitzTUIRestarts=${blitzTUIRestarts}/g" /home/admin/raspiblitz.info - sudo init 3 ; sleep 2 ; sudo init 5 fi - else - echo "blitzTUIHeartBeatLine is empty - skipping check" + if [ ${#blitzTUIHeartBeatLine} -gt 0 ]; then + #echo "blitzTUIHeartBeatLine(${blitzTUIHeartBeatLine})" + #echo "latestHeartBeatLine(${latestHeartBeatLine})" + if [ "${blitzTUIHeartBeatLine}" == "${latestHeartBeatLine}" ]; then + echo "FAIL - still no new heart beat .. restarting BlitzTUI" + blitzTUIRestarts=$(($blitzTUIRestarts +1)) + if [ $(sudo cat /home/admin/raspiblitz.info | grep -c 'blitzTUIRestarts=') -eq 0 ]; then + echo "blitzTUIRestarts=0" >> /home/admin/raspiblitz.info + fi + sudo sed -i "s/^blitzTUIRestarts=.*/blitzTUIRestarts=${blitzTUIRestarts}/g" /home/admin/raspiblitz.info + sudo init 3 ; sleep 2 ; sudo init 5 + fi + else + echo "blitzTUIHeartBeatLine is empty - skipping check" + fi + blitzTUIHeartBeatLine="${latestHeartBeatLine}" + fi - blitzTUIHeartBeatLine="${latestHeartBeatLine}" + fi ############################### From 72d361d9c844c2c7e45bc4c61f75c191515ad04e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sat, 27 Jun 2020 22:29:31 +0200 Subject: [PATCH 05/40] add comment on txindex --- home.admin/config.scripts/network.txindex.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/network.txindex.sh b/home.admin/config.scripts/network.txindex.sh index 74a50fd01..f0034c38c 100644 --- a/home.admin/config.scripts/network.txindex.sh +++ b/home.admin/config.scripts/network.txindex.sh @@ -23,7 +23,6 @@ if [ "${chain}" = "test" ]; then pathAdd="/testnet3" fi - ################### # STATUS ################### @@ -65,6 +64,8 @@ fi # switch on ################### if [ "$1" = "1" ] || [ "$1" = "on" ]; then + + # check txindex (parsed and sourced from bitcoin network config above) if [ ${txindex} == 0 ]; then sudo sed -i "s/^txindex=.*/txindex=1/g" /mnt/hdd/${network}/${network}.conf echo "switching txindex=1 and restarting ${network}d" From 570c977bb86014c5663467cc6ee91831a2ec0a1c Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 14:53:30 +0200 Subject: [PATCH 06/40] fix index status --- home.admin/config.scripts/network.txindex.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/network.txindex.sh b/home.admin/config.scripts/network.txindex.sh index f0034c38c..25848362d 100644 --- a/home.admin/config.scripts/network.txindex.sh +++ b/home.admin/config.scripts/network.txindex.sh @@ -47,7 +47,7 @@ if [ "$1" = "status" ]; then indexInfo="OK" else echo "isIndexed=0" - if [ ${#indexedToBlock} -gt 0 ]; then + if [ ${#indexedToBlock} -gt 0 ] && [ ${#blockchainHeight} -gt 0 ]; then progressPercent=$(printf %.2f $(echo "${indexedToBlock}/${blockchainHeight}*100" | bc -l)) indexInfo="Indexing is at ${progressPercent}% (please wait)" else From 7f27e67a9985b2d9dc0487a9c53250a6b70a585f Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 14:56:31 +0200 Subject: [PATCH 07/40] add command patch --- home.admin/_commands.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home.admin/_commands.sh b/home.admin/_commands.sh index 0279ce326..0e1d92fef 100644 --- a/home.admin/_commands.sh +++ b/home.admin/_commands.sh @@ -41,6 +41,13 @@ function debug() { ./XXdebugLogs.sh } +# command: patch +# syncs script with latest set github and branch +function patch() { + cd /home/admin + ./XXsyncScripts.sh -run +} + # command: restart function restart() { cd /home/admin From 6c76e38d0587d6207aba77e953ee2bc73626bf01 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 15:53:44 +0200 Subject: [PATCH 08/40] #1275 automated detecting failing txbuild --- home.admin/80scanLND.sh | 27 +++++++++++++++++--- home.admin/config.scripts/network.txindex.sh | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 33e9b49f9..25ad344ca 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -62,10 +62,31 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " echo ${bitcoinErrorFull} echo fi - echo "-> Use following command to debug: /home/admin/XXdebugLogs.sh" - echo "-> To force Main Menu run: /home/admin/00mainMenu.sh" - echo "-> To try restart: restart" + + # check if maybe problems with txindex + source <(/home/admin/config.scripts/network.txindex.sh status) + if [ "${txindex}" == "1" ]; then + if [ "${indexFinished}" == "0" ]; then + # bitcoind is not starting while still building index - recommend turning off index and restart + whiptail --title "Problems with Bitcoin Index" --yes-button "TurnOff TxIndex" --no-button "Do Nothing" --yesno "It looks like ${network}d has problems building the txindex. Turning Off the txindex and restart is recommended." 10 60 + if [ $? -eq 0 ]; then + # delete txindex, turn off and deactivate apps needed index + sudo /home/admin/config.scripts/network.txindex.sh delete + whiptail --msgbox "OK txindex was turned off.\n\nTo be able to build a valid txindex in the future you might need to reset/redownload the blockchain." 10 56 "" --title " TXINDEX OFF " + /home/admin/XXshutdown.sh reboot + fi + else + # bitcoind is not starting but index was build in the past - recommend repair with turning off index + echo "-> Use command 'repair' and then choose 'DELETE-INDEX' to try rebuilding transaction index." + fi + fi + + echo "-> Use command 'repair' and then choose 'RESET-CHAIN' to try downloading new blockchain." + echo "-> Use command 'debug' for more log output you can use for getting support." + echo "-> Use command 'menu' to open main menu." + echo "-> Have you tried to turn it off and on again? Use command 'restart'" echo "" + exit 1 fi else height=6 diff --git a/home.admin/config.scripts/network.txindex.sh b/home.admin/config.scripts/network.txindex.sh index 25848362d..8bd5ed37b 100644 --- a/home.admin/config.scripts/network.txindex.sh +++ b/home.admin/config.scripts/network.txindex.sh @@ -3,7 +3,7 @@ # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "config script to switch txindex on or off" - echo "network.txindex.sh [status|on|off]" + echo "network.txindex.sh [status|on|off|delete]" exit 1 fi From d3e1df959fd3de39b1cd72b6d623a72a24bbdff4 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 16:23:34 +0200 Subject: [PATCH 09/40] oprions on bitcoin not starting --- home.admin/80scanLND.sh | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 25ad344ca..78f05ca6b 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -42,9 +42,23 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " height=6 width=43 title="Blockchain Info" - if [ ${uptime} -gt 600 ] || [ "${1}" == "blockchain-error" ]; then - infoStr=" The ${network}d service is not running.\n Login for more details:" - if [ "$USER" == "admin" ]; then + + if [ ${#bitcoinErrorShort} -eq 0 ]; then + bitcoinErrorShort="Initial Startup - Please Wait" + fi + + if [ "$USER" != "admin" ]; then + + if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then + infoStr=" The ${network}d service is not running.\n Login for more details & options:" + else + infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Login with SSH for more details:" + fi + + else + + if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then + clear echo "" echo "*****************************************" @@ -86,13 +100,23 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " echo "-> Use command 'menu' to open main menu." echo "-> Have you tried to turn it off and on again? Use command 'restart'" echo "" + echo "Use CTRL+c to EXIT to Terminal" + sleep 10 exit 1 + + else + infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Please wait up to 10min ..." + fi + + fi + + if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then + + if [ "$USER" == "admin" ]; then + fi else - height=6 - if [ ${#bitcoinErrorShort} -eq 0 ]; then - bitcoinErrorShort="Initial Startup - Please Wait" - fi + infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Login with SSH for more details:" if [ "$USER" == "admin" ]; then infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Please wait up to 5min ..." From 6877c359d2aeb91e81d723b05c18defdab628534 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 16:31:05 +0200 Subject: [PATCH 10/40] fix syntax --- home.admin/80scanLND.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 78f05ca6b..34ef709d0 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -57,6 +57,8 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " else + # output when user login in as admin and bitcoind is not running + if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then clear @@ -110,19 +112,6 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " fi - if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then - - if [ "$USER" == "admin" ]; then - - fi - else - - infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Login with SSH for more details:" - if [ "$USER" == "admin" ]; then - infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Please wait up to 5min ..." - fi - fi - # LND errors second elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ] || [ "${1}" == "lightning-error" ]; then From eddce7b4b735ba8dc82a0953b73d37ea60d47bc6 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 16:35:36 +0200 Subject: [PATCH 11/40] exit to console --- home.admin/80scanLND.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 34ef709d0..338db78c3 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -59,7 +59,7 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " # output when user login in as admin and bitcoind is not running - if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then + if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${bitcoinErrorShort}" == "Error found in Logs" ] || [ "${1}" == "blockchain-error" ]; then clear echo "" From 05435ed0aec251433abacc821a2c1e9ee38e2adf Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 28 Jun 2020 19:29:32 +0200 Subject: [PATCH 12/40] change typo --- home.admin/80scanLND.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 338db78c3..38be904d2 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -50,7 +50,7 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " if [ "$USER" != "admin" ]; then if [ ${uptime} -gt 600 ] || ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == "blockchain-error" ]; then - infoStr=" The ${network}d service is not running.\n Login for more details & options:" + infoStr=" The ${network}d service is NOT RUNNING!\n\n Login for more details & options:" else infoStr=" The ${network}d service is starting:\n ${bitcoinErrorShort}\n Login with SSH for more details:" fi From 740bb4e7c9f7a113af91fb90036769ea425c8b93 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 03:15:31 +0200 Subject: [PATCH 13/40] correct time estimate --- home.admin/10setupBlitz.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/10setupBlitz.sh b/home.admin/10setupBlitz.sh index b66ff3952..5c781f16a 100755 --- a/home.admin/10setupBlitz.sh +++ b/home.admin/10setupBlitz.sh @@ -199,7 +199,7 @@ if [ ${isMounted} -eq 1 ]; then menuitem=$(dialog --clear --beep --backtitle "RaspiBlitz" --title " Getting the Blockchain " \ --menu "You need a copy of the Bitcoin Blockchain - choose method:" 13 75 5 \ S "SYNC --> Selfvalidate all Blocks (DEFAULT ±2days)" \ - C "COPY --> Copy from laptop/node over LAN (±4hours)" 2>&1 >/dev/tty) + C "COPY --> Copy from laptop/node over LAN (±6hours)" 2>&1 >/dev/tty) # Litecoin elif [ ${network} = "litecoin" ]; then From 0cd12993b45223c66add6398c41baad4bf5201d5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 04:44:32 +0200 Subject: [PATCH 14/40] improve txindex detection --- home.admin/config.scripts/bonus.btc-rpc-explorer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index c8382b237..0ea75977e 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -21,7 +21,7 @@ if [ "$1" = "menu" ]; then source <(sudo /home/admin/config.scripts/bonus.btc-rpc-explorer.sh status) # check if index is ready - if [ ${isIndexed} -eq 0 ]; then + if [ "${isIndexed}" == "0" ]; then dialog --title " Blockchain Index Not Ready " --msgbox " The Blockchain Index is still getting build. Please wait and try again later. From ae68f8f8e8b75ab727402ba22546334b42745927 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 04:46:41 +0200 Subject: [PATCH 15/40] show txindex info --- home.admin/config.scripts/bonus.btc-rpc-explorer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index 0ea75977e..8391c9c6a 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -24,7 +24,7 @@ if [ "$1" = "menu" ]; then if [ "${isIndexed}" == "0" ]; then dialog --title " Blockchain Index Not Ready " --msgbox " The Blockchain Index is still getting build. -Please wait and try again later. +${indexInfo} This can take multiple hours. " 9 48 exit 0 From e966207aec12b61b64c09ba839e8ef6736913bda Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Sat, 27 Jun 2020 21:17:40 +0200 Subject: [PATCH 16/40] Allow to configure mail notification host --- home.admin/config.scripts/blitz.notify.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/home.admin/config.scripts/blitz.notify.sh b/home.admin/config.scripts/blitz.notify.sh index fbb09b4de..198e76caa 100755 --- a/home.admin/config.scripts/blitz.notify.sh +++ b/home.admin/config.scripts/blitz.notify.sh @@ -33,7 +33,11 @@ if ! grep -Eq "^notifyMailTo=.*" /mnt/hdd/raspiblitz.conf; then fi if ! grep -Eq "^notifyMailServer=.*" /mnt/hdd/raspiblitz.conf; then - echo "notifyMailServer=mail@example.com" | sudo tee -a /mnt/hdd/raspiblitz.conf >/dev/null + echo "notifyMailServer=mail.example.com" | sudo tee -a /mnt/hdd/raspiblitz.conf >/dev/null +fi + +if ! grep -Eq "^notifyMailHostname=.*" /mnt/hdd/raspiblitz.conf; then + echo "notifyMailHostname=$(hostname)" | sudo tee -a /mnt/hdd/raspiblitz.conf >/dev/null fi if ! grep -Eq "^notifyMailUser=.*" /mnt/hdd/raspiblitz.conf; then @@ -81,13 +85,13 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. -root=${notifyMailTo} +Root=${notifyMailTo} # hostname of this system -hostname=${hostname} +Hostname=${notifyMailHostname} # relay/smarthost server settings -mailhub=${notifyMailServer} +Mailhub=${notifyMailServer} AuthUser=${notifyMailUser} AuthPass=${notifyMailPass} UseSTARTTLS=YES @@ -141,7 +145,7 @@ if [ "$1" = "send" ]; then elif [ "${notifyMethod}" = "slack" ]; then /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py slack -h "$2" else - echo "unknown notification method - check /mnt/hdd/raspiblitz.con" + echo "unknown notification method - check /mnt/hdd/raspiblitz.conf" fi exit 0 From 1e5201858ebb20472db8d7cafdd27a5b6f535e84 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Sat, 27 Jun 2020 22:13:30 +0200 Subject: [PATCH 17/40] Allow to specify additional mail arguments --- home.admin/config.scripts/blitz.notify.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/blitz.notify.sh b/home.admin/config.scripts/blitz.notify.sh index 198e76caa..c5d5e09a1 100755 --- a/home.admin/config.scripts/blitz.notify.sh +++ b/home.admin/config.scripts/blitz.notify.sh @@ -138,9 +138,9 @@ if [ "$1" = "send" ]; then /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py ext ${notifyExtCmd} "$2" elif [ "${notifyMethod}" = "mail" ]; then if [ "${notifyMailEncrypt}" = "on" ]; then - /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py mail --cert ${notifyMailToCert} --encrypt ${notifyMailTo} "$2" + /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py mail "${@:3}" --cert ${notifyMailToCert} --encrypt ${notifyMailTo} "$2" else - /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py mail ${notifyMailTo} "$2" + /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py mail "${@:3}" ${notifyMailTo} "$2" fi elif [ "${notifyMethod}" = "slack" ]; then /home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py slack -h "$2" From f8e953a0e4a6a55762fbd0c0b96b9a3e58e28f5c Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Sat, 27 Jun 2020 22:14:36 +0200 Subject: [PATCH 18/40] Allow to specify mail from header sSMTP requires a [config flag](https://tosbourn.com/allowing-your-own-from-header-with-ssmtp/) to allow setting the header. --- home.admin/XXsendNotification.py | 5 +++-- home.admin/config.scripts/blitz.notify.sh | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/home.admin/XXsendNotification.py b/home.admin/XXsendNotification.py index 0f444f893..1f55bbe33 100644 --- a/home.admin/XXsendNotification.py +++ b/home.admin/XXsendNotification.py @@ -93,6 +93,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False, print("send mail") print("msg: {}".format(message)) print("to: {}".format(recipient)) + print("from: {} <{}>".format(from_name, from_address)) print("subject: {}".format(subject)) print("cert: {}".format(cert)) print("encrypt: {}".format(encrypt)) @@ -103,7 +104,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False, msg_content = [ "To: {}".format(recipient), - 'From: "{} <{}>'.format(from_name, from_address), + 'From: {} <{}>'.format(from_name, from_address), "Subject: {}".format(subject), "", "{}".format(message) @@ -118,7 +119,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False, msg = EmailMessage() msg['Subject'] = "{}".format(subject) - msg['From'] = '"{} <{}>'.format(from_name, from_address), + msg['From'] = '{} <{}>'.format(from_name, from_address), msg['To'] = recipient msg.set_payload(message) diff --git a/home.admin/config.scripts/blitz.notify.sh b/home.admin/config.scripts/blitz.notify.sh index c5d5e09a1..63a00404e 100755 --- a/home.admin/config.scripts/blitz.notify.sh +++ b/home.admin/config.scripts/blitz.notify.sh @@ -95,6 +95,7 @@ Mailhub=${notifyMailServer} AuthUser=${notifyMailUser} AuthPass=${notifyMailPass} UseSTARTTLS=YES +FromLineOverride=YES EOF # edit raspi blitz config From d5cf0488a654982b0784eb4b8d978f8f07471fe1 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 14:49:12 +0200 Subject: [PATCH 19/40] #255 fix btc rpc explorer tor --- .../config.scripts/bonus.btc-rpc-explorer.sh | 31 +++++++++---------- home.admin/config.scripts/bonus.rtl.sh | 2 +- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index 8391c9c6a..16580366d 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -6,8 +6,8 @@ # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "small config script to switch BTC-RPC-explorer on or off" - echo "bonus.btc-rpc-explorer.sh [status|on|off]" + echo "# small config script to switch BTC-RPC-explorer on or off" + echo "# bonus.btc-rpc-explorer.sh [status|on|off]" exit 1 fi @@ -89,12 +89,12 @@ if [ "$1" = "status" ]; then fi # stop service -echo "making sure services are not running" +echo "# making sure services are not running" sudo systemctl stop btc-rpc-explorer 2>/dev/null # switch on if [ "$1" = "1" ] || [ "$1" = "on" ]; then - echo "*** INSTALL BTC-RPC-EXPLORER ***" + echo "# *** INSTALL BTC-RPC-EXPLORER ***" isInstalled=$(sudo ls /etc/systemd/system/btc-rpc-explorer.service 2>/dev/null | grep -c 'btc-rpc-explorer.service') if [ ${isInstalled} -eq 0 ]; then @@ -116,7 +116,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then sudo -u btcrpcexplorer npm install # prepare .env file - echo "getting RPC credentials from the ${network}.conf" + echo "# getting RPC credentials from the ${network}.conf" RPC_USER=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcuser | cut -c 9-) PASSWORD_B=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-) @@ -155,7 +155,7 @@ EOF sudo chown btcrpcexplorer:btcrpcexplorer /home/btcrpcexplorer/.config/btc-rpc-explorer.env # open firewall - echo "*** Updating Firewall ***" + echo "# *** Updating Firewall ***" sudo ufw allow 3020 comment 'btc-rpc-explorer HTTP' sudo ufw allow 3021 comment 'btc-rpc-explorer HTTPS' echo "" @@ -205,17 +205,17 @@ EOF sudo mv /home/admin/btc-rpc-explorer.service /etc/systemd/system/btc-rpc-explorer.service sudo systemctl enable btc-rpc-explorer - echo "OK - the BTC-RPC-explorer service is now enabled" + echo "# OK - the BTC-RPC-explorer service is now enabled" else - echo "BTC-RPC-explorer already installed." + echo "# BTC-RPC-explorer already installed." fi # setting value in raspi blitz config sudo sed -i "s/^BTCRPCexplorer=.*/BTCRPCexplorer=on/g" /mnt/hdd/raspiblitz.conf - echo "needs to finish creating txindex to be functional" - echo "monitor with: sudo tail -n 20 -f /mnt/hdd/bitcoin/debug.log" + echo "# needs to finish creating txindex to be functional" + echo "# monitor with: sudo tail -n 20 -f /mnt/hdd/bitcoin/debug.log" ## Enable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active # see /home/admin/config.scripts/bonus.electrsexplorer.sh @@ -224,8 +224,7 @@ EOF # Hidden Service for BTC-RPC-explorer if Tor is active source /mnt/hdd/raspiblitz.conf if [ "${runBehindTor}" = "on" ]; then - # correct old Hidden Service with port - sudo sed -i "s/^HiddenServicePort 80 127.0.0.1:3002/HiddenServicePort 80 127.0.0.1:3022/g" /etc/tor/torrc + echo "# Creating Tor Hidden Service" /home/admin/config.scripts/internet.hiddenservice.sh btc-rpc-explorer 80 3022 443 3023 fi exit 0 @@ -239,7 +238,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then isInstalled=$(sudo ls /etc/systemd/system/btc-rpc-explorer.service 2>/dev/null | grep -c 'btc-rpc-explorer.service') if [ ${isInstalled} -eq 1 ]; then - echo "*** REMOVING BTC-RPC-explorer ***" + echo "# *** REMOVING BTC-RPC-explorer ***" sudo systemctl disable btc-rpc-explorer sudo rm /etc/systemd/system/btc-rpc-explorer.service # delete user and home directory @@ -255,10 +254,10 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo nginx -t sudo systemctl reload nginx - echo "OK BTC-RPC-explorer removed." + echo "# OK BTC-RPC-explorer removed." else - echo "BTC-RPC-explorer is not installed." + echo "# BTC-RPC-explorer is not installed." fi # close ports on firewall @@ -267,5 +266,5 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then exit 0 fi -echo "FAIL - Unknown Parameter $1" +echo "error='unknown parameter' exit 1 diff --git a/home.admin/config.scripts/bonus.rtl.sh b/home.admin/config.scripts/bonus.rtl.sh index 6930862f9..700c1c7dd 100755 --- a/home.admin/config.scripts/bonus.rtl.sh +++ b/home.admin/config.scripts/bonus.rtl.sh @@ -214,7 +214,7 @@ EOF # Hidden Service for RTL if Tor is active if [ "${runBehindTor}" = "on" ]; then - # correct old Hidden Service with port + echo "# Creating Tor Hidden Service" sudo sed -i "s/^HiddenServicePort 80 127.0.0.1:3000/HiddenServicePort 80 127.0.0.1:3002/g" /etc/tor/torrc /home/admin/config.scripts/internet.hiddenservice.sh RTL 80 3002 443 3003 fi From db607655f2767dcd02e81cd3816bb571be13985f Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 15:35:13 +0200 Subject: [PATCH 20/40] add fingerprint info to explorer --- home.admin/config.scripts/bonus.btc-rpc-explorer.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index 16580366d..763aacc87 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -33,6 +33,7 @@ This can take multiple hours. # get network info localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') toraddress=$(sudo cat /mnt/hdd/tor/btc-rpc-explorer/hostname 2>/dev/null) + fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then @@ -40,19 +41,23 @@ This can take multiple hours. /home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}" whiptail --title " BTC-RPC-Explorer " --msgbox "Open the following URL in your local web browser: https://${localip}:3021 +SHA1 Thumb/Fingerprint: +${fingerprint}\n Login is 'admin' with your Password B\n Hidden Service address for TOR Browser (QR see LCD): ${toraddress} -" 12 67 +" 14 67 /home/admin/config.scripts/blitz.lcd.sh hide else # IP + Domain whiptail --title " BTC-RPC-Explorer " --msgbox "Open the following URL in your local web browser: https://${localip}:3021 +SHA1 Thumb/Fingerprint: +${fingerprint}\n Login is 'admin' with your Password B\n Activate TOR to access the web block explorer from outside your local network. -" 12 54 +" 14 54 fi echo "please wait ..." From 3e97d3fc4d97c26b5b8ebbb097ecc12c955889b8 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 16:06:12 +0200 Subject: [PATCH 21/40] bigger dialog window --- home.admin/config.scripts/bonus.btc-rpc-explorer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index 763aacc87..0194966e3 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -46,7 +46,7 @@ ${fingerprint}\n Login is 'admin' with your Password B\n Hidden Service address for TOR Browser (QR see LCD): ${toraddress} -" 14 67 +" 15 67 /home/admin/config.scripts/blitz.lcd.sh hide else From 3176f71f0924f7aea167f7c4daa323863dd9a1ff Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 16:07:12 +0200 Subject: [PATCH 22/40] format dialog content --- home.admin/config.scripts/bonus.btc-rpc-explorer.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index 0194966e3..6a558a479 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -40,24 +40,24 @@ This can take multiple hours. # TOR /home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}" whiptail --title " BTC-RPC-Explorer " --msgbox "Open the following URL in your local web browser: -https://${localip}:3021 +https://${localip}:3021\n SHA1 Thumb/Fingerprint: ${fingerprint}\n Login is 'admin' with your Password B\n Hidden Service address for TOR Browser (QR see LCD): ${toraddress} -" 15 67 +" 16 67 /home/admin/config.scripts/blitz.lcd.sh hide else # IP + Domain whiptail --title " BTC-RPC-Explorer " --msgbox "Open the following URL in your local web browser: -https://${localip}:3021 +https://${localip}:3021\n SHA1 Thumb/Fingerprint: ${fingerprint}\n Login is 'admin' with your Password B\n Activate TOR to access the web block explorer from outside your local network. -" 14 54 +" 16 54 fi echo "please wait ..." From 4c58298e58d3e10a58fbddaea5845fd0dac8a034 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 16:10:19 +0200 Subject: [PATCH 23/40] format dialog content --- home.admin/config.scripts/bonus.rtl.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/bonus.rtl.sh b/home.admin/config.scripts/bonus.rtl.sh index 700c1c7dd..2ab567994 100755 --- a/home.admin/config.scripts/bonus.rtl.sh +++ b/home.admin/config.scripts/bonus.rtl.sh @@ -28,22 +28,22 @@ if [ "$1" = "menu" ]; then # Info with TOR /home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}" whiptail --title " Ride The Lightning (RTL) " --msgbox "Open the following URL in your local web browser: -https://${localip}:3001 +https://${localip}:3001\n SHA1 Thumb/Fingerprint: ${fingerprint}\n Use your Password B to login.\n Hidden Service address for TOR Browser (QRcode on LCD):\n${toraddress} -" 15 67 +" 16 67 /home/admin/config.scripts/blitz.lcd.sh hide else # Info without TOR whiptail --title " Ride The Lightning (RTL) " --msgbox "Open the following URL in your local web browser: -https://${localip}:3001 +https://${localip}:3001\n SHA1 Thumb/Fingerprint: ${fingerprint}\n Use your Password B to login.\n Activate TOR to access the web interface from outside your local network. -" 14 57 +" 15 57 fi echo "please wait ..." exit 0 From 7be9bf9f717efc138513ee69d82c1c433314c2dd Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 17:31:12 +0200 Subject: [PATCH 24/40] add fingerprint info to specter --- .../config.scripts/bonus.cryptoadvance-specter.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh index 144193711..fea9ad063 100755 --- a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh +++ b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh @@ -23,6 +23,7 @@ if [ "$1" = "menu" ]; then # get network info localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') toraddress=https://$(sudo cat /mnt/hdd/tor/cryptoadvance-specter/hostname 2>/dev/null) + fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then @@ -31,23 +32,28 @@ if [ "$1" = "menu" ]; then whiptail --title " Cryptoadvance Specter " --msgbox "Open the following URL in your local web browser: https://${localip}:25441 -You have to accept the self-signed-certificate. +SHA1 Thumb/Fingerprint: +${fingerprint} + Login with the Pin being Password B. If you have connected to a different Bitcoin RPC Endpoint, the Pin is the configured RPCPassword. Hidden Service address for TOR Browser (QR see LCD): ${toraddress}\n -" 15 74 +" 17 74 /home/admin/config.scripts/blitz.lcd.sh hide else # IP + Domain whiptail --title " Cryptoadvance Specter " --msgbox "Open the following URL in your local web browser: https://${localip}:25441 -You have to accept the self-signed-certificate. + +SHA1 Thumb/Fingerprint: +${fingerprint} + Login with the Pin being Password B. If you have connected to a different Bitcoin RPC Endpoint, the Pin is the configured RPCPassword.\n Activate TOR to access the web block explorer from outside your local network. Unfortunately the camera is currently not usable via Tor, though. -" 12 54 +" 15 54 fi echo "# please wait ..." From 666dff6da2c6dce499d479acbe43020abc813421 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 17:41:16 +0200 Subject: [PATCH 25/40] unify tor address display with the rest --- home.admin/config.scripts/bonus.cryptoadvance-specter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh index fea9ad063..34f7990ec 100755 --- a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh +++ b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh @@ -22,7 +22,7 @@ if [ "$1" = "menu" ]; then # get network info localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') - toraddress=https://$(sudo cat /mnt/hdd/tor/cryptoadvance-specter/hostname 2>/dev/null) + toraddress=$(sudo cat /mnt/hdd/tor/cryptoadvance-specter/hostname 2>/dev/null) fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then From aacb8e64fcb11f12dff113c7a0feb84aa56240ba Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 17:44:06 +0200 Subject: [PATCH 26/40] unify info display --- home.admin/config.scripts/bonus.thunderhub.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/bonus.thunderhub.sh b/home.admin/config.scripts/bonus.thunderhub.sh index be4e485e5..9e961b878 100644 --- a/home.admin/config.scripts/bonus.thunderhub.sh +++ b/home.admin/config.scripts/bonus.thunderhub.sh @@ -28,22 +28,22 @@ if [ "$1" = "menu" ]; then # Info with TOR /home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}" whiptail --title " ThunderHub " --msgbox "Open the following URL in your local web browser: -https://${localip}:3011 +https://${localip}:3011\n SHA1 Thumb/Fingerprint: ${fingerprint}\n Use your Password B to login.\n Hidden Service address for TOR Browser (see LCD for QR):\n${toraddress} -" 15 67 +" 16 67 /home/admin/config.scripts/blitz.lcd.sh hide else # Info without TOR whiptail --title " ThunderHub " --msgbox "Open the following URL in your local web browser: -https://${localip}:3011 +https://${localip}:3011\n SHA1 Thumb/Fingerprint: ${fingerprint}\n Use your Password B to login.\n Activate TOR to access the web interface from outside your local network. -" 14 57 +" 15 57 fi echo "please wait ..." exit 0 From b60cac9153bd7aaf87729a9a5926ea8b28fce5b0 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 18:17:08 +0200 Subject: [PATCH 27/40] #1171 try to put specter behind nginx --- .../nginx/sites-available/specter_ssl.conf | 20 +++++++++ .../sites-available/specter_tor_ssl.conf | 20 +++++++++ .../bonus.cryptoadvance-specter.sh | 44 +++++++++++++------ 3 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 home.admin/assets/nginx/sites-available/specter_ssl.conf create mode 100644 home.admin/assets/nginx/sites-available/specter_tor_ssl.conf diff --git a/home.admin/assets/nginx/sites-available/specter_ssl.conf b/home.admin/assets/nginx/sites-available/specter_ssl.conf new file mode 100644 index 000000000..5602fcd45 --- /dev/null +++ b/home.admin/assets/nginx/sites-available/specter_ssl.conf @@ -0,0 +1,20 @@ +## btcrpcexplorer_ssl.conf + +server { + listen 25442 ssl; + listen [::]:25442 ssl; + server_name _; + + include /etc/nginx/snippets/ssl-params.conf; + include /etc/nginx/snippets/ssl-certificate-app-data.conf; + + access_log /var/log/nginx/access_specter.log; + error_log /var/log/nginx/error_specter.log; + + location / { + proxy_pass http://127.0.0.1:25441; + + include /etc/nginx/snippets/ssl-proxy-params.conf; + } + +} diff --git a/home.admin/assets/nginx/sites-available/specter_tor_ssl.conf b/home.admin/assets/nginx/sites-available/specter_tor_ssl.conf new file mode 100644 index 000000000..a03846c87 --- /dev/null +++ b/home.admin/assets/nginx/sites-available/specter_tor_ssl.conf @@ -0,0 +1,20 @@ +## btcrpcexplorer_tor_ssl.conf + +server { + listen localhost:25444 ssl; + listen [::1]:25444 ssl; + server_name _; + + include /etc/nginx/snippets/ssl-params.conf; + include /etc/nginx/snippets/ssl-certificate-app-data.conf; + + access_log /var/log/nginx/access_specter.log; + error_log /var/log/nginx/error_specter.log; + + location / { + proxy_pass http://127.0.0.1:25441; + + include /etc/nginx/snippets/ssl-proxy-params.conf; + } + +} diff --git a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh index 34f7990ec..212826f8b 100755 --- a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh +++ b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh @@ -116,18 +116,30 @@ EOF echo "# --> pip-installing specter" sudo -u bitcoin /home/bitcoin/.specter/.env/bin/python3 -m pip install --upgrade cryptoadvance.specter - # Mandatory as the camera doesn't work without https - echo "# --> Creating self-signed certificate" - openssl req -x509 -newkey rsa:4096 -nodes -out /tmp/cert.pem -keyout /tmp/key.pem -days 365 -subj "/C=US/ST=Nooneknows/L=Springfield/O=Dis/CN=www.fakeurl.com" - sudo mv /tmp/cert.pem /home/bitcoin/.specter - sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/cert.pem - sudo mv /tmp/key.pem /home/bitcoin/.specter - sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/key.pem + # echo "# --> Creating self-signed certificate" + # openssl req -x509 -newkey rsa:4096 -nodes -out /tmp/cert.pem -keyout /tmp/key.pem -days 365 -subj "/C=US/ST=Nooneknows/L=Springfield/O=Dis/CN=www.fakeurl.com" + # sudo mv /tmp/cert.pem /home/bitcoin/.specter + # sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/cert.pem + # sudo mv /tmp/key.pem /home/bitcoin/.specter + # sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/key.pem + + # setup nginx symlinks + if ! [ -f /etc/nginx/sites-available/rtl_ssl.conf ]; then + sudo cp /home/admin/assets/nginx/sites-available/specter_ssl.conf /etc/nginx/sites-available/specter_ssl.conf + fi + if ! [ -f /etc/nginx/sites-available/rtl_tor_ssl.conf ]; then + sudo cp /home/admin/assets/nginx/sites-available/specter_tor_ssl.conf /etc/nginx/sites-available/specter_tor_ssl.conf + fi + sudo ln -sf /etc/nginx/sites-available/specter_ssl.conf /etc/nginx/sites-enabled/ + sudo ln -sf /etc/nginx/sites-available/specter_tor_ssl.conf /etc/nginx/sites-enabled/ + sudo nginx -t + sudo systemctl reload nginx # open firewall echo "# --> Updating Firewall" - sudo ufw allow 25441 comment 'cryptoadvance-specter' + sudo ufw allow 25441 comment 'SPECTER HTTP' + sudo ufw allow 25442 comment 'SPECTER HTTPS' sudo ufw --force enable echo "" @@ -214,7 +226,7 @@ Wants=${network}d.service After=${network}d.service [Service] -ExecStart=/home/bitcoin/.specter/.env/bin/python3 -m cryptoadvance.specter server --host 0.0.0.0 --cert=/home/bitcoin/.specter/cert.pem --key=/home/bitcoin/.specter/key.pem +ExecStart=/home/bitcoin/.specter/.env/bin/python3 -m cryptoadvance.specter server --host 0.0.0.0 User=bitcoin Environment=PATH=/home/bitcoin/.specter.env/bin:/home/bitcoin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin Restart=always @@ -242,11 +254,7 @@ EOF # Hidden Service for SERVICE if Tor is active source /mnt/hdd/raspiblitz.conf if [ "${runBehindTor}" = "on" ]; then - echo "# --> correct old Hidden Service with port" - sudo sed -i "s/^HiddenServicePort 25441 127.0.0.1:25441/HiddenServicePort 80 127.0.0.1:25441/g" /etc/tor/torrc - sudo sed -i "s/^HiddenServicePort 25441 127.0.0.1:80/HiddenServicePort 443 127.0.0.1:25441/g" /etc/tor/torrc - # port 25441 is HTTPS with self-signed cert - /home/admin/config.scripts/internet.hiddenservice.sh cryptoadvance-specter 443 25441 + /home/admin/config.scripts/internet.hiddenservice.sh cryptoadvance-specter 443 25444 fi exit 0 fi @@ -264,6 +272,14 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo systemctl disable cryptoadvance-specter sudo rm /etc/systemd/system/cryptoadvance-specter.service + # remove nginx symlinks + sudo rm -f /etc/nginx/sites-enabled/specter_ssl.conf + sudo rm -f /etc/nginx/sites-enabled/specter_tor_ssl.conf + sudo rm -f /etc/nginx/sites-available/specter_ssl.conf + sudo rm -f /etc/nginx/sites-available/specter_tor_ssl.conf + sudo nginx -t + sudo systemctl reload nginx + if whiptail --defaultno --yesno "Do you want to delete all Data related to specter? This includes also Bitcoin-Core-Wallets managed by specter?" 0 0; then echo "# --> Removing wallets in core" bitcoin-cli listwallets | jq -r .[] | tail -n +2 From 8974d87e74a649945ac7ea4de365f565acfee7f7 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 18:37:54 +0200 Subject: [PATCH 28/40] fix install script --- home.admin/config.scripts/bonus.cryptoadvance-specter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh index 212826f8b..952e6ce7e 100755 --- a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh +++ b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh @@ -125,10 +125,10 @@ EOF # sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/key.pem # setup nginx symlinks - if ! [ -f /etc/nginx/sites-available/rtl_ssl.conf ]; then + if ! [ -f /etc/nginx/sites-available/specter_ssl.conf ]; then sudo cp /home/admin/assets/nginx/sites-available/specter_ssl.conf /etc/nginx/sites-available/specter_ssl.conf fi - if ! [ -f /etc/nginx/sites-available/rtl_tor_ssl.conf ]; then + if ! [ -f /etc/nginx/sites-available/specter_tor_ssl.conf]; then sudo cp /home/admin/assets/nginx/sites-available/specter_tor_ssl.conf /etc/nginx/sites-available/specter_tor_ssl.conf fi sudo ln -sf /etc/nginx/sites-available/specter_ssl.conf /etc/nginx/sites-enabled/ From 8baf05bafb7945960a96daef2ce19213ad34289e Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Mon, 29 Jun 2020 19:01:38 +0200 Subject: [PATCH 29/40] Allow email body to contain emoji --- home.admin/XXsendNotification.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/XXsendNotification.py b/home.admin/XXsendNotification.py index 1f55bbe33..70e10c3c8 100644 --- a/home.admin/XXsendNotification.py +++ b/home.admin/XXsendNotification.py @@ -107,7 +107,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False, 'From: {} <{}>'.format(from_name, from_address), "Subject: {}".format(subject), "", - "{}".format(message) + "{}".format(message.encode('utf8')) ] with open(cert, 'rb') as pem: @@ -122,7 +122,7 @@ def mail(recipient=None, message=None, subject=None, cert=None, encrypt=False, msg['From'] = '{} <{}>'.format(from_name, from_address), msg['To'] = recipient - msg.set_payload(message) + msg.set_payload(message.encode('utf8')) msg_to_send = msg.as_bytes() # send message via e-Mail From e1f24cb4aa664243d2270aafe26e62443802933d Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 19:33:23 +0200 Subject: [PATCH 30/40] #1171 revert specter using own ssl selfgenerated --- .../nginx/sites-available/specter_ssl.conf | 20 --------- .../sites-available/specter_tor_ssl.conf | 20 --------- .../bonus.cryptoadvance-specter.sh | 44 ++++++------------- 3 files changed, 14 insertions(+), 70 deletions(-) delete mode 100644 home.admin/assets/nginx/sites-available/specter_ssl.conf delete mode 100644 home.admin/assets/nginx/sites-available/specter_tor_ssl.conf diff --git a/home.admin/assets/nginx/sites-available/specter_ssl.conf b/home.admin/assets/nginx/sites-available/specter_ssl.conf deleted file mode 100644 index 5602fcd45..000000000 --- a/home.admin/assets/nginx/sites-available/specter_ssl.conf +++ /dev/null @@ -1,20 +0,0 @@ -## btcrpcexplorer_ssl.conf - -server { - listen 25442 ssl; - listen [::]:25442 ssl; - server_name _; - - include /etc/nginx/snippets/ssl-params.conf; - include /etc/nginx/snippets/ssl-certificate-app-data.conf; - - access_log /var/log/nginx/access_specter.log; - error_log /var/log/nginx/error_specter.log; - - location / { - proxy_pass http://127.0.0.1:25441; - - include /etc/nginx/snippets/ssl-proxy-params.conf; - } - -} diff --git a/home.admin/assets/nginx/sites-available/specter_tor_ssl.conf b/home.admin/assets/nginx/sites-available/specter_tor_ssl.conf deleted file mode 100644 index a03846c87..000000000 --- a/home.admin/assets/nginx/sites-available/specter_tor_ssl.conf +++ /dev/null @@ -1,20 +0,0 @@ -## btcrpcexplorer_tor_ssl.conf - -server { - listen localhost:25444 ssl; - listen [::1]:25444 ssl; - server_name _; - - include /etc/nginx/snippets/ssl-params.conf; - include /etc/nginx/snippets/ssl-certificate-app-data.conf; - - access_log /var/log/nginx/access_specter.log; - error_log /var/log/nginx/error_specter.log; - - location / { - proxy_pass http://127.0.0.1:25441; - - include /etc/nginx/snippets/ssl-proxy-params.conf; - } - -} diff --git a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh index 952e6ce7e..34f7990ec 100755 --- a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh +++ b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh @@ -116,30 +116,18 @@ EOF echo "# --> pip-installing specter" sudo -u bitcoin /home/bitcoin/.specter/.env/bin/python3 -m pip install --upgrade cryptoadvance.specter + # Mandatory as the camera doesn't work without https - # echo "# --> Creating self-signed certificate" - # openssl req -x509 -newkey rsa:4096 -nodes -out /tmp/cert.pem -keyout /tmp/key.pem -days 365 -subj "/C=US/ST=Nooneknows/L=Springfield/O=Dis/CN=www.fakeurl.com" - # sudo mv /tmp/cert.pem /home/bitcoin/.specter - # sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/cert.pem - # sudo mv /tmp/key.pem /home/bitcoin/.specter - # sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/key.pem - - # setup nginx symlinks - if ! [ -f /etc/nginx/sites-available/specter_ssl.conf ]; then - sudo cp /home/admin/assets/nginx/sites-available/specter_ssl.conf /etc/nginx/sites-available/specter_ssl.conf - fi - if ! [ -f /etc/nginx/sites-available/specter_tor_ssl.conf]; then - sudo cp /home/admin/assets/nginx/sites-available/specter_tor_ssl.conf /etc/nginx/sites-available/specter_tor_ssl.conf - fi - sudo ln -sf /etc/nginx/sites-available/specter_ssl.conf /etc/nginx/sites-enabled/ - sudo ln -sf /etc/nginx/sites-available/specter_tor_ssl.conf /etc/nginx/sites-enabled/ - sudo nginx -t - sudo systemctl reload nginx + echo "# --> Creating self-signed certificate" + openssl req -x509 -newkey rsa:4096 -nodes -out /tmp/cert.pem -keyout /tmp/key.pem -days 365 -subj "/C=US/ST=Nooneknows/L=Springfield/O=Dis/CN=www.fakeurl.com" + sudo mv /tmp/cert.pem /home/bitcoin/.specter + sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/cert.pem + sudo mv /tmp/key.pem /home/bitcoin/.specter + sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/key.pem # open firewall echo "# --> Updating Firewall" - sudo ufw allow 25441 comment 'SPECTER HTTP' - sudo ufw allow 25442 comment 'SPECTER HTTPS' + sudo ufw allow 25441 comment 'cryptoadvance-specter' sudo ufw --force enable echo "" @@ -226,7 +214,7 @@ Wants=${network}d.service After=${network}d.service [Service] -ExecStart=/home/bitcoin/.specter/.env/bin/python3 -m cryptoadvance.specter server --host 0.0.0.0 +ExecStart=/home/bitcoin/.specter/.env/bin/python3 -m cryptoadvance.specter server --host 0.0.0.0 --cert=/home/bitcoin/.specter/cert.pem --key=/home/bitcoin/.specter/key.pem User=bitcoin Environment=PATH=/home/bitcoin/.specter.env/bin:/home/bitcoin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin Restart=always @@ -254,7 +242,11 @@ EOF # Hidden Service for SERVICE if Tor is active source /mnt/hdd/raspiblitz.conf if [ "${runBehindTor}" = "on" ]; then - /home/admin/config.scripts/internet.hiddenservice.sh cryptoadvance-specter 443 25444 + echo "# --> correct old Hidden Service with port" + sudo sed -i "s/^HiddenServicePort 25441 127.0.0.1:25441/HiddenServicePort 80 127.0.0.1:25441/g" /etc/tor/torrc + sudo sed -i "s/^HiddenServicePort 25441 127.0.0.1:80/HiddenServicePort 443 127.0.0.1:25441/g" /etc/tor/torrc + # port 25441 is HTTPS with self-signed cert + /home/admin/config.scripts/internet.hiddenservice.sh cryptoadvance-specter 443 25441 fi exit 0 fi @@ -272,14 +264,6 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo systemctl disable cryptoadvance-specter sudo rm /etc/systemd/system/cryptoadvance-specter.service - # remove nginx symlinks - sudo rm -f /etc/nginx/sites-enabled/specter_ssl.conf - sudo rm -f /etc/nginx/sites-enabled/specter_tor_ssl.conf - sudo rm -f /etc/nginx/sites-available/specter_ssl.conf - sudo rm -f /etc/nginx/sites-available/specter_tor_ssl.conf - sudo nginx -t - sudo systemctl reload nginx - if whiptail --defaultno --yesno "Do you want to delete all Data related to specter? This includes also Bitcoin-Core-Wallets managed by specter?" 0 0; then echo "# --> Removing wallets in core" bitcoin-cli listwallets | jq -r .[] | tail -n +2 From d565a11aa2825963dc8ef0f62ae3b30be9a79f4f Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 19:45:13 +0200 Subject: [PATCH 31/40] add https again --- home.admin/config.scripts/bonus.cryptoadvance-specter.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh index 34f7990ec..ba68a3c86 100755 --- a/home.admin/config.scripts/bonus.cryptoadvance-specter.sh +++ b/home.admin/config.scripts/bonus.cryptoadvance-specter.sh @@ -23,7 +23,7 @@ if [ "$1" = "menu" ]; then # get network info localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') toraddress=$(sudo cat /mnt/hdd/tor/cryptoadvance-specter/hostname 2>/dev/null) - fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) + fingerprint=$(openssl x509 -in /home/bitcoin/.specter/cert.pem -fingerprint -noout | cut -d"=" -f2) if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then @@ -38,7 +38,7 @@ ${fingerprint} Login with the Pin being Password B. If you have connected to a different Bitcoin RPC Endpoint, the Pin is the configured RPCPassword. Hidden Service address for TOR Browser (QR see LCD): -${toraddress}\n +https://${toraddress}\n " 17 74 /home/admin/config.scripts/blitz.lcd.sh hide else @@ -119,7 +119,7 @@ EOF # Mandatory as the camera doesn't work without https echo "# --> Creating self-signed certificate" - openssl req -x509 -newkey rsa:4096 -nodes -out /tmp/cert.pem -keyout /tmp/key.pem -days 365 -subj "/C=US/ST=Nooneknows/L=Springfield/O=Dis/CN=www.fakeurl.com" + openssl req -x509 -newkey rsa:4096 -nodes -out /tmp/cert.pem -keyout /tmp/key.pem -days 365 -subj "/C=US/ST=Nooneknows/L=Springfield/O=Dis/CN=www.fakeurl.com" sudo mv /tmp/cert.pem /home/bitcoin/.specter sudo chown -R bitcoin:bitcoin /home/bitcoin/.specter/cert.pem sudo mv /tmp/key.pem /home/bitcoin/.specter From e32d80204865da09ce698f7adfac0b660ed6ad99 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:35:10 +0200 Subject: [PATCH 32/40] #1298 oprion to allow empty password --- home.admin/config.scripts/blitz.setpassword.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index 31af5e09b..b30940e34 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -5,7 +5,7 @@ if [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "small config script to set a passwords A,B,C & D" echo "blitz.setpassword.sh [?a|b|c|d] [?newpassword] " echo "or just as a password enter dialog (result as file)" - echo "blitz.setpassword.sh [x] [text] [result-file]" + echo "blitz.setpassword.sh [x] [text] [result-file] [?empty-allowed]" echo "exits on 0 = needs reboot" exit 1 fi @@ -327,7 +327,7 @@ elif [ "${abcd}" = "x" ]; then fi # password zero - if [ ${#password1} -eq 0 ]; then + if [ ${#password1} -eq 0 ] && [ "$4" != "empty-allowed" ]; then dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52 sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" exit 1 @@ -342,7 +342,7 @@ elif [ "${abcd}" = "x" ]; then fi # password longer than 8 - if [ ${#password1} -lt 8 ]; then + if [ ${#password1} -lt 8 ] && [ "$4" != "empty-allowed" ]; then dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52 sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" exit 1 From b1d2ae4528cac84ca1db5125d3b7ac8fee63530a Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:38:20 +0200 Subject: [PATCH 33/40] #1298 allow cancel --- home.admin/70initLND.sh | 2 +- .../config.scripts/blitz.setpassword.sh | 40 ++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index a88d378f8..a8877e175 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -354,7 +354,7 @@ to protect the seed words. Most users did not set this. " 11 65 if [ $? -eq 1 ]; then sudo shred -u /home/admin/.pass.tmp 2>/dev/null - sudo /home/admin/config.scripts/blitz.setpassword.sh x "Enter extra Password D" /home/admin/.pass.tmp + sudo /home/admin/config.scripts/blitz.setpassword.sh x "Enter extra Password D" /home/admin/.pass.tmp empty-allowed passwordD=`sudo cat /home/admin/.pass.tmp` sudo shred -u /home/admin/.pass.tmp 2>/dev/null fi diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index b30940e34..fd0f8d358 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -326,26 +326,30 @@ elif [ "${abcd}" = "x" ]; then exit 1 fi - # password zero - if [ ${#password1} -eq 0 ] && [ "$4" != "empty-allowed" ]; then - dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" - exit 1 - fi + if [ "$4" != "empty-allowed" ]; then - # check that password does not contain bad characters - clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ') - if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then - dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" - exit 1 - fi + # password zero + if [ ${#password1} -eq 0 ]; then + dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52 + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + exit 1 + fi + + # check that password does not contain bad characters + clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ') + if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then + dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52 + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + exit 1 + fi + + # password longer than 8 + if [ ${#password1} -lt 8 ]; then + dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52 + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + exit 1 + fi - # password longer than 8 - if [ ${#password1} -lt 8 ] && [ "$4" != "empty-allowed" ]; then - dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" - exit 1 fi # store result is file From f325990190ea92a9bada2adc609d2bd0beee2756 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:41:44 +0200 Subject: [PATCH 34/40] #1298 accept cancel on first ask --- home.admin/config.scripts/blitz.setpassword.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index fd0f8d358..6ae0552d8 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -317,7 +317,10 @@ elif [ "${abcd}" = "x" ]; then password1=$(whiptail --passwordbox "\n${text}:\n(min 8chars, 1word, chars+number, no specials)" 10 52 "" --backtitle "RaspiBlitz" 3>&1 1>&2 2>&3) # ask user for new password A (second time) - password2=$(whiptail --passwordbox "\nRe-Enter the Password:\n(to test if typed in correctly)" 10 52 "" --backtitle "RaspiBlitz" 3>&1 1>&2 2>&3) + password2="" + if [ ${#password1} -gt 0 ]; then + password2=$(whiptail --passwordbox "\nRe-Enter the Password:\n(to test if typed in correctly)" 10 52 "" --backtitle "RaspiBlitz" 3>&1 1>&2 2>&3) + fi # check if passwords match if [ "${password1}" != "${password2}" ]; then From 87777a04e54d6b8efc31d96f47b6b834d60482de Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:43:35 +0200 Subject: [PATCH 35/40] add parameter for recursive call --- home.admin/config.scripts/blitz.setpassword.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index 6ae0552d8..546dec3e7 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -325,7 +325,7 @@ elif [ "${abcd}" = "x" ]; then # check if passwords match if [ "${password1}" != "${password2}" ]; then dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Passwords dont Match\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" "$4" exit 1 fi @@ -334,7 +334,7 @@ elif [ "${abcd}" = "x" ]; then # password zero if [ ${#password1} -eq 0 ]; then dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" "$4" exit 1 fi @@ -342,14 +342,14 @@ elif [ "${abcd}" = "x" ]; then clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ') if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" "$4" exit 1 fi # password longer than 8 if [ ${#password1} -lt 8 ]; then dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52 - sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" + sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" "$4" exit 1 fi From b871ec23d8858c69f286a594192f011575e40903 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:44:51 +0200 Subject: [PATCH 36/40] bigger dialog --- home.admin/config.scripts/blitz.setpassword.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index 546dec3e7..8bf02c156 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -341,7 +341,7 @@ elif [ "${abcd}" = "x" ]; then # check that password does not contain bad characters clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ') if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then - dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52 + dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 62 sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3" "$4" exit 1 fi From 28cf54db0ea37df2d9492e04cf30ce973790c4ac Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:51:55 +0200 Subject: [PATCH 37/40] updated problem shooting info --- home.admin/80scanLND.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 38be904d2..29a124ee4 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -155,9 +155,9 @@ elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ] || [ "${1}" == "lightn echo ${lndErrorFull} fi echo - echo "-> Use following command to debug: /home/admin/XXdebugLogs.sh" - echo "-> To force Main Menu run: /home/admin/00mainMenu.sh" - echo "-> To try restart: restart" + echo "-> Use command 'debug' for more log output you can use for getting support." + echo "-> Use command 'menu' to open main menu." + echo "-> Have you tried to turn it off and on again? Use command 'restart'" echo "" exit 1 else From 1a5fe1aa6d529dffd36db174d4a44b8856769a7e Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 29 Jun 2020 21:54:29 +0200 Subject: [PATCH 38/40] offer backup info --- home.admin/80scanLND.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 29a124ee4..158724fdf 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -155,6 +155,7 @@ elif [ ${lndActive} -eq 0 ] || [ ${#lndErrorFull} -gt 0 ] || [ "${1}" == "lightn echo ${lndErrorFull} fi echo + echo "-> Use command 'repair' and then choose 'BACKUP-LND' to make a just in case backup." echo "-> Use command 'debug' for more log output you can use for getting support." echo "-> Use command 'menu' to open main menu." echo "-> Have you tried to turn it off and on again? Use command 'restart'" From 901fa1f148f28aaa3db7ff869033ff0375506c45 Mon Sep 17 00:00:00 2001 From: openoms Date: Tue, 30 Jun 2020 13:23:58 +0100 Subject: [PATCH 39/40] network.wallet: check bitcoin.conf for wallet.dat related: https://github.com/rootzoll/raspiblitz/issues/1273#issue-642371542 --- home.admin/config.scripts/network.wallet.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/network.wallet.sh b/home.admin/config.scripts/network.wallet.sh index be204646e..1e3c1597f 100644 --- a/home.admin/config.scripts/network.wallet.sh +++ b/home.admin/config.scripts/network.wallet.sh @@ -34,15 +34,27 @@ fi # switch on ################### if [ "$1" = "1" ] || [ "$1" = "on" ]; then + + if ! grep -Eq "^wallet=wallet.dat" /mnt/hdd/${network}/${network}.conf; then + echo "Enable the multiwallet feature in ${network} core and specify wallet.dat" + echo "wallet=wallet.dat" | sudo tee -a /mnt/hdd/${network}/${network}.conf >/dev/null + restartService=1 + else + echo "Multiwallet is active and wallet.dat is used." + restartService=0 + fi if [ ${disablewallet} == 1 ]; then sudo sed -i "s/^disablewallet=.*/disablewallet=0/g" /mnt/hdd/${network}/${network}.conf - echo "switching the ${network} core wallet on and restarting ${network}d" - sudo systemctl restart ${network}d - exit 0 + echo "Switching the ${network} core wallet on" + restartService=1 else echo "The ${network} core wallet is already on" - exit 0 fi + if [ ${restartService} == 1 ]; then + echo "Restarting ${network}d" + sudo systemctl restart ${network}d + fi + exit 0 fi From b7493ab2ddc221d8b4a2c84ed56cb5f251a89832 Mon Sep 17 00:00:00 2001 From: openoms Date: Tue, 30 Jun 2020 13:46:42 +0100 Subject: [PATCH 40/40] joinmarket: setting wallet.dat to be used by default Related: https://github.com/rootzoll/raspiblitz/issues/1273#issue-642371542 https://github.com/openoms/joininbox/issues/3#issue-638669389 --- home.admin/config.scripts/bonus.joinmarket.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home.admin/config.scripts/bonus.joinmarket.sh b/home.admin/config.scripts/bonus.joinmarket.sh index 03db1ccb7..fb0d43a97 100644 --- a/home.admin/config.scripts/bonus.joinmarket.sh +++ b/home.admin/config.scripts/bonus.joinmarket.sh @@ -85,6 +85,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then chown -R joinmarket:joinmarket /mnt/hdd/app-data/.joinmarket ln -s /mnt/hdd/app-data/.joinmarket /home/joinmarket/ 2>/dev/null chown -R joinmarket:joinmarket /home/joinmarket/.joinmarket + # specify wallet.dat in old config for multiwallet for multiwallet support + if [ -f "/home/joinmarket/.joinmarket/joinmarket.cfg" ] ; then + sudo -u joinmarket sed -i "s/^rpc_wallet_file =.*/rpc_wallet_file = wallet.dat/g" /home/joinmarket/.joinmarket/joinmarket.cfg + echo "Specified to use wallet.dat in the recovered joinmarket.cfg" + fi # install joinmarket cd /home/joinmarket @@ -169,6 +174,8 @@ if [ ! -f "/home/joinmarket/.joinmarket/joinmarket.cfg" ] ; then PASSWORD_B=\$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) sed -i "s/^rpc_password =.*/rpc_password = \$PASSWORD_B/g" /home/joinmarket/.joinmarket/joinmarket.cfg echo "Filled the bitcoin RPC password (PASSWORD_B)" + sed -i "s/^rpc_wallet_file =.*/rpc_wallet_file = wallet.dat/g" /home/joinmarket/.joinmarket/joinmarket.cfg + echo "Using the bitcoind wallet: wallet.dat" #communicate with IRC servers via Tor sed -i "s/^host = irc.darkscience.net/#host = irc.darkscience.net/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^#host = darksci3bfoka7tw.onion/host = darksci3bfoka7tw.onion/g" /home/joinmarket/.joinmarket/joinmarket.cfg