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",
|
"name": "Lightning node",
|
||||||
"value": "lightning"
|
"value": "lightning"
|
||||||
@@ -6,9 +10,5 @@
|
|||||||
{
|
{
|
||||||
"name": "Opentimestamps client",
|
"name": "Opentimestamps client",
|
||||||
"value": "otsclient"
|
"value": "otsclient"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tor Hidden Service/Gateway",
|
|
||||||
"value": "tor"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -474,9 +474,11 @@ module.exports = class App {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
otsclient: {
|
otsclient: {
|
||||||
|
networks: ['cyphernodenet'],
|
||||||
docker: "cyphernode/otsclient:" + this.config.docker_versions['cyphernode/otsclient']
|
docker: "cyphernode/otsclient:" + this.config.docker_versions['cyphernode/otsclient']
|
||||||
},
|
},
|
||||||
lightning: {
|
lightning: {
|
||||||
|
networks: ['cyphernodenet'],
|
||||||
docker: "cyphernode/clightning:"+this.config.docker_versions['cyphernode/clightning'],
|
docker: "cyphernode/clightning:"+this.config.docker_versions['cyphernode/clightning'],
|
||||||
extra: {
|
extra: {
|
||||||
nodename: this.config.data.lightning_nodename,
|
nodename: this.config.data.lightning_nodename,
|
||||||
@@ -494,7 +496,7 @@ module.exports = class App {
|
|||||||
name: feature.name,
|
name: feature.name,
|
||||||
label: feature.value,
|
label: feature.value,
|
||||||
host: feature.value,
|
host: feature.value,
|
||||||
networks: ['cyphernodenet'],
|
networks: optional_features_data[feature.value].networks,
|
||||||
docker: optional_features_data[feature.value].docker
|
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'),
|
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',
|
type: 'input',
|
||||||
name: 'tor_datapath_custom',
|
name: 'tor_datapath_custom',
|
||||||
default: utils.getDefault( 'tor_datapath_custom' ),
|
default: utils.getDefault( 'tor_datapath_custom' ),
|
||||||
filter: utils.trimFilter,
|
filter: utils.trimFilter,
|
||||||
validate: utils.pathValidator,
|
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,
|
when: installerDocker,
|
||||||
|
|||||||
@@ -85,6 +85,24 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"if": {
|
||||||
|
"properties": {
|
||||||
|
"features": {
|
||||||
|
"contains": {
|
||||||
|
"enum": [
|
||||||
|
"tor"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"then": {
|
||||||
|
"required": [
|
||||||
|
"tor_datapath"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"if": {
|
"if": {
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -125,24 +143,6 @@
|
|||||||
"otsclient_datapath"
|
"otsclient_datapath"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"if": {
|
|
||||||
"properties": {
|
|
||||||
"features": {
|
|
||||||
"contains": {
|
|
||||||
"enum": [
|
|
||||||
"tor"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"then": {
|
|
||||||
"required": [
|
|
||||||
"tor_datapath"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -180,16 +180,16 @@
|
|||||||
"$id": "#/properties/features/items",
|
"$id": "#/properties/features/items",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"tor",
|
||||||
"lightning",
|
"lightning",
|
||||||
"otsclient",
|
"otsclient"
|
||||||
"tor"
|
|
||||||
],
|
],
|
||||||
"title": "The feature",
|
"title": "The feature",
|
||||||
"default": "",
|
"default": "",
|
||||||
"examples": [
|
"examples": [
|
||||||
|
"tor",
|
||||||
"lightning",
|
"lightning",
|
||||||
"otsclient",
|
"otsclient"
|
||||||
"tor"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -122,8 +122,10 @@ services:
|
|||||||
notifier:
|
notifier:
|
||||||
image: cyphernode/notifier:<%= notifier_version %>
|
image: cyphernode/notifier:<%= notifier_version %>
|
||||||
command: $USER ./startnotifier.sh
|
command: $USER ./startnotifier.sh
|
||||||
|
<% if ( features.indexOf('tor') !== -1 ) { %>
|
||||||
volumes:
|
volumes:
|
||||||
- "<%= tor_datapath %>/curlcfg:/notifier/curlcfg"
|
- "<%= tor_datapath %>/curlcfg:/notifier/curlcfg"
|
||||||
|
<% } %>
|
||||||
networks:
|
networks:
|
||||||
- cyphernodenet
|
- cyphernodenet
|
||||||
- cyphernodeappsnet
|
- cyphernodeappsnet
|
||||||
@@ -246,8 +248,6 @@ services:
|
|||||||
tor:
|
tor:
|
||||||
image: cyphernode/tor:<%= tor_version %>
|
image: cyphernode/tor:<%= tor_version %>
|
||||||
command: $USER sh -c 'export HOME=/tor && tor -f /tor/torrc'
|
command: $USER sh -c 'export HOME=/tor && tor -f /tor/torrc'
|
||||||
depends_on:
|
|
||||||
- traefik
|
|
||||||
volumes:
|
volumes:
|
||||||
- "<%= tor_datapath %>:/tor"
|
- "<%= tor_datapath %>:/tor"
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
"setup_version": "setup_version",
|
"setup_version": "setup_version",
|
||||||
"docker_versions": {},
|
"docker_versions": {},
|
||||||
"features": [
|
"features": [
|
||||||
|
"tor",
|
||||||
"lightning",
|
"lightning",
|
||||||
"otsclient",
|
"otsclient"
|
||||||
"tor"
|
|
||||||
],
|
],
|
||||||
"net": "testnet",
|
"net": "testnet",
|
||||||
"use_xpub": true,
|
"use_xpub": true,
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ curl_it() {
|
|||||||
local response
|
local response
|
||||||
local rnd=$(dd if=/dev/urandom bs=5 count=1 | xxd -pc 5)
|
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=""
|
torbypass=""
|
||||||
else
|
else
|
||||||
torbypass="-K curlcfg"
|
torbypass="-K curlcfg"
|
||||||
|
|||||||
@@ -79,8 +79,12 @@ main() {
|
|||||||
installation_info)
|
installation_info)
|
||||||
# GET http://192.168.111.152:8080/info
|
# GET http://192.168.111.152:8080/info
|
||||||
if [ -f "$DB_PATH/info.json" ]; then
|
if [ -f "$DB_PATH/info.json" ]; then
|
||||||
# Replace tor_hostname_placeholder with actual tor hostname from tor file
|
if [ -f "tor/hidden_service/hostname" ]; then
|
||||||
response=$(sed "s/tor_hostname_placeholder/`tr -d '\n\r' < tor/hidden_service/hostname`/g" "$DB_PATH/info.json")
|
# 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
|
else
|
||||||
response='{ "error": "missing installation data" }'
|
response='{ "error": "missing installation data" }'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user