From 8f009a547d53b0040e1f0148ebc6e7bc2dc727d3 Mon Sep 17 00:00:00 2001 From: Philippe Lamy Date: Tue, 11 Jan 2022 17:13:20 -0500 Subject: [PATCH] moved proxycron config out of docker-compose.yaml --- .gitignore | 1 + cyphernodeconf_docker/prompters/800_proxycron.js | 15 +++++++++++++++ .../installer/docker/docker-compose.yaml | 5 ++--- .../templates/proxycron/proxycron.env | 2 ++ dist/setup.sh | 9 +++++---- 5 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 cyphernodeconf_docker/prompters/800_proxycron.js create mode 100644 cyphernodeconf_docker/templates/proxycron/proxycron.env diff --git a/.gitignore b/.gitignore index d8a7c69..aafeefb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist/** !dist/setup.sh !dist/sr.sh +!dist/.env diff --git a/cyphernodeconf_docker/prompters/800_proxycron.js b/cyphernodeconf_docker/prompters/800_proxycron.js new file mode 100644 index 0000000..017d7b1 --- /dev/null +++ b/cyphernodeconf_docker/prompters/800_proxycron.js @@ -0,0 +1,15 @@ +const chalk = require('chalk'); + +const name = 'proxycron'; + +module.exports = { + name: function() { + return name; + }, + prompts: function( utils ) { + return []; + }, + templates: function( props ) { + return [ 'proxycron.env' ]; + } +}; \ No newline at end of file diff --git a/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml b/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml index 6250e32..33ec0dd 100644 --- a/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml +++ b/cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml @@ -245,9 +245,8 @@ services: proxycron: image: cyphernode/proxycron:<%= proxycron_version %> - environment: - - "TX_CONF_URL=proxy:8888/executecallbacks" - - "OTS_URL=proxy:8888/ots_backoffice" + env_file: + - ./.env/proxycron.env networks: - cyphernodenet depends_on: diff --git a/cyphernodeconf_docker/templates/proxycron/proxycron.env b/cyphernodeconf_docker/templates/proxycron/proxycron.env new file mode 100644 index 0000000..4d5497e --- /dev/null +++ b/cyphernodeconf_docker/templates/proxycron/proxycron.env @@ -0,0 +1,2 @@ +TX_CONF_URL=proxy:8888/executecallbacks +OTS_URL=proxy:8888/ots_backoffice \ No newline at end of file diff --git a/dist/setup.sh b/dist/setup.sh index 6485c29..846244d 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -127,7 +127,7 @@ sudo_if_required() { } modify_permissions() { - local directories=("$current_path/apps" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$OTSCLIENT_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") + local directories=("$current_path/apps" "$current_path/.env" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$OTSCLIENT_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") for d in "${directories[@]}" do if [[ -e $d ]]; then @@ -139,7 +139,7 @@ modify_permissions() { } modify_owner() { - local directories=("$current_path/apps" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$OTSCLIENT_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") + local directories=("$current_path/apps" "$current_path/.env" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$OTSCLIENT_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") local user=$(id -u $RUN_AS_USER):$(id -g $RUN_AS_USER) for d in "${directories[@]}" do @@ -478,6 +478,7 @@ install_docker() { copy_file $cyphernodeconf_filepath/cyphernode/info.json $PROXY_DATAPATH/info.json 1 $SUDO_REQUIRED copy_file $cyphernodeconf_filepath/postgres/pgpass $PROXY_DATAPATH/pgpass 1 $SUDO_REQUIRED sudo_if_required chmod 0600 $PROXY_DATAPATH/pgpass + copy_file $cyphernodeconf_filepath/proxycron/proxycron.env $current_path/.env/proxycron.env 1 $SUDO_REQUIRED if [[ $BITCOIN_INTERNAL == true ]]; then if [ ! -d $BITCOIN_DATAPATH ]; then @@ -669,7 +670,7 @@ install_docker() { check_directory_owner() { # if one directory does not have access rights for $RUN_AS_USER, we echo 1, else we echo 0 - local directories=("$current_path/apps" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") + local directories=("$current_path/apps" "$current_path/.env" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") local status=0 for d in "${directories[@]}" do @@ -773,7 +774,7 @@ sanity_checks_pre_install() { if [[ $sudo_reason == 'directories' ]]; then echo " or check your data volumes if they have the right owner." echo " The owner of the following folders should be '$RUN_AS_USER':" - local directories=("$current_path/apps" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") + local directories=("$current_path/apps" "$current_path/.env" "$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$POSTGRES_DATAPATH" "$LOGS_DATAPATH" "$TRAEFIK_DATAPATH" "$TOR_DATAPATH") local status=0 for d in "${directories[@]}" do