Multi onion addresses fixes

This commit is contained in:
kexkey
2020-01-17 15:56:07 -05:00
committed by kexkey
parent 08edca726e
commit 759856ee17
7 changed files with 27 additions and 17 deletions

View File

@@ -275,9 +275,16 @@ module.exports = class App {
// Tor...
if( this.isChecked( 'features', 'tor' ) ) {
const torgen = new TorGen();
this.sessionData.tor_traefik_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/traefik/hidden_service' ) ));
this.sessionData.tor_ln_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/ln/hidden_service' ) ));
this.sessionData.tor_bitcoin_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/bitcoin/hidden_service' ) ));
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_bitcoin')) {
this.sessionData.tor_bitcoin_hostname = await torgen.generateTorFiles(this.destinationPath( path.join( destinationDirName, 'tor/bitcoin/hidden_service' ) ));
}
}
// creates keys if they don't exist or we say so.

View File

@@ -204,7 +204,7 @@
"$id": "#/properties/torifyables/items",
"type": "string",
"enum": [
"tor_hiddenservice",
"tor_traefik",
"tor_bitcoin",
"tor_ln",
"tor_otsoperations",
@@ -215,7 +215,7 @@
"title": "The Torified feature",
"default": "",
"examples": [
"tor_hiddenservice",
"tor_traefik",
"tor_bitcoin",
"tor_l",
"tor_otsoperations",

View File

@@ -13,6 +13,7 @@ TOR_DATAPATH=<%= tor_datapath %>
TOR_OTS_WEBHOOKS=<%= (torifyables.indexOf('tor_otswebhooks') != -1)?'true':'false' %>
TOR_ADDR_WATCH_WEBHOOKS=<%= (torifyables.indexOf('tor_addrwatcheswebhooks') != -1)?'true':'false' %>
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' %>
<% } %>

View File

@@ -79,7 +79,7 @@ fi
printf "\r\n\033[0;92mDepending on your current location and DNS settings, point your favorite browser to one of the following URLs to access Cyphernode's status page:\r\n"
printf "\r\n"
printf "\033[0;95m<% cns.forEach(cn => { %><%= ('https://' + cn + ':' + traefik_https_port + '/welcome\\r\\n') %><% }) %>\033[0m\r\n"
<% if ( features.indexOf('tor') !== -1 ) { %>
<% if ( torifyables.indexOf('tor_traefik') !== -1 ) { %>
printf "\033[0;92mYou can also use Tor Browser and navigate to your onion address:\r\n"
printf "\033[0;95mhttps://${TOR_TRAEFIK_HOSTNAME}:<%= traefik_https_port %>/welcome\033[0m\r\n\r\n"
<% } %>

View File

@@ -1,21 +1,21 @@
<% if ( torifyables.indexOf('tor_hiddenservice') !== -1 ) { %>
<% if ( torifyables.indexOf('tor_traefik') !== -1 ) { %>
HiddenServiceDir /tor/traefik/hidden_service/
HiddenServiceVersion 3
HiddenServicePort <%= traefik_http_port %> traefik:<%= traefik_http_port %>
HiddenServicePort <%= traefik_https_port %> traefik:<%= traefik_https_port %>
<% if ( torifyables.indexOf('tor_ln') !== -1 && lightning_expose ) { %>
<% } %>
<% if ( torifyables.indexOf('tor_ln') !== -1 && lightning_expose ) { %>
HiddenServiceDir /tor/ln/hidden_service/
HiddenServiceVersion 3
HiddenServicePort 9735 lightning:9735
<% } %>
<% if ( torifyables.indexOf('tor_bitcoin') !== -1 && bitcoin_expose) { %>
<% if ( torifyables.indexOf('tor_bitcoin') !== -1 && bitcoin_expose) { %>
HiddenServiceDir /tor/bitcoin/hidden_service/
HiddenServiceVersion 3
HiddenServicePort 8333 bitcoin:8333
<% } %>
<% } %>
SocksPort 0.0.0.0:9050
ExitPolicy reject *:* # no exits allowed

View File

@@ -1,7 +1,7 @@
[
{
"name": "Cyphernode as Hidden Service",
"value": "tor_hiddenservice"
"name": "Traefik web proxy",
"value": "tor_traefik"
},
{
"name": "Bitcoin Node",

12
dist/setup.sh vendored
View File

@@ -405,11 +405,13 @@ install_docker() {
sudo_if_required chmod 700 $TOR_DATAPATH
next
fi
if [ ! -d $TOR_DATAPATH/traefik ]; then
step " create $TOR_DATAPATH/traefik"
sudo_if_required mkdir -p $TOR_DATAPATH/traefik/hidden_service
sudo_if_required chmod 700 $TOR_DATAPATH/traefik/hidden_service
next
if [[ $TOR_TRAEFIK == true ]]; then
if [ ! -d $TOR_DATAPATH/traefik ]; then
step " create $TOR_DATAPATH/traefik"
sudo_if_required mkdir -p $TOR_DATAPATH/traefik/hidden_service
sudo_if_required chmod 700 $TOR_DATAPATH/traefik/hidden_service
next
fi
fi
if [[ $TOR_LN == true ]]; then
if [ ! -d $TOR_DATAPATH/ln ]; then