TOR first, fixed when OFF, small tweaks

This commit is contained in:
kexkey
2019-11-08 16:50:54 -05:00
committed by kexkey
parent 58b80e1d3b
commit 96f6301282
8 changed files with 43 additions and 36 deletions

View File

@@ -1,4 +1,8 @@
[
{
"name": "TOR Hidden Service/Gateway",
"value": "tor"
},
{
"name": "Lightning node",
"value": "lightning"
@@ -6,9 +10,5 @@
{
"name": "Opentimestamps client",
"value": "otsclient"
},
{
"name": "Tor Hidden Service/Gateway",
"value": "tor"
}
]

View File

@@ -474,9 +474,11 @@ module.exports = class App {
}
},
otsclient: {
networks: ['cyphernodenet'],
docker: "cyphernode/otsclient:" + this.config.docker_versions['cyphernode/otsclient']
},
lightning: {
networks: ['cyphernodenet'],
docker: "cyphernode/clightning:"+this.config.docker_versions['cyphernode/clightning'],
extra: {
nodename: this.config.data.lightning_nodename,
@@ -494,7 +496,7 @@ module.exports = class App {
name: feature.name,
label: feature.value,
host: feature.value,
networks: ['cyphernodenet'],
networks: optional_features_data[feature.value].networks,
docker: optional_features_data[feature.value].docker
};

View File

@@ -98,13 +98,13 @@ module.exports = {
message: prefix()+'Where do you want to store your tor data?'+utils.getHelp('tor_datapath'),
},
{
when: (props)=>{ return installerDocker(props) && props.features.indexOf('tor') !== -1 && props.otsclient_datapath === '_custom' },
when: (props)=>{ return installerDocker(props) && props.features.indexOf('tor') !== -1 && props.tor_datapath === '_custom' },
type: 'input',
name: 'tor_datapath_custom',
default: utils.getDefault( 'tor_datapath_custom' ),
filter: utils.trimFilter,
validate: utils.pathValidator,
message: prefix()+'Custom path for tor data?'+utils.getHelp('tor_datapath_custom'),
message: prefix()+'Custom path for TOR data?'+utils.getHelp('tor_datapath_custom'),
},
{
when: installerDocker,

View File

@@ -85,6 +85,24 @@
]
}
},
{
"if": {
"properties": {
"features": {
"contains": {
"enum": [
"tor"
]
}
}
}
},
"then": {
"required": [
"tor_datapath"
]
}
},
{
"if": {
"properties": {
@@ -125,24 +143,6 @@
"otsclient_datapath"
]
}
},
{
"if": {
"properties": {
"features": {
"contains": {
"enum": [
"tor"
]
}
}
}
},
"then": {
"required": [
"tor_datapath"
]
}
}
],
"properties": {
@@ -180,16 +180,16 @@
"$id": "#/properties/features/items",
"type": "string",
"enum": [
"tor",
"lightning",
"otsclient",
"tor"
"otsclient"
],
"title": "The feature",
"default": "",
"examples": [
"tor",
"lightning",
"otsclient",
"tor"
"otsclient"
]
}
},

View File

@@ -122,8 +122,10 @@ services:
notifier:
image: cyphernode/notifier:<%= notifier_version %>
command: $USER ./startnotifier.sh
<% if ( features.indexOf('tor') !== -1 ) { %>
volumes:
- "<%= tor_datapath %>/curlcfg:/notifier/curlcfg"
<% } %>
networks:
- cyphernodenet
- cyphernodeappsnet
@@ -246,8 +248,6 @@ services:
tor:
image: cyphernode/tor:<%= tor_version %>
command: $USER sh -c 'export HOME=/tor && tor -f /tor/torrc'
depends_on:
- traefik
volumes:
- "<%= tor_datapath %>:/tor"
restart: always

View File

@@ -3,9 +3,9 @@
"setup_version": "setup_version",
"docker_versions": {},
"features": [
"tor",
"lightning",
"otsclient",
"tor"
"otsclient"
],
"net": "testnet",
"use_xpub": true,

View File

@@ -56,7 +56,8 @@ curl_it() {
local response
local rnd=$(dd if=/dev/urandom bs=5 count=1 | xxd -pc 5)
if [ "${torbypass}" = "true" ]; then
if [ "${torbypass}" = "true" ] || [ ! -f "curlcfg" ]; then
# If we want to bypass tor or the config file doesn't exist
torbypass=""
else
torbypass="-K curlcfg"

View File

@@ -79,8 +79,12 @@ main() {
installation_info)
# GET http://192.168.111.152:8080/info
if [ -f "$DB_PATH/info.json" ]; then
# Replace tor_hostname_placeholder with actual tor hostname from tor file
response=$(sed "s/tor_hostname_placeholder/`tr -d '\n\r' < tor/hidden_service/hostname`/g" "$DB_PATH/info.json")
if [ -f "tor/hidden_service/hostname" ]; then
# Replace tor_hostname_placeholder with actual tor hostname from tor file
response=$(sed "s/tor_hostname_placeholder/`tr -d '\n\r' < tor/hidden_service/hostname`/g" "$DB_PATH/info.json")
else
response=$(cat "$DB_PATH/info.json")
fi
else
response='{ "error": "missing installation data" }'
fi