This commit is contained in:
rootzoll
2020-04-16 12:31:42 +02:00
5 changed files with 60 additions and 42 deletions

View File

@@ -80,7 +80,7 @@ l 'Lightning Loop' ${loop} \
4 'Run behind TOR' ${runBehindTor} \ 4 'Run behind TOR' ${runBehindTor} \
5 'RTL Webinterface' ${rtlWebinterface} \ 5 'RTL Webinterface' ${rtlWebinterface} \
b 'BTC-RPC-Explorer' ${BTCRPCexplorer} \ b 'BTC-RPC-Explorer' ${BTCRPCexplorer} \
s 'Cyryptoadvance Specter' ${specter} \ s 'Cryptoadvance Specter' ${specter} \
6 'LND Auto-Unlock' ${autoUnlock} \ 6 'LND Auto-Unlock' ${autoUnlock} \
9 'Touchscreen' ${touchscreenMenu} \ 9 'Touchscreen' ${touchscreenMenu} \
r 'LCD Rotate' ${lcdrotateMenu} \ r 'LCD Rotate' ${lcdrotateMenu} \
@@ -101,7 +101,7 @@ l 'Lightning Loop' ${loop} \
4 'Run behind TOR' ${runBehindTor} \ 4 'Run behind TOR' ${runBehindTor} \
5 'RTL Webinterface' ${rtlWebinterface} \ 5 'RTL Webinterface' ${rtlWebinterface} \
b 'BTC-RPC-Explorer' ${BTCRPCexplorer} \ b 'BTC-RPC-Explorer' ${BTCRPCexplorer} \
s 'Cyryptoadvance Specter' ${specter} \ s 'Cryptoadvance Specter' ${specter} \
6 'LND Auto-Unlock' ${autoUnlock} \ 6 'LND Auto-Unlock' ${autoUnlock} \
7 'BTC UPnP (AutoNAT)' ${networkUPnP} \ 7 'BTC UPnP (AutoNAT)' ${networkUPnP} \
8 'LND UPnP (AutoNAT)' ${autoNatDiscovery} \ 8 'LND UPnP (AutoNAT)' ${autoNatDiscovery} \

View File

