mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-11-18 09:57:17 +01:00
fix tls rest config
This commit is contained in:
@@ -13,6 +13,7 @@ rpclisten=0.0.0.0:10009
|
|||||||
restlisten=0.0.0.0:8080
|
restlisten=0.0.0.0:8080
|
||||||
# Domain, could use https://freedns.afraid.org
|
# Domain, could use https://freedns.afraid.org
|
||||||
#tlsextradomain=lightning.yourhost.com
|
#tlsextradomain=lightning.yourhost.com
|
||||||
|
tlsextraip=0.0.0.0
|
||||||
|
|
||||||
[Bitcoin]
|
[Bitcoin]
|
||||||
bitcoin.active=1
|
bitcoin.active=1
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ restlisten=0.0.0.0:8080
|
|||||||
|
|
||||||
# Domain, could use https://freedns.afraid.org
|
# Domain, could use https://freedns.afraid.org
|
||||||
#tlsextradomain=lightning.yourhost.com
|
#tlsextradomain=lightning.yourhost.com
|
||||||
|
tlsextraip=0.0.0.0
|
||||||
|
|
||||||
[Litecoin]
|
[Litecoin]
|
||||||
litecoin.active=1
|
litecoin.active=1
|
||||||
|
|||||||
@@ -55,27 +55,26 @@ fi
|
|||||||
# switch on
|
# switch on
|
||||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
|
|
||||||
# make sure REST config of LND is correct
|
# make sure config values are uncommented
|
||||||
restActive=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'restlisten=0.0.0.0:8080')
|
sudo sed -i "s/^#restlisten=.*/restlisten=/g" /mnt/hdd/lnd/lnd.conf
|
||||||
if [ ${restActive} -eq 0 ]; then
|
sudo sed -i "s/^#tlsextraip=.*/tlsextraip=/g" /mnt/hdd/lnd/lnd.conf
|
||||||
restActive=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'restlisten=')
|
|
||||||
if [ ${restActive} -eq 1 ]; then
|
# make sure config values exits
|
||||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
exists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'restlisten=')
|
||||||
echo "FAIL: /mnt/hdd/lnd/lnd.conf includes REST config NOT 'restlisten=0.0.0.0:8080'"
|
if [ ${exists} -eq 0 ]; then
|
||||||
echo "CANNOT ACTIVATE REST like needed for auto-unlock"
|
sudo sh -c "echo \"restlisten=\" >> /mnt/hdd/lnd/lnd.conf"
|
||||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
||||||
sleep 5
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
# add REST config to lnd.conf (for old configs)
|
|
||||||
sudo sh -c "echo \"restlisten=0.0.0.0:8080\" >> /mnt/hdd/lnd/lnd.conf"
|
|
||||||
echo "LND REST config added -> restlisten=0.0.0.0:8080'"
|
|
||||||
# refresh TLS cert
|
|
||||||
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "LND REST config OK -> restlisten=0.0.0.0:8080'"
|
|
||||||
fi
|
fi
|
||||||
|
exists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c 'tlsextraip')
|
||||||
|
if [ ${exists} -eq 0 ]; then
|
||||||
|
sudo sh -c "echo \"tlsextraip=\" >> /mnt/hdd/lnd/lnd.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set needed config values
|
||||||
|
sudo sed -i "s/^restlisten=.*/restlisten=0.0.0.0:8080/g" /mnt/hdd/lnd/lnd.conf
|
||||||
|
sudo sed -i "s/^tlsextraip=.*/tlsextraip=0.0.0.0/g" /mnt/hdd/lnd/lnd.conf
|
||||||
|
|
||||||
|
# refresh TLS cert
|
||||||
|
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
||||||
|
|
||||||
echo "switching the Auto-Unlock ON"
|
echo "switching the Auto-Unlock ON"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user