Fixes in setup when Tor is not selected

This commit is contained in:
kexkey
2020-01-27 13:26:34 -05:00
parent 56f3857dfe
commit f994ceabe5
8 changed files with 22 additions and 18 deletions

View File

@@ -57,7 +57,7 @@ module.exports = {
Next question is asked when lightning_annouce is YES and (not Tor or (Tor and LN clearnet)).
*/
{
when: (props) => { return featureCondition(props) && props.lightning_announce && (props.torifyables.indexOf('tor_lightning') == -1 || props.clearnet.indexOf('clearnet_lightning') != -1) },
when: (props) => { return featureCondition(props) && props.lightning_announce && ((!props.torifyables || props.torifyables.indexOf('tor_lightning') === -1) || (props.clearnet && props.clearnet.indexOf('clearnet_lightning') !== -1)) },
type: 'input',
name: 'lightning_external_ip',
default: utils.getDefault( 'lightning_external_ip' ),

View File

@@ -17,10 +17,10 @@ zmqpubrawtx=tcp://0.0.0.0:18502
listen=1
<% if ( torifyables.indexOf('tor_bitcoin') !== -1 ) { %>
<% if ( torifyables && torifyables.indexOf('tor_bitcoin') !== -1 ) { %>
#tor
proxy=tor:9050
<% if ( clearnet.indexOf('clearnet_bitcoin') == -1 ) { %>
<% if ( !clearnet || clearnet.indexOf('clearnet_bitcoin') === -1 ) { %>
onlynet=onion
<% } %>
<% } %>

View File

@@ -10,12 +10,12 @@ TRAEFIK_DATAPATH=<%= traefik_datapath %>
FEATURE_TOR=<%= (features.indexOf('tor') != -1)?'true':'false' %>
<% if ( features.indexOf('tor') !== -1 ) { %>
TOR_DATAPATH=<%= tor_datapath %>
TOR_OTS_WEBHOOKS=<%= (torifyables.indexOf('tor_otswebhooks') != -1)?'true':'false' %>
TOR_ADDR_WATCH_WEBHOOKS=<%= (torifyables.indexOf('tor_addrwatcheswebhooks') != -1)?'true':'false' %>
TOR_TXID_WATCH_WEBHOOKS=<%= (torifyables.indexOf('tor_txidwatcheswebhooks') != -1)?'true':'false' %>
TOR_TRAEFIK=<%= (torifyables.indexOf('tor_traefik') != -1)?'true':'false' %>
TOR_BITCOIN=<%= (torifyables.indexOf('tor_bitcoin') != -1)?'true':'false' %>
TOR_LIGHTNING=<%= (torifyables.indexOf('tor_lightning') != -1)?'true':'false' %>
TOR_OTS_WEBHOOKS=<%= (torifyables && torifyables.indexOf('tor_otswebhooks') !== -1)?'true':'false' %>
TOR_ADDR_WATCH_WEBHOOKS=<%= (torifyables && torifyables.indexOf('tor_addrwatcheswebhooks') !== -1)?'true':'false' %>
TOR_TXID_WATCH_WEBHOOKS=<%= (torifyables && torifyables.indexOf('tor_txidwatcheswebhooks') !== -1)?'true':'false' %>
TOR_TRAEFIK=<%= (torifyables && torifyables.indexOf('tor_traefik') !== -1)?'true':'false' %>
TOR_BITCOIN=<%= (torifyables && torifyables.indexOf('tor_bitcoin') !== -1)?'true':'false' %>
TOR_LIGHTNING=<%= (torifyables && torifyables.indexOf('tor_lightning') !== -1)?'true':'false' %>
<% } %>
DOCKER_MODE=<%= docker_mode %>
RUN_AS_USER=<%= run_as_different_user?username:'' %>

View File

@@ -68,7 +68,11 @@ services:
bitcoin:
image: cyphernode/bitcoin:<%= bitcoin_version %>
<% if ( torifyables && torifyables.indexOf('tor_bitcoin') !== -1 ) { %>
command: $USER sh -c 'rm -f /container_monitor/bitcoin_ready ; while [ ! -f "/container_monitor/tor_ready" ]; do echo "tor not ready" ; sleep 10 ; done ; echo "tor ready" ; bitcoind'
<% } else { %>
command: $USER sh -c 'rm -f /container_monitor/bitcoin_ready ; bitcoind'
<% } %>
<% if( bitcoin_expose ) { %>
ports:
- "<%= (net === 'regtest') ? '18443:18443' : ((net === 'testnet') ? '18332:18332' : '8332:8332') %>"
@@ -235,7 +239,7 @@ services:
<% if (net === 'testnet') { %>
- "TESTNET=1"
<% } %>
<% if ( torifyables.indexOf('tor_otsoperations') !== -1 ) { %>
<% if ( torifyables && torifyables.indexOf('tor_otsoperations') !== -1 ) { %>
- "TOR_HOST=tor"
- "TOR_PORT=9050"
<% } %>

View File

@@ -79,7 +79,7 @@ fi
printf "\r\n\033[0;92mDepending on your current location and DNS settings, point your favorite browser to one of the following URLs to access Cyphernode's status page:\r\n"
printf "\r\n"
printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + ':' + traefik_https_port + '/welcome\\r\\n') %><% }) %>\033[0m\r\n"
<% if ( torifyables.indexOf('tor_traefik') !== -1 ) { %>
<% if ( torifyables && torifyables.indexOf('tor_traefik') !== -1 ) { %>
printf "\033[0;92mYou can also use Tor Browser and navigate to your onion address:\r\n"
printf "\033[0;95mhttps://${TOR_TRAEFIK_HOSTNAME}:<%= traefik_https_port %>/welcome\033[0m\r\n\r\n"
<% } %>

View File

@@ -16,10 +16,10 @@ rgb=<%= lightning_nodecolor %>
addr=0.0.0.0:9735
<% if ( torifyables.indexOf('tor_lightning') !== -1 ) { %>
<% if ( torifyables && torifyables.indexOf('tor_lightning') !== -1 ) { %>
# Tor
# proxy=tor:9050 this has to be made at execution time because of getaddrinfo and alpine not being friends, see entrypoint.sh
<% if ( clearnet.indexOf('clearnet_lightning') == -1 ) { %>
<% if ( !clearnet || clearnet.indexOf('clearnet_lightning') === -1 ) { %>
# Tor only, no clearnet
always-use-proxy=true
disable-dns
@@ -27,7 +27,7 @@ disable-dns
<% if (lightning_announce) { %>
# Announcing Tor address
announce-addr=<%= locals.tor_lightning_hostname %>:9735
<% if ( clearnet.indexOf('clearnet_lightning') !== -1 ) { %>
<% if ( clearnet && clearnet.indexOf('clearnet_lightning') !== -1 ) { %>
<% if( locals.lightning_external_ip ) { %>
# Announcing clearnet address
announce-addr=<%= locals.lightning_external_ip %>:9735

View File

@@ -6,7 +6,7 @@ while [ ! -f "/container_monitor/bitcoin_ready" ]; do echo "bitcoin not ready" ;
echo "bitcoin ready"
<% if ( torifyables.indexOf('tor_lightning') !== -1 ) { %>
<% if ( torifyables && torifyables.indexOf('tor_lightning') !== -1 ) { %>
#while [ ! -f "/container_monitor/tor_ready" ]; do echo "tor not ready" ; sleep 10 ; done
while [ -z "${TORIP}" ]; do echo "tor not ready" ; TORIP=$(getent hosts tor | awk '{ print $1 }') ; sleep 10 ; done

View File

@@ -1,17 +1,17 @@
<% if ( torifyables.indexOf('tor_traefik') !== -1 ) { %>
<% if ( torifyables && torifyables.indexOf('tor_traefik') !== -1 ) { %>
HiddenServiceDir /tor/traefik/hidden_service/
HiddenServiceVersion 3
HiddenServicePort <%= traefik_http_port %> traefik:<%= traefik_http_port %>
HiddenServicePort <%= traefik_https_port %> traefik:<%= traefik_https_port %>
<% } %>
<% if ( torifyables.indexOf('tor_lightning') !== -1 && lightning_expose ) { %>
<% if ( torifyables && torifyables.indexOf('tor_lightning') !== -1 && lightning_expose ) { %>
HiddenServiceDir /tor/lightning/hidden_service/
HiddenServiceVersion 3
HiddenServicePort 9735 lightning:9735
<% } %>
<% if ( torifyables.indexOf('tor_bitcoin') !== -1 && bitcoin_expose) { %>
<% if ( torifyables && torifyables.indexOf('tor_bitcoin') !== -1 && bitcoin_expose) { %>
HiddenServiceDir /tor/bitcoin/hidden_service/
HiddenServiceVersion 3
HiddenServicePort 8333 bitcoin:8333