diff --git a/cyphernodeconf_docker/lib/app.js b/cyphernodeconf_docker/lib/app.js index 54cbba5..42f13de 100644 --- a/cyphernodeconf_docker/lib/app.js +++ b/cyphernodeconf_docker/lib/app.js @@ -281,8 +281,8 @@ module.exports = class App { if (this.isChecked('torifyables', 'tor_traefik')) { this.sessionData.tor_traefik_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/traefik/hidden_service' ) )); } - if (this.isChecked('torifyables', 'tor_ln')) { - this.sessionData.tor_ln_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/ln/hidden_service' ) )); + if (this.isChecked('torifyables', 'tor_lightning')) { + this.sessionData.tor_lightning_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/lightning/hidden_service' ) )); } if (this.isChecked('torifyables', 'tor_bitcoin')) { this.sessionData.tor_bitcoin_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/bitcoin/hidden_service' ) )); @@ -440,7 +440,7 @@ module.exports = class App { expose: this.config.data.bitcoin_expose, uacomment: this.config.data.bitcoin_uacomment, torified: this.torifyables.find(data => data.value === 'tor_bitcoin').checked, - clearnet: this.isChecked('clearnet', 'clearnet_bitcoinnode'), + clearnet: this.isChecked('clearnet', 'clearnet_bitcoin'), tor_hostname: this.sessionData.tor_bitcoin_hostname } }, @@ -516,7 +516,7 @@ module.exports = class App { docker: "cyphernode/tor:" + this.config.docker_versions['cyphernode/tor'], extra: { traefik_hostname: this.sessionData.tor_traefik_hostname, - ln_hostname: this.sessionData.tor_ln_hostname, + lightning_hostname: this.sessionData.tor_lightning_hostname, bitcoin_hostname: this.sessionData.tor_bitcoin_hostname, } }, @@ -537,9 +537,9 @@ module.exports = class App { expose: this.config.data.lightning_expose, external_ip: this.config.data.lightning_external_ip, implementation: this.config.data.lightning_implementation, - torified: this.torifyables.find(data => data.value === 'tor_ln').checked, - clearnet: this.isChecked('clearnet', 'clearnet_lnnode'), - tor_hostname: this.sessionData.tor_ln_hostname + torified: this.torifyables.find(data => data.value === 'tor_lightning').checked, + clearnet: this.isChecked('clearnet', 'clearnet_lightning'), + tor_hostname: this.sessionData.tor_lightning_hostname } } } diff --git a/cyphernodeconf_docker/prompters/040_tor.js b/cyphernodeconf_docker/prompters/040_tor.js index 11e97a7..871be6c 100644 --- a/cyphernodeconf_docker/prompters/040_tor.js +++ b/cyphernodeconf_docker/prompters/040_tor.js @@ -36,10 +36,10 @@ module.exports = { message: prefix()+'What features do you want to also allow using clearnet?'+utils.getHelp('clearnet'), choices: [{ name: "Bitcoin Node", - value: "clearnet_bitcoinnode" + value: "clearnet_bitcoin" },{ - name: "LN Node", - value: "clearnet_lnnode" + name: "Lightning Network Node", + value: "clearnet_lightning" }] }]; }, diff --git a/cyphernodeconf_docker/prompters/100_lightning.js b/cyphernodeconf_docker/prompters/100_lightning.js index 9c27578..87e0326 100644 --- a/cyphernodeconf_docker/prompters/100_lightning.js +++ b/cyphernodeconf_docker/prompters/100_lightning.js @@ -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_ln') == -1 || props.clearnet.indexOf('clearnet_lnnode') != -1) }, + when: (props) => { return featureCondition(props) && props.lightning_announce && (props.torifyables.indexOf('tor_lightning') == -1 || props.clearnet.indexOf('clearnet_lightning') != -1) }, type: 'input', name: 'lightning_external_ip', default: utils.getDefault( 'lightning_external_ip' ), diff --git a/cyphernodeconf_docker/schema/config-v0.2.3.json b/cyphernodeconf_docker/schema/config-v0.2.3.json index f3dd6b8..2c7eb5a 100644 --- a/cyphernodeconf_docker/schema/config-v0.2.3.json +++ b/cyphernodeconf_docker/schema/config-v0.2.3.json @@ -206,7 +206,7 @@ "enum": [ "tor_traefik", "tor_bitcoin", - "tor_ln", + "tor_lightning", "tor_otsoperations", "tor_otswebhooks", "tor_addrwatcheswebhooks", @@ -217,7 +217,7 @@ "examples": [ "tor_traefik", "tor_bitcoin", - "tor_l", + "tor_lightning", "tor_otsoperations", "tor_otswebhooks", "tor_addrwatcheswebhooks", @@ -234,14 +234,14 @@ "$id": "#/properties/clearnet/items", "type": "string", "enum": [ - "clearnet_bitcoinnode", - "clearnet_lnnode" + "clearnet_bitcoin", + "clearnet_lightning" ], "title": "The clearnet-allowed Torified feature", "default": "", "examples": [ - "clearnet_bitcoinnode", - "clearnet_lnnode" + "clearnet_bitcoin", + "clearnet_lightning" ] } }, diff --git a/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf b/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf index 92e0705..37fcb56 100644 --- a/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf +++ b/cyphernodeconf_docker/templates/bitcoin/bitcoin.conf @@ -20,7 +20,7 @@ listen=1 <% if ( torifyables.indexOf('tor_bitcoin') !== -1 ) { %> #tor proxy=tor:9050 -<% if ( clearnet.indexOf('clearnet_bitcoinnode') == -1 ) { %> +<% if ( clearnet.indexOf('clearnet_bitcoin') == -1 ) { %> onlynet=onion <% } %> <% } %> diff --git a/cyphernodeconf_docker/templates/installer/config.sh b/cyphernodeconf_docker/templates/installer/config.sh index cdabfe0..6e5456a 100644 --- a/cyphernodeconf_docker/templates/installer/config.sh +++ b/cyphernodeconf_docker/templates/installer/config.sh @@ -15,7 +15,7 @@ TOR_ADDR_WATCH_WEBHOOKS=<%= (torifyables.indexOf('tor_addrwatcheswebhooks') != - 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_LN=<%= (torifyables.indexOf('tor_ln') != -1)?'true':'false' %> +TOR_LIGHTNING=<%= (torifyables.indexOf('tor_lightning') != -1)?'true':'false' %> <% } %> DOCKER_MODE=<%= docker_mode %> RUN_AS_USER=<%= run_as_different_user?username:'' %> diff --git a/cyphernodeconf_docker/templates/lightning/c-lightning/config b/cyphernodeconf_docker/templates/lightning/c-lightning/config index cd6a646..a1b24e2 100644 --- a/cyphernodeconf_docker/templates/lightning/c-lightning/config +++ b/cyphernodeconf_docker/templates/lightning/c-lightning/config @@ -16,18 +16,18 @@ rgb=<%= lightning_nodecolor %> addr=0.0.0.0:9735 -<% if ( torifyables.indexOf('tor_ln') !== -1 ) { %> +<% if ( 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_lnnode') == -1 ) { %> +<% if ( clearnet.indexOf('clearnet_lightning') == -1 ) { %> # Tor only, no clearnet always-use-proxy=true disable-dns <% } %> <% if (lightning_announce) { %> # Announcing Tor address -announce-addr=<%= locals.tor_ln_hostname %>:9735 -<% if ( clearnet.indexOf('clearnet_lnnode') !== -1 ) { %> +announce-addr=<%= locals.tor_lightning_hostname %>:9735 +<% if ( clearnet.indexOf('clearnet_lightning') !== -1 ) { %> <% if( locals.lightning_external_ip ) { %> # Announcing clearnet address announce-addr=<%= locals.lightning_external_ip %>:9735 diff --git a/cyphernodeconf_docker/templates/lightning/c-lightning/entrypoint.sh b/cyphernodeconf_docker/templates/lightning/c-lightning/entrypoint.sh index f5da5aa..e6e5760 100755 --- a/cyphernodeconf_docker/templates/lightning/c-lightning/entrypoint.sh +++ b/cyphernodeconf_docker/templates/lightning/c-lightning/entrypoint.sh @@ -6,7 +6,7 @@ while [ ! -f "/container_monitor/bitcoin_ready" ]; do echo "bitcoin not ready" ; echo "bitcoin ready" -<% if ( torifyables.indexOf('tor_ln') !== -1 ) { %> +<% if ( 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 diff --git a/cyphernodeconf_docker/templates/tor/torrc b/cyphernodeconf_docker/templates/tor/torrc index 8fa3630..1d04ff8 100644 --- a/cyphernodeconf_docker/templates/tor/torrc +++ b/cyphernodeconf_docker/templates/tor/torrc @@ -5,8 +5,8 @@ HiddenServicePort <%= traefik_http_port %> traefik:<%= traefik_http_port %> HiddenServicePort <%= traefik_https_port %> traefik:<%= traefik_https_port %> <% } %> -<% if ( torifyables.indexOf('tor_ln') !== -1 && lightning_expose ) { %> -HiddenServiceDir /tor/ln/hidden_service/ +<% if ( torifyables.indexOf('tor_lightning') !== -1 && lightning_expose ) { %> +HiddenServiceDir /tor/lightning/hidden_service/ HiddenServiceVersion 3 HiddenServicePort 9735 lightning:9735 <% } %> diff --git a/cyphernodeconf_docker/torifyables.json b/cyphernodeconf_docker/torifyables.json index 6e61073..87c2012 100644 --- a/cyphernodeconf_docker/torifyables.json +++ b/cyphernodeconf_docker/torifyables.json @@ -8,8 +8,8 @@ "value": "tor_bitcoin" }, { - "name": "LN Node", - "value": "tor_ln" + "name": "Lightning Network Node", + "value": "tor_lightning" }, { "name": "OTS stamp, upgrade and verify", diff --git a/dist/setup.sh b/dist/setup.sh index f3961d8..33a4073 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -415,11 +415,11 @@ install_docker() { next fi fi - if [[ $TOR_LN == true ]]; then - if [ ! -d $TOR_DATAPATH/ln ]; then - step " create $TOR_DATAPATH/ln" - sudo_if_required mkdir -p $TOR_DATAPATH/ln/hidden_service - sudo_if_required chmod 700 $TOR_DATAPATH/ln/hidden_service + if [[ $TOR_LIGHTNING == true ]]; then + if [ ! -d $TOR_DATAPATH/lightning ]; then + step " create $TOR_DATAPATH/lightning" + sudo_if_required mkdir -p $TOR_DATAPATH/lightning/hidden_service + sudo_if_required chmod 700 $TOR_DATAPATH/lightning/hidden_service next fi fi @@ -437,10 +437,10 @@ install_docker() { copy_file $cyphernodeconf_filepath/tor/traefik/hidden_service/hs_ed25519_public_key $TOR_DATAPATH/traefik/hidden_service/hs_ed25519_public_key 1 $SUDO_REQUIRED copy_file $cyphernodeconf_filepath/tor/traefik/hidden_service/hostname $TOR_DATAPATH/traefik/hidden_service/hostname 1 $SUDO_REQUIRED - if [[ $TOR_LN == true ]]; then - copy_file $cyphernodeconf_filepath/tor/ln/hidden_service/hs_ed25519_secret_key $TOR_DATAPATH/ln/hidden_service/hs_ed25519_secret_key 1 $SUDO_REQUIRED - copy_file $cyphernodeconf_filepath/tor/ln/hidden_service/hs_ed25519_public_key $TOR_DATAPATH/ln/hidden_service/hs_ed25519_public_key 1 $SUDO_REQUIRED - copy_file $cyphernodeconf_filepath/tor/ln/hidden_service/hostname $TOR_DATAPATH/ln/hidden_service/hostname 1 $SUDO_REQUIRED + if [[ $TOR_LIGHTNING == true ]]; then + copy_file $cyphernodeconf_filepath/tor/lightning/hidden_service/hs_ed25519_secret_key $TOR_DATAPATH/lightning/hidden_service/hs_ed25519_secret_key 1 $SUDO_REQUIRED + copy_file $cyphernodeconf_filepath/tor/lightning/hidden_service/hs_ed25519_public_key $TOR_DATAPATH/lightning/hidden_service/hs_ed25519_public_key 1 $SUDO_REQUIRED + copy_file $cyphernodeconf_filepath/tor/lightning/hidden_service/hostname $TOR_DATAPATH/lightning/hidden_service/hostname 1 $SUDO_REQUIRED fi if [[ $TOR_BITCOIN == true ]]; then copy_file $cyphernodeconf_filepath/tor/bitcoin/hidden_service/hs_ed25519_secret_key $TOR_DATAPATH/bitcoin/hidden_service/hs_ed25519_secret_key 1 $SUDO_REQUIRED