@@ -93,7 +93,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo service bitcoind start sudo service bitcoind start
echo "*** Installing prerequisites ***" echo "*** Installing prerequisites ***"
sudo apt install -y libusb-1.0.0-dev libudev-dev virtualenv sudo apt install -y libusb-1.0.0-dev libudev-dev virtualenv libssl-dev
# activating Authentication here ... # activating Authentication here ...
echo "*** creating App-config ***" echo "*** creating App-config ***"
@@ -213,7 +213,7 @@ After=${network}d.service
[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 --cert=/home/bitcoin/.specter/cert.pem --key=/home/bitcoin/.specter/key.pem
User=bitcoin User=bitcoin
Environment=PATH=/home/bitcoin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/bin 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 Restart=always
TimeoutSec=120 TimeoutSec=120
RestartSec=30 RestartSec=30

View File

@@ -59,7 +59,7 @@ if [ "$1" = "status" ]; then
# OK looks good - but just means that something is answering on that port # OK looks good - but just means that something is answering on that port
echo "publicTCPPortAnswering=1" echo "publicTCPPortAnswering=1"
else else
# no answere on that port # no answer on that port
echo "publicTCPPortAnswering=0" echo "publicTCPPortAnswering=0"
fi fi
echo "portHTTP='50002'" echo "portHTTP='50002'"
@@ -70,7 +70,7 @@ if [ "$1" = "status" ]; then
# OK looks good - but just means that something is answering on that port # OK looks good - but just means that something is answering on that port
echo "publicHTTPPortAnswering=1" echo "publicHTTPPortAnswering=1"
else else
# no answere on that port # no answer on that port
echo "publicHTTPPortAnswering=0" echo "publicHTTPPortAnswering=0"
fi fi
# add TOR info # add TOR info
@@ -81,6 +81,9 @@ if [ "$1" = "status" ]; then
else else
echo "TORrunning=0" echo "TORrunning=0"
fi fi
# check Nginx
nginxTest=$(sudo nginx -t 2>&1 | grep -c "test is successful")
echo "nginxTest=$nginxTest"
else else
echo "isSynced=0" echo "isSynced=0"
@@ -120,6 +123,23 @@ This can take multiple hours.
exit 0 exit 0
fi fi
if [ ${nginxTest} -eq 0 ]; then
dialog --title "Testing nginx.conf has failed" --msgbox "
Nginx is in a failed state. Will attempt to fix.
Try connecting via port 50002 or Tor again once finished.
Check 'sudo nginx -t' for a detailed error message.
" 9 61
logFileMissing=$(sudo nginx -t 2>&1 | grep -c "/var/log/nginx/access.log")
if [ ${logFileMissing} -eq 1 ]; then
sudo mkdir /var/log/nginx
sudo systemctl restart nginx
fi
/home/admin/config.scripts/internet.selfsignedcert.sh
echo "Press ENTER to get back to main menu."
read key
exit 0
fi
# Options (available without TOR) # Options (available without TOR)
OPTIONS=( \ OPTIONS=( \
CONNECT "How to Connect" \ CONNECT "How to Connect" \
@@ -138,7 +158,7 @@ This can take multiple hours.
echo "https://electrum.org" echo "https://electrum.org"
echo echo
echo "On Network Settings > Server menu:" echo "On Network Settings > Server menu:"
echo "- deavtivate automatic server selection" echo "- deactivate automatic server selection"
echo "- as manual server set '${localIP}' & '${portHTTP}'" echo "- as manual server set '${localIP}' & '${portHTTP}'"
echo "- laptop and RaspiBlitz need to be within same local network" echo "- laptop and RaspiBlitz need to be within same local network"
echo echo
@@ -146,11 +166,11 @@ This can take multiple hours.
echo "electrum --oneserver --server ${localIP}:${portHTTP}:s" echo "electrum --oneserver --server ${localIP}:${portHTTP}:s"
if [ ${TORrunning} -eq 1 ]; then if [ ${TORrunning} -eq 1 ]; then
echo "" echo ""
echo "The TOR Hidden Service address for electrs is (see LCD for QR code):" echo "The Tor Hidden Service address for electrs is (see LCD for QR code):"
echo "${TORaddress}" echo "${TORaddress}"
echo echo
echo "To connect through TOR open the Tor Browser and start with the options:" echo "To connect through TOR open the Tor Browser and start with the options:"
echo "electrum --oneserver --server=$TOR_ADDRESS:50002:s --proxy socks5:127.0.0.1:9150" echo "electrum --oneserver --server${TORaddress}:50002:s --proxy socks5:127.0.0.1:9150"
/home/admin/config.scripts/blitz.lcd.sh qr "${TORaddress}" /home/admin/config.scripts/blitz.lcd.sh qr "${TORaddress}"
fi fi
echo echo

View File

@@ -30,7 +30,7 @@ if [ "$1" = "menu" ]; then
whiptail --title " JoinMarket info " --msgbox "Usage: whiptail --title " JoinMarket info " --msgbox "Usage:
https://github.com/openoms/bitcoin-tutorials/blob/master/joinmarket/README.md\n https://github.com/openoms/bitcoin-tutorials/blob/master/joinmarket/README.md\n
Start to use by logging in to the 'joinmarket' user with: Start to use by logging in to the 'joinmarket' user with:
'sudo su - joinmarket' \n sudo su joinmarket\n
Can log in directly with the 'joinmarket' user via ssh. Can log in directly with the 'joinmarket' user via ssh.
The user password is the PASSWORD_B. The user password is the PASSWORD_B.
" 14 81 " 14 81
@@ -109,18 +109,15 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
pip install https://github.com/sunu/qt5reactor/archive/58410aaead2185e9917ae9cac9c50fe7b70e4a60.zip#egg=qt5reactor pip install https://github.com/sunu/qt5reactor/archive/58410aaead2185e9917ae9cac9c50fe7b70e4a60.zip#egg=qt5reactor
# autostart for joinmarket # autostart for joinmarket
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c "bash startup.sh") -eq 0 ]; then bash -c "echo '# automatically start startup.sh for joinmarket unless' >> /home/joinmarket/.bashrc"
sudo bash -c "echo 'bash startup.sh' >> /home/joinmarket/.bashrc" bash -c "echo '# when running in a tmux session' >> /home/joinmarket/.bashrc"
fi bash -c "echo 'if [ -z \"\$TMUX\" ]; then' >> /home/joinmarket/.bashrc"
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c ". /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate") -eq 0 ]; then bash -c "echo ' /home/joinmarket/startup.sh' >> /home/joinmarket/.bashrc"
sudo bash -c "echo '. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate' >> /home/joinmarket/.bashrc" bash -c "echo 'fi' >> /home/joinmarket/.bashrc"
fi bash -c "echo '# always activate jmvenv with PySide2 and cd to scripts' >> /home/joinmarket/.bashrc"
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c "/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"") -eq 0 ]; then bash -c "echo '. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate' >> /home/joinmarket/.bashrc"
sudo bash -c "echo '/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"' >> /home/joinmarket/.bashrc" bash -c "echo '/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"' >> /home/joinmarket/.bashrc"
fi bash -c "echo 'cd /home/joinmarket/joinmarket-clientserver/scripts/' >> /home/joinmarket/.bashrc"
if [ $(sudo cat /home/joinmarket/.bashrc | grep -c "cd /home/joinmarket/joinmarket-clientserver/scripts/") -eq 0 ]; then
sudo bash -c "echo 'cd /home/joinmarket/joinmarket-clientserver/scripts/' >> /home/joinmarket/.bashrc"
fi
cat > /home/admin/startup.sh <<EOF cat > /home/admin/startup.sh <<EOF
# check for joinmarket.cfg # check for joinmarket.cfg
@@ -142,19 +139,19 @@ else
sudo chmod 600 /home/joinmarket/.joinmarket/joinmarket.cfg || exit 1 sudo chmod 600 /home/joinmarket/.joinmarket/joinmarket.cfg || exit 1
echo "" echo ""
echo "Editing the joinmarket.cfg" echo "Editing the joinmarket.cfg"
sudo sed -i "s/^rpc_user =.*/rpc_user = raspibolt/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^rpc_user =.*/rpc_user = raspibolt/g" /home/joinmarket/.joinmarket/joinmarket.cfg
PASSWORD_B=\$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-) PASSWORD_B=\$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcpassword | cut -c 13-)
sudo sed -i "s/^rpc_password =.*/rpc_password = \$PASSWORD_B/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^rpc_password =.*/rpc_password = \$PASSWORD_B/g" /home/joinmarket/.joinmarket/joinmarket.cfg
echo "Filled the bitcoin RPC password (PASSWORD_B)" echo "Filled the bitcoin RPC password (PASSWORD_B)"
#communicate with IRC servers via Tor #communicate with IRC servers via Tor
sudo sed -i "s/^host = irc.darkscience.net/#host = irc.darkscience.net/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^host = irc.darkscience.net/#host = irc.darkscience.net/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^#host = darksci3bfoka7tw.onion/host = darksci3bfoka7tw.onion/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^#host = darksci3bfoka7tw.onion/host = darksci3bfoka7tw.onion/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^host = irc.hackint.org/#host = irc.hackint.org/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^host = irc.hackint.org/#host = irc.hackint.org/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^#host = ncwkrwxpq2ikcngxq3dy2xctuheniggtqeibvgofixpzvrwpa77tozqd.onion/host = ncwkrwxpq2ikcngxq3dy2xctuheniggtqeibvgofixpzvrwpa77tozqd.onion/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^#host = ncwkrwxpq2ikcngxq3dy2xctuheniggtqeibvgofixpzvrwpa77tozqd.onion/host = ncwkrwxpq2ikcngxq3dy2xctuheniggtqeibvgofixpzvrwpa77tozqd.onion/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^socks5 = false/#socks5 = false/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^socks5 = false/#socks5 = false/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^#socks5 = true/socks5 = true/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^#socks5 = true/socks5 = true/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^#port = 6667/port = 6667/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^#port = 6667/port = 6667/g" /home/joinmarket/.joinmarket/joinmarket.cfg
sudo sed -i "s/^#usessl = false/usessl = false/g" /home/joinmarket/.joinmarket/joinmarket.cfg sed -i "s/^#usessl = false/usessl = false/g" /home/joinmarket/.joinmarket/joinmarket.cfg
echo "Edited the joinmarket.cfg to communicate over Tor only." echo "Edited the joinmarket.cfg to communicate over Tor only."
echo "" echo ""
echo "Welcome to the JoinMarket command line!" echo "Welcome to the JoinMarket command line!"
@@ -167,8 +164,9 @@ else
fi fi
EOF EOF
sudo mv /home/admin/startup.sh /home/joinmarket/startup.sh mv /home/admin/startup.sh /home/joinmarket/startup.sh
sudo chown joinmarket:joinmarket /home/joinmarket/startup.sh chown joinmarket:joinmarket /home/joinmarket/startup.sh
chmod +x /home/joinmarket/startup.sh
else else
echo "JoinMarket is already installed" echo "JoinMarket is already installed"
@@ -181,7 +179,7 @@ EOF
# starting info # starting info
echo "" echo ""
echo "Start to use by logging in to the 'joinmarket' user with:" echo "Start to use by logging in to the 'joinmarket' user with:"
echo "'sudo su - joinmarket'" echo "sudo su joinmarket"
echo "" echo ""
echo "If logging in directly via ssh the password is the PASSWORD_B" echo "If logging in directly via ssh the password is the PASSWORD_B"
echo "" echo ""

