mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-28 16:58:03 +01:00
parent
d423c3c2d9
commit
bd5f010409
8 changed files with 4 additions and 319 deletions
|
@ -1,3 +1,7 @@
|
|||
## What's new in Version 1.11.1 of RaspiBlitz?
|
||||
|
||||
- Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082)
|
||||
|
||||
## What's new in Version 1.11.0 of RaspiBlitz?
|
||||
|
||||
- New: RaspberryPi5 tested & enabling NVMe PCIe Hats
|
||||
|
|
|
@ -159,9 +159,6 @@ fi
|
|||
if [ "${circuitbreaker}" == "on" ]; then
|
||||
OPTIONS+=(CIRCUITBREAKER "Circuitbreaker (LND firewall)")
|
||||
fi
|
||||
if [ "${tallycoinConnect}" == "on" ]; then
|
||||
OPTIONS+=(TALLY "Tallycoin Connect")
|
||||
fi
|
||||
if [ "${squeaknode}" == "on" ]; then
|
||||
OPTIONS+=(SQUEAKNODE "Squeaknode")
|
||||
fi
|
||||
|
@ -310,9 +307,6 @@ case $CHOICE in
|
|||
THUB)
|
||||
sudo /home/admin/config.scripts/bonus.thunderhub.sh menu
|
||||
;;
|
||||
TALLY)
|
||||
sudo /home/admin/config.scripts/bonus.tallycoin-connect.sh menu
|
||||
;;
|
||||
ZEROTIER)
|
||||
sudo /home/admin/config.scripts/bonus.zerotier.sh menu
|
||||
;;
|
||||
|
|
|
@ -26,7 +26,6 @@ if [ ${#lit} -eq 0 ]; then lit="off"; fi
|
|||
if [ ${#lndg} -eq 0 ]; then lndg="off"; fi
|
||||
if [ ${#whitepaper} -eq 0 ]; then whitepaper="off"; fi
|
||||
if [ ${#chantools} -eq 0 ]; then chantools="off"; fi
|
||||
if [ ${#tallycoinConnect} -eq 0 ]; then tallycoinConnect="off"; fi
|
||||
if [ ${#helipad} -eq 0 ]; then helipad="off"; fi
|
||||
if [ ${#lightningtipbot} -eq 0 ]; then lightningtipbot="off"; fi
|
||||
if [ ${#fints} -eq 0 ]; then fints="off"; fi
|
||||
|
@ -66,7 +65,6 @@ if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
|
|||
OPTIONS+=(ha 'LND ChannelTools (Fund Rescue)' ${chantools})
|
||||
OPTIONS+=(xa 'LND Sphinx-Relay' ${sphinxrelay})
|
||||
OPTIONS+=(fa 'LND Helipad Boostagram reader' ${helipad})
|
||||
OPTIONS+=(da 'LND Tallycoin Connect' ${tallycoinConnect})
|
||||
OPTIONS+=(lb 'LND LNDK (experimental BOLT 12)' ${lndk})
|
||||
fi
|
||||
|
||||
|
@ -485,23 +483,6 @@ else
|
|||
echo "Helipad setting unchanged."
|
||||
fi
|
||||
|
||||
# Tallycoin
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "da")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
if [ "${tallycoinConnect}" != "${choice}" ]; then
|
||||
echo "Tallycoin Setting changed .."
|
||||
anychange=1
|
||||
sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh ${choice}
|
||||
if [ "${choice}" = "on" ]; then
|
||||
whiptail --title " Installed Tallycoin-Connect" --msgbox "\
|
||||
Tallycoin-Connect was installed.\n
|
||||
Use the new 'TALLY' entry in Main Menu for more info.\n
|
||||
" 10 45
|
||||
fi
|
||||
else
|
||||
echo "Tallycoin Setting unchanged."
|
||||
fi
|
||||
|
||||
# LNDK
|
||||
choice="off"; check=$(echo "${CHOICES}" | grep -c "lb")
|
||||
if [ ${check} -eq 1 ]; then choice="on"; fi
|
||||
|
|
|
@ -721,15 +721,6 @@ else
|
|||
echo "Provisioning CircuitBreaker - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# tallycoin_connect
|
||||
if [ "${tallycoinConnect}" = "on" ]; then
|
||||
echo "Provisioning Tallycoin Connect - run config script" >> ${logFile}
|
||||
/home/admin/_cache.sh set message "Setup Tallycoin Connect"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.tallycoin-connect.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning Tallycoin Connect - keep default" >> ${logFile}
|
||||
fi
|
||||
|
||||
# squeaknode
|
||||
if [ "${squeaknode}" = "on" ]; then
|
||||
echo "Provisioning Squeaknode - run config script" >> ${logFile}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
## tallycoin_connect_ssl.conf
|
||||
|
||||
server {
|
||||
listen 8124 ssl http2;
|
||||
listen [::]:8124 ssl http2;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/ssl-params.conf;
|
||||
include /etc/nginx/snippets/ssl-certificate-app-data.conf;
|
||||
|
||||
include /etc/nginx/snippets/gzip-params.conf;
|
||||
|
||||
access_log /var/log/nginx/access_tallycoin_connect.log;
|
||||
error_log /var/log/nginx/error_tallycoin_connect.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8123;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
## tallycoin_connect_tor.conf
|
||||
|
||||
server {
|
||||
listen 8125;
|
||||
listen [::]:8125;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/gzip-params.conf;
|
||||
|
||||
access_log /var/log/nginx/access_tallycoin_connect.log;
|
||||
error_log /var/log/nginx/error_tallycoin_connect.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8123;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
## tallycoin_connect_tor_ssl.conf
|
||||
|
||||
server {
|
||||
listen 8126 ssl http2;
|
||||
listen [::]:8126 ssl http2;
|
||||
server_name _;
|
||||
|
||||
include /etc/nginx/snippets/ssl-params.conf;
|
||||
include /etc/nginx/snippets/ssl-certificate-app-data-tor.conf;
|
||||
|
||||
include /etc/nginx/snippets/gzip-params.conf;
|
||||
|
||||
access_log /var/log/nginx/access_tallycoin_connect.log;
|
||||
error_log /var/log/nginx/error_tallycoin_connect.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8123;
|
||||
|
||||
include /etc/nginx/snippets/ssl-proxy-params.conf;
|
||||
}
|
||||
}
|
|
@ -1,225 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# https://github.com/djbooth007/tallycoin_connect
|
||||
|
||||
USERNAME=tallycoin
|
||||
APP_DATA_DIR=/mnt/hdd/app-data/tallycoin-connect
|
||||
HOME_DIR=/home/$USERNAME
|
||||
CONFIG_FILE=$APP_DATA_DIR/tallycoin_api.key
|
||||
RASPIBLITZ_INFO=/home/admin/raspiblitz.info
|
||||
SERVICE_FILE=/etc/systemd/system/tallycoin-connect.service
|
||||
TC_VERSION=1.8.0
|
||||
|
||||
# command info
|
||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||
echo "config script to switch tallycoin_connect on or off"
|
||||
echo "bonus.tallycoin-connect.sh [on|off|menu]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check and load raspiblitz config to know which network is running
|
||||
source $RASPIBLITZ_INFO
|
||||
source /mnt/hdd/raspiblitz.conf
|
||||
|
||||
# show info menu
|
||||
if [ "$1" = "menu" ]; then
|
||||
# get network info
|
||||
localip=$(hostname -I | awk '{print $1}')
|
||||
toraddress=$(sudo cat /mnt/hdd/tor/tallycoin-connect/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
|
||||
# Info with TOR
|
||||
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
|
||||
whiptail --title " Tallycoin Connect " --msgbox "Open in your local web browser:
|
||||
http://${localip}:8123\n
|
||||
https://${localip}:8124 with Fingerprint:
|
||||
${fingerprint}\n
|
||||
Use your Password B to login.\n
|
||||
Hidden Service address for TOR Browser (see LCD for QR):\n${toraddress}
|
||||
" 16 72
|
||||
sudo /home/admin/config.scripts/blitz.display.sh hide
|
||||
else
|
||||
# Info without TOR
|
||||
whiptail --title " Tallycoin Connect " --msgbox "Open in your local web browser & accept self-signed cert:
|
||||
http://${localip}:8123\n
|
||||
https://${localip}:8124 with Fingerprint:
|
||||
${fingerprint}\n
|
||||
Use your Password B to login.\n
|
||||
Activate TOR to access the web interface from outside your local network.
|
||||
" 15 72
|
||||
fi
|
||||
echo "please wait ..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# switch on
|
||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
isInstalled=$(sudo ls $HOME_DIR 2>/dev/null | grep -c 'tallycoin_connect')
|
||||
if [ ${isInstalled} -eq 0 ]; then
|
||||
echo "*** INSTALL TALLYCOIN CONNECT ***"
|
||||
|
||||
# install nodeJS
|
||||
/home/admin/config.scripts/bonus.nodejs.sh on
|
||||
|
||||
# add user
|
||||
sudo adduser --system --group --home /home/$USERNAME $USERNAME
|
||||
|
||||
# install tallycoin_connect
|
||||
cd $HOME_DIR
|
||||
sudo -u $USERNAME wget https://github.com/djbooth007/tallycoin_connect/archive/refs/tags/v$TC_VERSION.tar.gz
|
||||
sudo -u $USERNAME tar -xzf v$TC_VERSION.tar.gz
|
||||
sudo -u $USERNAME mv tallycoin_connect{-$TC_VERSION,}
|
||||
sudo -u $USERNAME rm v$TC_VERSION.tar.gz
|
||||
cd tallycoin_connect
|
||||
sudo -u $USERNAME cat .dockerignore | sudo -u $USERNAME xargs sudo -u $USERNAME rm -rf
|
||||
sudo -u $USERNAME rm .dockerignore
|
||||
sudo -u $USERNAME npm install
|
||||
if ! [ $? -eq 0 ]; then
|
||||
echo "FAIL - npm install did not run correctly, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# setup config
|
||||
sudo mkdir -p $APP_DATA_DIR
|
||||
sudo chown $USERNAME:$USERNAME $APP_DATA_DIR
|
||||
|
||||
if [[ ! -f "$CONFIG_FILE" ]]; then
|
||||
configFile=/home/admin/tallycoin_api.key
|
||||
touch $configFile
|
||||
sudo chmod 600 $configFile || exit 1
|
||||
passwordB=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-)
|
||||
passwd=$(printf $passwordB | sha256sum | tr -d ' -')
|
||||
tlsCert=$(base64 /mnt/hdd/app-data/lnd/tls.cert | tr -d '=' | tr '/+' '_-' | tr -d '\n')
|
||||
macaroon=$(base64 /mnt/hdd/app-data/lnd/data/chain/${network}/${chain}net/admin.macaroon | tr -d '=' | tr '/+' '_-' | tr -d '\n')
|
||||
echo "{\"tls_cert\":\"$tlsCert\",\"macaroon\":\"$macaroon\",\"tallycoin_passwd\":\"$passwd\"}" > $configFile
|
||||
|
||||
sudo mv $configFile $CONFIG_FILE
|
||||
sudo chown $USERNAME:$USERNAME $CONFIG_FILE
|
||||
fi
|
||||
|
||||
##################
|
||||
# NGINX
|
||||
##################
|
||||
# setup nginx symlinks
|
||||
if ! [ -f /etc/nginx/sites-available/tallycoin_connect_ssl.conf ]; then
|
||||
sudo cp -f /home/admin/assets/nginx/sites-available/tallycoin_connect_ssl.conf /etc/nginx/sites-available/tallycoin_connect_ssl.conf
|
||||
fi
|
||||
if ! [ -f /etc/nginx/sites-available/tallycoin_connect_tor.conf ]; then
|
||||
sudo cp /home/admin/assets/nginx/sites-available/tallycoin_connect_tor.conf /etc/nginx/sites-available/tallycoin_connect_tor.conf
|
||||
fi
|
||||
if ! [ -f /etc/nginx/sites-available/tallycoin_connect_tor_ssl.conf ]; then
|
||||
sudo cp /home/admin/assets/nginx/sites-available/tallycoin_connect_tor_ssl.conf /etc/nginx/sites-available/tallycoin_connect_tor_ssl.conf
|
||||
fi
|
||||
sudo ln -sf /etc/nginx/sites-available/tallycoin_connect_ssl.conf /etc/nginx/sites-enabled/
|
||||
sudo ln -sf /etc/nginx/sites-available/tallycoin_connect_tor.conf /etc/nginx/sites-enabled/
|
||||
sudo ln -sf /etc/nginx/sites-available/tallycoin_connect_tor_ssl.conf /etc/nginx/sites-enabled/
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
|
||||
# open the firewall
|
||||
echo "*** Updating Firewall ***"
|
||||
sudo ufw allow from any to any port 8123 comment 'allow Tallycoin Connect HTTP'
|
||||
sudo ufw allow from any to any port 8124 comment 'allow Tallycoin Connect HTTPS'
|
||||
echo ""
|
||||
|
||||
##################
|
||||
# SYSTEMD SERVICE
|
||||
##################
|
||||
|
||||
echo "# Install Tallycoin Connect systemd for ${network} on ${chain}"
|
||||
echo "
|
||||
# Systemd unit for Tallycoin Connect
|
||||
|
||||
[Unit]
|
||||
Description=Tallycoin Connect daemon
|
||||
Wants=lnd.service
|
||||
After=lnd.service
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=$HOME_DIR/tallycoin_connect
|
||||
Environment=\"CONFIG_FILE=$CONFIG_FILE\"
|
||||
ExecStart=/usr/bin/npm start
|
||||
User=tallycoin
|
||||
Restart=always
|
||||
TimeoutSec=120
|
||||
RestartSec=30
|
||||
StandardOutput=null
|
||||
StandardError=journal
|
||||
|
||||
# Hardening measures
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
NoNewPrivileges=true
|
||||
PrivateDevices=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
" | sudo tee $SERVICE_FILE
|
||||
sudo systemctl enable tallycoin-connect
|
||||
|
||||
# setting value in raspiblitz config
|
||||
/home/admin/config.scripts/blitz.conf.sh set tallycoinConnect "on"
|
||||
|
||||
# Hidden Service for tallycoin-connect if Tor is active
|
||||
if [ "${runBehindTor}" = "on" ]; then
|
||||
# make sure to keep in sync with tor.onion-service.sh script
|
||||
/home/admin/config.scripts/tor.onion-service.sh tallycoin-connect 80 8125 443 8126
|
||||
fi
|
||||
source $RASPIBLITZ_INFO
|
||||
if [ "${state}" == "ready" ]; then
|
||||
echo "# OK - the tallycoin-connect.service is enabled, system is ready so starting service"
|
||||
sudo systemctl start tallycoin-connect
|
||||
else
|
||||
echo "# OK - the tallycoin-connect.service is enabled, to start manually use: 'sudo systemctl start tallycoin-connect'"
|
||||
fi
|
||||
else
|
||||
echo "*** TALLYCOIN CONNECT ALREADY INSTALLED ***"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# switch off
|
||||
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||
isInstalled=$(sudo ls $HOME_DIR 2>/dev/null | grep -c 'tallycoin_connect')
|
||||
if [ ${isInstalled} -eq 1 ]; then
|
||||
echo "*** UNINSTALL TALLYCOIN CONNECT ***"
|
||||
|
||||
# remove systemd service
|
||||
sudo systemctl stop tallycoin-connect
|
||||
sudo systemctl disable tallycoin-connect
|
||||
sudo rm -f $SERVICE_FILE
|
||||
|
||||
# close ports on firewall
|
||||
sudo ufw delete allow from any to any port 8123 comment 'allow Tallycoin Connect HTTP'
|
||||
sudo ufw delete allow from any to any port 8124 comment 'allow Tallycoin Connect HTTPS'
|
||||
|
||||
# remove nginx symlinks
|
||||
sudo rm -f /etc/nginx/sites-enabled/tallycoin_connect_*
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
|
||||
# Hidden Service if Tor is active
|
||||
if [ "${runBehindTor}" = "on" ]; then
|
||||
/home/admin/config.scripts/tor.onion-service.sh off tallycoin-connect
|
||||
fi
|
||||
|
||||
# remove config
|
||||
sudo rm -rf $APP_DATA_DIR
|
||||
|
||||
# delete user and home directory
|
||||
sudo userdel -rf $USERNAME
|
||||
|
||||
# setting value in raspi blitz config
|
||||
/home/admin/config.scripts/blitz.conf.sh set tallycoinConnect "off"
|
||||
|
||||
echo "OK TALLYCOIN CONNECT removed."
|
||||
else
|
||||
echo "*** TALLYCOIN CONNECT NOT INSTALLED ***"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "FAIL - Unknown Parameter $1"
|
||||
exit 1
|
Loading…
Add table
Reference in a new issue