mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 14:51:03 +01:00
use auto nat discover starting in lnd 0.5-beta #249
This commit is contained in:
parent
c1dcbe6e4a
commit
ba6f40fd2b
11 changed files with 14 additions and 62 deletions
|
@ -77,16 +77,4 @@ sed -i "s/^${network}d.rpcpass=.*/${network}d.rpcpass=${result}/g" /home/admin/a
|
|||
|
||||
# success info dialog
|
||||
dialog --backtitle "RaspiBlitz - SetUP" --msgbox "OK - RPC password changed to '$result'\n\nNow starting the Setup of your RaspiBlitz." 7 52
|
||||
clear
|
||||
|
||||
# init get publicip service
|
||||
getpublicipExists=$(sudo ls /usr/local/bin/getpublicip.sh 2>/dev/null | grep "getpublicip.sh" -c)
|
||||
if [ ${getpublicipExists} -eq 0 ]; then
|
||||
echo "*** Installing getPublic ip script and service *** "
|
||||
sudo cp ./assets/getpublicip.sh /usr/local/bin/getpublicip.sh
|
||||
sudo chmod +x /usr/local/bin/getpublicip.sh
|
||||
sudo cp ./assets/getpublicip.service /etc/systemd/system/getpublicip.service
|
||||
sudo systemctl enable getpublicip
|
||||
sudo systemctl start getpublicip
|
||||
echo ""
|
||||
fi
|
||||
clear
|
|
@ -64,6 +64,8 @@ echo "allow: trasmission"
|
|||
sudo ufw allow 51413 comment 'transmission'
|
||||
echo "allow: local web admin"
|
||||
sudo ufw allow from 192.168.0.0/24 to any port 80 comment 'allow local LAN web'
|
||||
echo "open firewall for auto nat discover"
|
||||
sudo ufw allow proto udp from 192.168.0.0/24 port 1900 to any comment 'allow local LAN SSDP for UPnP discovery'
|
||||
echo "enable lazy firewall"
|
||||
sudo ufw --force enable
|
||||
echo ""
|
||||
|
|
|
@ -197,8 +197,8 @@ echo ""
|
|||
echo "*** Putting LND behind TOR ***"
|
||||
echo "Disable LND again"
|
||||
sudo systemctl disable lnd
|
||||
echo "Writing Public Onion Address to /run/publicip (just in case for TotHiddenServiceV3)"
|
||||
echo "PUBLICIP=${onionLND}" | sudo tee /run/publicip
|
||||
echo "Writing Public Onion Address to /mnt/hdd/tor/v3Address (just in case for TotHiddenServiceV3)"
|
||||
echo "V3ADDRESS=${onionLND}" | sudo tee /mnt/hdd/tor/v3Address
|
||||
echo "Configure and Changing to lnd.tor.service"
|
||||
sed -i "5s/.*/Wants=${network}d.service/" ./assets/lnd.tor.service
|
||||
sed -i "6s/.*/After=${network}d.service/" ./assets/lnd.tor.service
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
[Unit]
|
||||
Description=Bitcoin daemon
|
||||
Wants=getpublicip.service
|
||||
After=getpublicip.service
|
||||
Wants=bootstrap.service
|
||||
After=bootstrap.service
|
||||
|
||||
# for use with sendmail alert (coming soon)
|
||||
#OnFailure=systemd-sendmail@%n
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# RaspiBolt LND Mainnet: systemd unit for getpublicip.sh script
|
||||
# /etc/systemd/system/getpublicip.service
|
||||
|
||||
[Unit]
|
||||
Description=getpublicip.sh: get public ip address from ipinfo.io
|
||||
Wants=bootstrap.service
|
||||
After=bootstrap.service
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Group=root
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/getpublicip.sh
|
||||
ExecStartPost=/bin/sleep 5
|
||||
Restart=always
|
||||
|
||||
RestartSec=600
|
||||
TimeoutSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip'
|
||||
while [ 0 ];
|
||||
do
|
||||
# check if TOR is running
|
||||
torExists=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep hostname -c)
|
||||
if [ ${torExists} -eq 0 ]; then
|
||||
# get and set public IP
|
||||
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip;
|
||||
else
|
||||
# set onion address
|
||||
printf "PUBLICIP=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)\n" > /run/publicip;
|
||||
fi
|
||||
sleep 600
|
||||
done;
|
|
@ -1,7 +1,7 @@
|
|||
[Unit]
|
||||
Description=Bitcoin daemon
|
||||
Wants=getpublicip.service
|
||||
After=getpublicip.service
|
||||
Wants=bootstrap.service
|
||||
After=bootstrap.service
|
||||
|
||||
# for use with sendmail alert (coming soon)
|
||||
#OnFailure=systemd-sendmail@%n
|
||||
|
|
|
@ -5,6 +5,7 @@ debuglevel=debug
|
|||
maxpendingchannels=5
|
||||
alias=raspiblitz
|
||||
color=#68F442
|
||||
nat=true
|
||||
|
||||
# RPC open to all connections on Port 10009
|
||||
rpclisten=0.0.0.0:10009
|
||||
|
|
|
@ -5,6 +5,7 @@ debuglevel=debug
|
|||
maxpendingchannels=5
|
||||
alias=raspiblitz
|
||||
color=#68F442
|
||||
nat=true
|
||||
|
||||
# RPC open to all connections on Port 10009
|
||||
rpclisten=0.0.0.0:10009
|
||||
|
|
|
@ -9,10 +9,7 @@ After=bitcoind.service
|
|||
#OnFailure=systemd-sendmail@%n
|
||||
|
||||
[Service]
|
||||
# get var PUBIP from file
|
||||
EnvironmentFile=/run/publicip
|
||||
|
||||
ExecStart=/usr/local/bin/lnd --externalip=${PUBLICIP}
|
||||
ExecStart=/usr/local/bin/lnd
|
||||
PIDFile=/home/bitcoin/.lnd/lnd.pid
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
|
|
|
@ -10,13 +10,13 @@ After=bitcoind.service
|
|||
|
||||
[Service]
|
||||
# get var PUBIP from file
|
||||
EnvironmentFile=/run/publicip
|
||||
EnvironmentFile=/mnt/hdd/tor/v3Address
|
||||
|
||||
# TOR Hidden Service v2
|
||||
ExecStart=/usr/local/bin/lnd --tor.active --tor.v2 --listen=127.0.0.1:9735
|
||||
|
||||
# TOR Hidden Service v3
|
||||
# ExecStart=/usr/local/bin/lnd --tor.active --tor.v3 --externalip=${PUBLICIP} --listen=127.0.0.1:9735
|
||||
# ExecStart=/usr/local/bin/lnd --tor.active --tor.v3 --externalip=${V3ADDRESS} --listen=127.0.0.1:9735
|
||||
|
||||
PIDFile=/home/bitcoin/.lnd/lnd.pid
|
||||
User=bitcoin
|
||||
|
|
Loading…
Add table
Reference in a new issue