View File

@@ -47,7 +47,7 @@ if [ "${runBehindTor}" = "on" ]; then
isHiddenService=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c $service) isHiddenService=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c $service)
if [ ${isHiddenService} -eq 0 ]; then if [ ${isHiddenService} -eq 0 ]; then
#check if the port is already forwarded #check if the port is already forwarded
alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c 127.0.0.1:$fromPort) alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c "\b127.0.0.1:$fromPort\b")
if [ ${alreadyThere} -gt 0 ]; then if [ ${alreadyThere} -gt 0 ]; then
echo "The port $fromPort is already forwarded. Check /etc/tor/torrc for the details." echo "The port $fromPort is already forwarded. Check /etc/tor/torrc for the details."
exit 1 exit 1
@@ -60,7 +60,7 @@ HiddenServicePort $toPort 127.0.0.1:$fromPort" | sudo tee -a /etc/tor/torrc
# check and insert second port pair # check and insert second port pair
if [ ${#toPort2} -gt 0 ]; then if [ ${#toPort2} -gt 0 ]; then
alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c 127.0.0.1:$fromPort2) alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c "\b127.0.0.1:$fromPort2\b")
if [ ${alreadyThere} -gt 0 ]; then if [ ${alreadyThere} -gt 0 ]; then
echo "The port $fromPort2 is already forwarded. Check the /etc/tor/torrc for the details." echo "The port $fromPort2 is already forwarded. Check the /etc/tor/torrc for the details."
else else
@@ -91,7 +91,7 @@ HiddenServicePort $toPort 127.0.0.1:$fromPort" | sudo tee -a /etc/tor/torrc
echo "$TOR_ADDRESS" echo "$TOR_ADDRESS"
echo "use with the port: $toPort" echo "use with the port: $toPort"
echo "" echo ""
alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c 127.0.0.1:$fromPort2) alreadyThere=$(sudo cat /etc/tor/torrc 2>/dev/null | grep -c "\b127.0.0.1:$fromPort2\b")
if [ ${#toPort2} -gt 0 ]; then if [ ${#toPort2} -gt 0 ]; then
if [ ${alreadyThere} -eq 0 ]; then if [ ${alreadyThere} -eq 0 ]; then
echo "or the port: $toPort2" echo "or the port: $toPort2"