From 38fcb90f55e4f7673f4997c71c1f9bbf2ad75381 Mon Sep 17 00:00:00 2001 From: kexkey Date: Tue, 12 Nov 2019 17:55:15 -0500 Subject: [PATCH] Escape char war and started TORifying lightning --- cyphernodeconf_docker/templates/tor/torrc | 3 +++ otsclient_docker/script/otsclient.sh | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cyphernodeconf_docker/templates/tor/torrc b/cyphernodeconf_docker/templates/tor/torrc index c00a5fa..77fa950 100644 --- a/cyphernodeconf_docker/templates/tor/torrc +++ b/cyphernodeconf_docker/templates/tor/torrc @@ -2,5 +2,8 @@ HiddenServiceDir /tor/hidden_service/ HiddenServiceVersion 3 HiddenServicePort 80 traefik:80 HiddenServicePort 443 traefik:443 +<% if ( features.indexOf('lightning') !== -1 ) { %> +HiddenServicePort 1234 lightning:9735 +<% } %> SocksPort 0.0.0.0:9050 ExitPolicy reject *:* # no exits allowed diff --git a/otsclient_docker/script/otsclient.sh b/otsclient_docker/script/otsclient.sh index 9a2a598..bdeb254 100644 --- a/otsclient_docker/script/otsclient.sh +++ b/otsclient_docker/script/otsclient.sh @@ -16,16 +16,16 @@ stamp() { local proxychains="" if [ -n "${TOR_HOST}" ]; then - proxychains="PROXYCHAINS_ONE_PROXY=\"socks5 `getent hosts ${TOR_HOST} | awk '{ print $1 }'` ${TOR_PORT}\" proxychains4" + proxychains="PROXYCHAINS_ONE_PROXY='socks5 `getent hosts ${TOR_HOST} | awk '{ print $1 }'` ${TOR_PORT}' proxychains4" fi if [ "${TESTNET}" -eq "1" ]; then trace "[stamp] ${proxychains} ots-cli.js stamp -c \"https://ots.testnet.kexkey.com\" -d ${hash}" - result=$(cd /otsfiles && ${proxychains} ots-cli.js stamp -c "https://ots.testnet.kexkey.com" -d ${hash} 2>&1) + result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js stamp -c 'https://ots.testnet.kexkey.com' -d ${hash} 2>&1") returncode=$? else trace "[stamp] ${proxychains} ots-cli.js stamp -d ${hash}" - result=$(cd /otsfiles && ${proxychains} ots-cli.js stamp -d ${hash} 2>&1) + result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js stamp -d ${hash} 2>&1") returncode=$? fi trace_rc ${returncode} @@ -66,16 +66,16 @@ upgrade() { local proxychains="" if [ -n "${TOR_HOST}" ]; then - proxychains="PROXYCHAINS_ONE_PROXY=\"socks5 `getent hosts ${TOR_HOST} | awk '{ print $1 }'` ${TOR_PORT}\" proxychains4" + proxychains="PROXYCHAINS_ONE_PROXY='socks5 `getent hosts ${TOR_HOST} | awk '{ print $1 }'` ${TOR_PORT}' proxychains4" fi if [ "${TESTNET}" -eq "1" ]; then trace "[upgrade] ${proxychains} ots-cli.js -l \"https://testnet.calendar.kexkey.com/\" --no-default-whitelist upgrade -c \"https://testnet.calendar.kexkey.com/\" ${hash}.ots" - result=$(cd /otsfiles && ${proxychains} ots-cli.js -l "https://testnet.calendar.kexkey.com/" --no-default-whitelist upgrade -c "https://testnet.calendar.kexkey.com/" ${hash}.ots 2>&1) + result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js -l 'https://testnet.calendar.kexkey.com/' --no-default-whitelist upgrade -c 'https://testnet.calendar.kexkey.com/' ${hash}.ots 2>&1") returncode=$? else trace "[upgrade] ${proxychains} ots-cli.js upgrade ${hash}.ots" - result=$(cd /otsfiles && ${proxychains} ots-cli.js upgrade ${hash}.ots 2>&1) + result=$(cd /otsfiles && sh -c "${proxychains} ots-cli.js upgrade ${hash}.ots 2>&1") returncode=$? fi trace_rc ${returncode} @@ -120,7 +120,7 @@ verify() { local proxychains="" if [ -n "${TOR_HOST}" ]; then - proxychains="PROXYCHAINS_ONE_PROXY=\"socks5 `getent hosts ${TOR_HOST} | awk '{ print $1 }'` ${TOR_PORT}\" proxychains4" + proxychains="PROXYCHAINS_ONE_PROXY='socks5 `getent hosts ${TOR_HOST} | awk '{ print $1 }'` ${TOR_PORT}' proxychains4" fi # Let's create the OTS file locally from the base64 @@ -129,11 +129,11 @@ verify() { if [ "${TESTNET}" -eq "1" ]; then trace "[verify] ${proxychains} ots-cli.js -l \"https://testnet.calendar.kexkey.com/\" --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots" - result=$(${proxychains} ots-cli.js -l "https://testnet.calendar.kexkey.com/" --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1) + result=$(sh -c "${proxychains} ots-cli.js -l 'https://testnet.calendar.kexkey.com/' --no-default-whitelist verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1") returncode=$? else trace "[verify] ${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots" - result=$(${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1) + result=$(sh -c "${proxychains} ots-cli.js verify -d ${hash} /otsfiles/otsfile-$$.ots 2>&1") returncode=$? fi trace_rc ${returncode}