mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 21:25:06 +01:00
TOR first, fixed when OFF, small tweaks
This commit is contained in:
@@ -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"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"setup_version": "setup_version",
|
||||
"docker_versions": {},
|
||||
"features": [
|
||||
"tor",
|
||||
"lightning",
|
||||
"otsclient",
|
||||
"tor"
|
||||
"otsclient"
|
||||
],
|
||||
"net": "testnet",
|
||||
"use_xpub": true,
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -79,8 +79,12 @@ main() {
|
||||
installation_info)
|
||||
# GET http://192.168.111.152:8080/info
|
||||
if [ -f "$DB_PATH/info.json" ]; then
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user