Browse Source

update just local detection

sshtunnel
Christian Rotzoll 6 years ago
parent
commit
e19588178b
  1. 5
      README.md
  2. 26
      home.admin/97addMobileWallet.sh
  3. 2
      home.admin/97addMobileWalletZap.sh

5
README.md

@ -384,12 +384,15 @@ To do so you can register at an DynamicDomain service like freedns.afraid.org an
* 8333 (Bitcoin/mainnet) * 8333 (Bitcoin/mainnet)
* 9735 (LND Node) * 9735 (LND Node)
* 10009 (LND RPC) * 10009 (LND RPC)
* 8080 (LND REST API)
... from your internet router to the local IP of your RaspiBlitz and then activate unter "Services" the "DynamicDNS" option. ... from your internet router to the local IP of your RaspiBlitz and then activate unter "Services" the "DynamicDNS" option.
You will be asked for your dynamic domain name such like "mynode.crabdance.org" and you can also optionally set an URL that will be called regularly to update your routers IP with the dynnamic domain service. At freedns.afraid.org this URL is called "Direct URL" under the menu "Dynamic DNS" once you added one. You will be asked for your dynamic domain name such like "mynode.crabdance.org" and you can also optionally set an URL that will be called regularly to update your routers IP with the dynnamic domain service. At freedns.afraid.org this URL is called "Direct URL" under the menu "Dynamic DNS" once you added one.
*NOTE: DynamicDNS just works if you can forward ports on your router and you have a temporary public IP address (your ISP is not running you behind a NAT - like on most mobile connections). Another solution to make your ports reachable from the public internet is to use reverse ssh tunneling - see FAQ on ['How to setup port-forwarding with a SSH tunnel?'](FAQ.md#how-to-setup-port-forwarding-with-a-ssh-tunnel)*
##### Run behind TOR ##### Run behind TOR
You can run your Bitcoin- and Lightning-Node as a TOR hidden service - replacing your IP with an .onion-address You can run your Bitcoin- and Lightning-Node as a TOR hidden service - replacing your IP with an .onion-address

26
home.admin/97addMobileWallet.sh

@ -4,19 +4,37 @@
source /home/admin/raspiblitz.info source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
justLocal=1
# if dynDomain is set connect from outside is possible (no notice)
if [ ${#dynDomain} -gt 0 ]; then
justLocal=0
fi
# if sshtunnel to 10009/8080 then outside reach is possible (no notice)
isForwarded=$(echo ${sshtunnel} | grep -c "10009<")
if [ ${isForwarded} -gt 0 ]; then
justLocal=0
fi
isForwarded=$(echo ${sshtunnel} | grep -c "8080<")
if [ ${isForwarded} -gt 0 ]; then
justLocal=0
fi
# check if dynamic domain is set # check if dynamic domain is set
if [ ${#dynDomain} -eq 0 ]; then if [ ${justLocal} -eq 1 ]; then
dialog --title " Just Local Network? " --yesno "If you want to connect with your RaspiBlitz dialog --title " Just Local Network? " --yesno "If you want to connect with your RaspiBlitz
also from outside your local network you need to also from outside your local network you need to
activate 'Services' -> 'DynamicDNS' FIRST. activate 'Services' -> 'DynamicDNS' FIRST.
Or use SSH tunnel forwarding for port 10009.
For more details see chapter in GitHub README For more details see chapter in GitHub README
'Public Domain with DynamicDNS' on the service 'DynamicDNS'
https://github.com/rootzoll/raspiblitz https://github.com/rootzoll/raspiblitz
Do you JUST want to connect with your mobile Do you JUST want to connect with your mobile
when your are on the same LOCAL NETWORK? when your are on the same LOCAL NETWORK?
" 14 54 " 15 54
response=$? response=$?
case $response in case $response in
1) exit ;; 1) exit ;;

2
home.admin/97addMobileWalletZap.sh

@ -92,7 +92,7 @@ fi
# check if port 10009 is forwarded # check if port 10009 is forwarded
if [ ${#sshtunnel} -gt 0 ]; then if [ ${#sshtunnel} -gt 0 ]; then
isForwarded=$(echo "${sshtunnel}" | grep -c "10009<") isForwarded=$(echo ${sshtunnel} | grep -c "10009<")
if [ ${isForwarded} -gt 0 ]; then if [ ${isForwarded} -gt 0 ]; then
host=$(echo $sshtunnel | cut -d '@' -f2 | cut -d ' ' -f1) host=$(echo $sshtunnel | cut -d '@' -f2 | cut -d ' ' -f1)
port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | sed 's/[^0-9]//g') port=$(echo $sshtunnel | awk '{split($0,a,"10009<"); print a[2]}' | sed 's/[^0-9]//g')

Loading…
Cancel
Save