From 540316bb39afb91d69ef297268bda8884a053f26 Mon Sep 17 00:00:00 2001 From: kexkey Date: Thu, 2 Dec 2021 15:21:17 -0500 Subject: [PATCH] Small fixes here and there --- .../templates/installer/docker/docker-compose.yaml | 8 ++++---- cyphernodeconf_docker/templates/installer/testfeatures.sh | 5 +---- proxy_docker/app/script/callbacks_job.sh | 4 ++-- proxy_docker/app/script/startproxy.sh | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml b/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml index a7e657d..6250e32 100644 --- a/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml +++ b/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml @@ -9,7 +9,7 @@ services: postgres: image: postgres:<%= postgres_version %> user: $USER - entrypoint: sh -c 'rm -f /container_monitor/postgres_ready ; docker-entrypoint.sh -c logging_collector=true -c log_directory=/cnlogs/' + entrypoint: sh -c 'rm -f /container_monitor/postgres_ready ; exec docker-entrypoint.sh -c logging_collector=true -c log_directory=/cnlogs/' environment: - "POSTGRES_USER=cyphernode" - "POSTGRES_PASSWORD=<%= postgres_password %>" @@ -49,8 +49,8 @@ services: tor: image: cyphernode/tor:<%= tor_version %> - # Sleeping 7 seconds to let lightning and traefik start - command: $USER sh -c 'rm -f /container_monitor/tor_ready ; sleep 10 ; export HOME=/tor ; tor -f /tor/torrc' + # Sleeping 10 seconds to let lightning and traefik start + command: $USER sh -c 'rm -f /container_monitor/tor_ready ; sleep 10 ; export HOME=/tor ; exec tor -f /tor/torrc' volumes: - "<%= tor_datapath %>:/tor" - container_monitor:/container_monitor @@ -129,7 +129,7 @@ services: bitcoin: image: cyphernode/bitcoin:<%= bitcoin_version %> - command: $USER /.bitcoin/entrypoint.sh + command: $USER /.bitcoin/entrypoint.sh <% if( bitcoin_expose ) { %> ports: - "<%= (net === 'regtest') ? '18444:18444' : ((net === 'testnet') ? '18333:18333' : '8333:8333') %>" diff --git a/cyphernodeconf_docker/templates/installer/testfeatures.sh b/cyphernodeconf_docker/templates/installer/testfeatures.sh index d10cf39..6a2b045 100644 --- a/cyphernodeconf_docker/templates/installer/testfeatures.sh +++ b/cyphernodeconf_docker/templates/installer/testfeatures.sh @@ -84,9 +84,7 @@ checkpostgres() { echo -en "\r\n\e[1;36mTesting Postgres... " > /dev/console local rc - # getbatcher needs the database to return correctly... -# rc=$(curl -s -o /dev/null -w "%{http_code}" http://proxy:8888/getbatcher) - pg_isready -h postgres + pg_isready -h postgres -U cyphernode [ "${?}" -ne "0" ] && return 105 echo -e "\e[1;36mPostgres rocks!" > /dev/console @@ -112,7 +110,6 @@ checknotifier() { local returncode nc -vlp1111 -e sh -c 'echo -en "HTTP/1.1 200 OK\\r\\n\\r\\n" ; date >&2 ; timeout 1 tee /dev/tty | cat ; ' & - # response=$(mosquitto_rr -h broker -W 15 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"http://proxy:8888/helloworld\",\"tor\":false}") response=$(mosquitto_rr -h broker -W 15 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"http://$(hostname):1111/notifiertest\",\"tor\":false}") returncode=$? [ "${returncode}" -ne "0" ] && return 115 diff --git a/proxy_docker/app/script/callbacks_job.sh b/proxy_docker/app/script/callbacks_job.sh index 5697830..1091445 100644 --- a/proxy_docker/app/script/callbacks_job.sh +++ b/proxy_docker/app/script/callbacks_job.sh @@ -20,7 +20,7 @@ do_callbacks() { fi # Let's fetch all the watching addresses still being watched but not called back - local callbacks=$(sql "SELECT DISTINCT w.callback0conf, address, txid, vout, amount, confirmations, timereceived, fee, size, vsize, blockhash, blockheight, blocktime, w.id, is_replaceable::text, pub32_index, pub32, w32.label, derivation_path, event_message, hash FROM watching w LEFT JOIN watching_tx ON w.id = watching_id LEFT JOIN tx ON tx.id = tx_id LEFT JOIN watching_by_pub32 w32 ON w.watching_by_pub32_id = w32.id WHERE NOT calledback0conf AND watching_id IS NOT NULL AND w.callback0conf IS NOT NULL AND w.watching${txid_where}") + local callbacks=$(sql "SELECT DISTINCT w.callback0conf, address, txid, vout, amount, confirmations, timereceived, fee, size, vsize, blockhash, blockheight, blocktime, w.id, is_replaceable::text, pub32_index, pub32, w.label, derivation_path, event_message, hash FROM watching w LEFT JOIN watching_tx ON w.id = watching_id LEFT JOIN tx ON tx.id = tx_id LEFT JOIN watching_by_pub32 w32 ON w.watching_by_pub32_id = w32.id WHERE NOT calledback0conf AND watching_id IS NOT NULL AND w.callback0conf IS NOT NULL AND w.watching${txid_where}") trace "[do_callbacks] callbacks0conf=${callbacks}" local returncode @@ -39,7 +39,7 @@ do_callbacks() { fi done - callbacks=$(sql "SELECT DISTINCT w.callback1conf, address, txid, vout, amount, confirmations, timereceived, fee, size, vsize, blockhash, blockheight, blocktime, w.id, is_replaceable::text, pub32_index, pub32, w32.label, derivation_path, event_message, hash FROM watching w JOIN watching_tx wt ON w.id = wt.watching_id JOIN tx t ON wt.tx_id = t.id LEFT JOIN watching_by_pub32 w32 ON watching_by_pub32_id = w32.id WHERE NOT calledback1conf AND confirmations>0 AND w.callback1conf IS NOT NULL AND w.watching${txid_where}") + callbacks=$(sql "SELECT DISTINCT w.callback1conf, address, txid, vout, amount, confirmations, timereceived, fee, size, vsize, blockhash, blockheight, blocktime, w.id, is_replaceable::text, pub32_index, pub32, w.label, derivation_path, event_message, hash FROM watching w JOIN watching_tx wt ON w.id = wt.watching_id JOIN tx t ON wt.tx_id = t.id LEFT JOIN watching_by_pub32 w32 ON watching_by_pub32_id = w32.id WHERE NOT calledback1conf AND confirmations>0 AND w.callback1conf IS NOT NULL AND w.watching${txid_where}") trace "[do_callbacks] callbacks1conf=${callbacks}" for row in ${callbacks} diff --git a/proxy_docker/app/script/startproxy.sh b/proxy_docker/app/script/startproxy.sh index 6d25b87..3ba6b5d 100644 --- a/proxy_docker/app/script/startproxy.sh +++ b/proxy_docker/app/script/startproxy.sh @@ -35,7 +35,7 @@ else fi trace "[startproxy] Waiting for PostgreSQL to be ready..." -while [ ! -f "/container_monitor/postgres_ready" ]; do echo "PostgreSQL not ready" ; sleep 10 ; done +while [ ! -f "/container_monitor/postgres_ready" ]; do trace "[startproxy] PostgreSQL not ready" ; sleep 10 ; done trace "[startproxy] PostgreSQL ready!" if [ ! -e ${DB_FILE} ]; then