mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-30 11:05:40 +01:00
Hack to get proxy to work in c-lightning, getting the tor container IP dynamically
This commit is contained in:
@@ -17,7 +17,7 @@ const featureCondition = function(props) {
|
||||
|
||||
const templates = {
|
||||
'lnd': [ path.join('lnd','lnd.conf') ],
|
||||
'c-lightning': [ path.join('c-lightning','config') ]
|
||||
'c-lightning': [ path.join('c-lightning','config'), path.join('c-lightning','entrypoint.sh') ]
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -29,7 +29,7 @@ services:
|
||||
|
||||
lightning:
|
||||
image: cyphernode/clightning:<%= lightning_version %>
|
||||
command: $USER sh -c 'while [ ! -f "/bitcoin_monitor/up" ]; do echo "bitcoin not ready" ; sleep 10 ; done ; echo "bitcoin ready!" ; lightningd'
|
||||
command: $USER /.lightning/entrypoint.sh
|
||||
<% if( lightning_expose ) { %>
|
||||
ports:
|
||||
- "9735:9735"
|
||||
|
||||
@@ -18,12 +18,12 @@ addr=0.0.0.0:9735
|
||||
|
||||
<% if ( torifyables.indexOf('tor_lnnode') !== -1 ) { %>
|
||||
# TOR
|
||||
proxy=tor:9050
|
||||
# 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_lnnode') == -1 ) { %>
|
||||
# TOR only, no clearnet
|
||||
always-use-proxy=true
|
||||
disable-dns
|
||||
<% } %>
|
||||
#disable-dns
|
||||
<% if (lightning_announce) { %>
|
||||
# Announcing TOR address
|
||||
announce-addr=<%= locals.tor_hostname %>:9735
|
||||
|
||||
15
cyphernodeconf_docker/templates/lightning/c-lightning/entrypoint.sh
Executable file
15
cyphernodeconf_docker/templates/lightning/c-lightning/entrypoint.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
while [ ! -f "/bitcoin_monitor/up" ]; do echo "bitcoin not ready" ; sleep 10 ; done
|
||||
|
||||
<% if ( torifyables.indexOf('tor_lnnode') !== -1 ) { %>
|
||||
while [ -z "${TORIP}" ]; do echo "tor not ready" ; TORIP=$(getent hosts tor | awk '{ print $1 }') ; sleep 10 ; done
|
||||
|
||||
echo "TOR ready at IP ${TORIP}"
|
||||
|
||||
lightningd --proxy=$TORIP:9050
|
||||
<% } else { %>
|
||||
|
||||
lightningd
|
||||
|
||||
<% } %>
|
||||
1
dist/setup.sh
vendored
1
dist/setup.sh
vendored
@@ -477,6 +477,7 @@ install_docker() {
|
||||
fi
|
||||
|
||||
copy_file $cyphernodeconf_filepath/lightning/c-lightning/config $LIGHTNING_DATAPATH/config 1 $SUDO_REQUIRED
|
||||
copy_file $cyphernodeconf_filepath/lightning/c-lightning/entrypoint.sh $LIGHTNING_DATAPATH/entrypoint.sh 1 $SUDO_REQUIRED
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user