diff --git a/api_auth_docker/default.conf b/api_auth_docker/default.conf
index f70291f..79955f5 100644
--- a/api_auth_docker/default.conf
+++ b/api_auth_docker/default.conf
@@ -2,8 +2,6 @@ server {
listen 443 ssl;
server_name localhost;
- #include /etc/nginx/conf.d/ip-whitelist.conf;
-
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
@@ -14,25 +12,7 @@ server {
index statuspage.html;
}
- location /sparkwallet/ {
- auth_basic "sparkwallet";
- auth_basic_user_file conf.d/status/htpasswd;
-
- proxy_set_header Host $host;
- proxy_set_header Referer $http_referer;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_set_header X-Forwarded-Host $host;
-
- # Hardcoding sparkwallet password, it's only accessible from here anyway using htpasswd above
- proxy_set_header Authorization "Basic Y3lwaGVybm9kZTpzcGFya3dhbGxldA==";
-
- # Setting upstream variable so that proxy_pass doesn't abort nginx when sparkwallet is not installed
- set $upstream http://sparkwallet:9737/;
-
- proxy_pass $upstream;
- }
+ include /etc/nginx/conf.d/nginx-spark-conf;
location /v0/ {
auth_request /auth;
diff --git a/api_auth_docker/statuspage.html b/api_auth_docker/statuspage.html
index bb60de1..3b9d555 100644
--- a/api_auth_docker/statuspage.html
+++ b/api_auth_docker/statuspage.html
@@ -48,7 +48,7 @@
diff --git a/dist/setup.sh b/dist/setup.sh
index fe36b70..e005e31 100755
--- a/dist/setup.sh
+++ b/dist/setup.sh
@@ -122,7 +122,7 @@ modify_permissions() {
}
modify_owner() {
- local directories=("$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$SPARKWALLET_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$OTSCLIENT_DATAPATH")
+ local directories=("$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH" "$OTSCLIENT_DATAPATH")
local user=$(id -u $RUN_AS_USER):$(id -g $RUN_AS_USER)
for d in "${directories[@]}"
do
@@ -387,6 +387,7 @@ install_docker() {
copy_file $current_path/gatekeeper/cert.pem $GATEKEEPER_DATAPATH/certs/cert.pem 1 $SUDO_REQUIRED
copy_file $current_path/gatekeeper/key.pem $GATEKEEPER_DATAPATH/private/key.pem 1 $SUDO_REQUIRED
copy_file $current_path/gatekeeper/htpasswd $GATEKEEPER_DATAPATH/htpasswd 1 $SUDO_REQUIRED
+ copy_file $current_path/lightning/c-lightning/nginx-spark-conf $GATEKEEPER_DATAPATH/nginx-spark-conf 1 $SUDO_REQUIRED
fi
if [ ! -d $PROXY_DATAPATH ]; then
@@ -446,7 +447,7 @@ install_docker() {
fi
if [ ! -d $LIGHTNING_DATAPATH ]; then
step " [32mcreate[0m $LIGHTNING_DATAPATH"
- sudo_if_required mkdir -p $LIGHTNING_DATAPATH
+ sudo_if_required mkdir -p $LIGHTNING_DATAPATH/sparkwallet
next
fi
if [ -d $LIGHTNING_DATAPATH ]; then
@@ -454,14 +455,6 @@ install_docker() {
copy_file $current_path/lightning/c-lightning/bitcoin.conf $LIGHTNING_DATAPATH/bitcoin.conf 1 $SUDO_REQUIRED
fi
fi
-
- if [[ $FEATURE_SPARKWALLET == true ]]; then
- if [ ! -d $SPARKWALLET_DATAPATH ]; then
- step " [32mcreate[0m $SPARKWALLET_DATAPATH"
- sudo_if_required mkdir -p $SPARKWALLET_DATAPATH
- next
- fi
- fi
fi
if [[ $FEATURE_OTSCLIENT == true ]]; then
@@ -533,7 +526,7 @@ install_docker() {
check_directory_owner() {
# if one directory does not have access rights for $RUN_AS_USER, we echo 1, else we echo 0
- local directories=("$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$SPARKWALLET_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH")
+ local directories=("$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH")
local status=0
for d in "${directories[@]}"
do
@@ -637,7 +630,7 @@ sanity_checks_pre_install() {
if [[ $sudo_reason == 'directories' ]]; then
echo " [31mor check your data volumes if they have the right owner.[0m"
echo " [31mThe owner of the following folders should be '$RUN_AS_USER':[0m"
- local directories=("$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$SPARKWALLET_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH")
+ local directories=("$BITCOIN_DATAPATH" "$LIGHTNING_DATAPATH" "$PROXY_DATAPATH" "$GATEKEEPER_DATAPATH")
local status=0
for d in "${directories[@]}"
do
diff --git a/install/generator-cyphernode/generators/app/features.json b/install/generator-cyphernode/generators/app/features.json
index c781bb1..84a1e9a 100644
--- a/install/generator-cyphernode/generators/app/features.json
+++ b/install/generator-cyphernode/generators/app/features.json
@@ -3,10 +3,6 @@
"name": "Lightning node",
"value": "lightning"
},
- {
- "name": "Spark Wallet (LN)",
- "value": "sparkwallet"
- },
{
"name": "Opentimestamps client",
"value": "otsclient"
diff --git a/install/generator-cyphernode/generators/app/help.json b/install/generator-cyphernode/generators/app/help.json
index 344ac1b..0084243 100644
--- a/install/generator-cyphernode/generators/app/help.json
+++ b/install/generator-cyphernode/generators/app/help.json
@@ -34,8 +34,6 @@
"lightning_datapath": "Path name to where LN's data files are stored. This directory will be mounted into the LN node's container. If running on OSX, check mountable directories in Docker's File Sharing configs.",
"lightning_datapath_custom": " ",
"lightning_expose": "By default, LN node port will be published outside of Docker. Do you want to hide it so that your node can't be accessed from outside of the Docker network?",
- "sparkwallet_datapath": "Path name to where sparkwallet data files are stored. This directory will be mounted into the sparkwallet container. If running on OSX, check mountable directories in Docker's File Sharing configs.",
- "sparkwallet_datapath_custom": " ",
"otsclient_datapath": "Full path where the OTS files will be stored. This path will be mounted into the otsclient container which will create the OTS files when stamping and update them when upgrading stamps. It will also be mounted to the proxy container so that it can serve the ots_getfile and send the OTS files to clients. If running on OSX, check mountable directories in Docker's File Sharing configs.",
"otsclient_datapath_custom": " ",
"installer_mode": "Only one installation mode is supported, right now: local docker (self-hosted). Choose wisely ;-)",
diff --git a/install/generator-cyphernode/generators/app/index.js b/install/generator-cyphernode/generators/app/index.js
index 5bc6e5b..da77200 100644
--- a/install/generator-cyphernode/generators/app/index.js
+++ b/install/generator-cyphernode/generators/app/index.js
@@ -365,7 +365,6 @@ module.exports = class extends Generator {
'proxy_datapath',
'bitcoin_datapath',
'lightning_datapath',
- 'sparkwallet_datapath',
'otsclient_datapath'
];
@@ -456,7 +455,6 @@ module.exports = class extends Generator {
lightning_datapath: '',
lightning_nodename: name.generate(),
lightning_nodecolor: '',
- sparkwallet_datapath: '',
otsclient_datapath: '',
installer_cleanup: false,
default_username: process.env.DEFAULT_USER || '',
diff --git a/install/generator-cyphernode/generators/app/prompters/100_lightning.js b/install/generator-cyphernode/generators/app/prompters/100_lightning.js
index fb7becb..438b5b4 100644
--- a/install/generator-cyphernode/generators/app/prompters/100_lightning.js
+++ b/install/generator-cyphernode/generators/app/prompters/100_lightning.js
@@ -17,7 +17,7 @@ const featureCondition = function(props) {
const templates = {
'lnd': [ path.join('lnd','lnd.conf') ],
- 'c-lightning': [ path.join('c-lightning','config'), path.join('c-lightning','bitcoin.conf') ]
+ 'c-lightning': [ path.join('c-lightning','config'), path.join('c-lightning','bitcoin.conf'), path.join('c-lightning','nginx-spark-conf') ]
};
module.exports = {
diff --git a/install/generator-cyphernode/generators/app/prompters/999_installer.js b/install/generator-cyphernode/generators/app/prompters/999_installer.js
index 906c2e6..24e04eb 100644
--- a/install/generator-cyphernode/generators/app/prompters/999_installer.js
+++ b/install/generator-cyphernode/generators/app/prompters/999_installer.js
@@ -182,44 +182,6 @@ module.exports = {
validate: utils._pathValidator,
message: prefix()+'Custom path for your lightning node data?'+utils._getHelp('lightning_datapath_custom'),
},
- {
- when: function(props) { return installerDocker(props) && props.features.indexOf('sparkwallet') !== -1 },
- type: 'list',
- name: 'sparkwallet_datapath',
- default: utils._getDefault( 'sparkwallet_datapath' ),
- choices: [
- {
- name: utils.setupDir+"/cyphernode/sparkwallet",
- value: utils.setupDir+"/cyphernode/sparkwallet"
- },
- {
- name: utils.defaultDataDirBase+"/cyphernode/sparkwallet",
- value: utils.defaultDataDirBase+"/cyphernode/sparkwallet"
- },
- {
- name: utils.defaultDataDirBase+"/.cyphernode/sparkwallet",
- value: utils.defaultDataDirBase+"/.cyphernode/sparkwallet"
- },
- {
- name: utils.defaultDataDirBase+"/sparkwallet",
- value: utils.defaultDataDirBase+"/sparkwallet"
- },
- {
- name: "Custom path",
- value: "_custom"
- }
- ],
- message: prefix()+'Where do you want to store your sparkwallet data?'+utils._getHelp('sparkwallet_datapath'),
- },
- {
- when: function(props) { return installerDocker(props) && props.features.indexOf('sparkwallet') !== -1 && props.sparkwallet_datapath === '_custom'},
- type: 'input',
- name: 'sparkwallet_datapath_custom',
- default: utils._getDefault( 'sparkwallet_datapath_custom' ),
- filter: utils._trimFilter,
- validate: utils._pathValidator,
- message: prefix()+'Custom path for your sparkwallet data?'+utils._getHelp('sparkwallet_datapath_custom'),
- },
{
when: function(props) { return installerDocker(props) && props.features.indexOf('otsclient') !== -1 },
type: 'list',
diff --git a/install/generator-cyphernode/generators/app/templates/installer/config.sh b/install/generator-cyphernode/generators/app/templates/installer/config.sh
index 5152ff0..a102f4b 100644
--- a/install/generator-cyphernode/generators/app/templates/installer/config.sh
+++ b/install/generator-cyphernode/generators/app/templates/installer/config.sh
@@ -1,7 +1,6 @@
INSTALLER_MODE=<%= installer_mode %>
BITCOIN_INTERNAL=<%= (bitcoin_mode==="internal"?'true':'false') %>
FEATURE_LIGHTNING=<%= (features.indexOf('lightning') != -1)?'true':'false' %>
-FEATURE_SPARKWALLET=<%= (features.indexOf('sparkwallet') != -1)?'true':'false' %>
FEATURE_OTSCLIENT=<%= (features.indexOf('otsclient') != -1)?'true':'false' %>
LIGHTNING_IMPLEMENTATION=<%= lightning_implementation %>
PROXY_DATAPATH=<%= proxy_datapath %>
@@ -11,9 +10,7 @@ RUN_AS_USER=<%= run_as_different_user?username:'' %>
CLEANUP=<%= installer_cleanup?'true':'false' %>
<% if ( features.indexOf('lightning') !== -1 && lightning_implementation === 'c-lightning' ) { %>
LIGHTNING_DATAPATH=<%= lightning_datapath %>
-<% } %>
-<% if ( features.indexOf('sparkwallet') !== -1 ) { %>
-SPARKWALLET_DATAPATH=<%= sparkwallet_datapath %>
+SPARKWALLET_DATAPATH=<%= lightning_datapath %>/sparkwallet
<% } %>
<% if ( features.indexOf('otsclient') !== -1 ) { %>
OTSCLIENT_DATAPATH=<%= otsclient_datapath %>
diff --git a/install/generator-cyphernode/generators/app/templates/installer/docker/docker-compose.yaml b/install/generator-cyphernode/generators/app/templates/installer/docker/docker-compose.yaml
index 20a0f7f..02e2233 100644
--- a/install/generator-cyphernode/generators/app/templates/installer/docker/docker-compose.yaml
+++ b/install/generator-cyphernode/generators/app/templates/installer/docker/docker-compose.yaml
@@ -17,6 +17,7 @@ services:
- "<%= gatekeeper_datapath %>/installation.json:/etc/nginx/conf.d/status/installation.json"
- "<%= gatekeeper_datapath %>/client.7z:/etc/nginx/conf.d/status/client.7z"
- "<%= gatekeeper_datapath %>/config.7z:/etc/nginx/conf.d/status/config.7z"
+ - "<%= gatekeeper_datapath %>/nginx-spark-conf:/etc/nginx/conf.d/nginx-spark-conf"
command: $USER
# deploy:
@@ -117,6 +118,16 @@ services:
networks:
- cyphernodenet
restart: always
+
+ sparkwallet:
+ command: --login "cyphernode:sparkwallet" --no-tls
+ image: shesek/spark-wallet:standalone
+ volumes:
+ - "<%= lightning_datapath %>:/etc/lightning"
+ - "<%= lightning_datapath %>/sparkwallet:/data"
+ networks:
+ - cyphernodenet
+ restart: always
<% } %>
<% if ( features.indexOf('otsclient') !== -1 ) { %>
otsclient:
@@ -150,18 +161,6 @@ services:
restart: always
<% } %>
-<% if ( features.indexOf('sparkwallet') !== -1 ) { %>
- sparkwallet:
- command: --login "cyphernode:sparkwallet" --no-tls
- image: shesek/spark-wallet:standalone
- volumes:
- - "<%= lightning_datapath %>:/etc/lightning"
- - "<%= sparkwallet_datapath %>:/data"
- networks:
- - cyphernodenet
- restart: always
-<% } %>
-
networks:
cyphernodenet:
external: true
diff --git a/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh b/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh
index 7aa6042..7d604f4 100644
--- a/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh
+++ b/install/generator-cyphernode/generators/app/templates/installer/testfeatures.sh
@@ -145,12 +145,12 @@ checkservice() {
while :
do
outcome=0
- for container in gatekeeper proxy proxycron pycoin <%= (features.indexOf('otsclient') != -1)?'otsclient ':'' %>bitcoin <%= (features.indexOf('lightning') != -1)?'lightning ':'' %> <%= (features.indexOf('sparkwallet') != -1)?'sparkwallet ':'' %>; do
+ for container in gatekeeper proxy proxycron pycoin <%= (features.indexOf('otsclient') != -1)?'otsclient ':'' %>bitcoin <%= (features.indexOf('lightning') != -1)?'lightning sparkwallet ':'' %>; do
echo -e " \e[0;32mVerifying \e[0;33m${container}\e[0;32m..." > /dev/console
(ping -c 10 ${container} 2> /dev/null | grep "0% packet loss" > /dev/null) &
eval ${container}=$!
done
- for container in gatekeeper proxy proxycron pycoin <%= (features.indexOf('otsclient') != -1)?'otsclient ':'' %>bitcoin <%= (features.indexOf('lightning') != -1)?'lightning ':'' %> <%= (features.indexOf('sparkwallet') != -1)?'sparkwallet ':'' %>; do
+ for container in gatekeeper proxy proxycron pycoin <%= (features.indexOf('otsclient') != -1)?'otsclient ':'' %>bitcoin <%= (features.indexOf('lightning') != -1)?'lightning sparkwallet ':'' %>; do
eval wait '$'${container} ; returncode=$? ; outcome=$((${outcome} + ${returncode}))
eval c_${container}=${returncode}
done
@@ -173,7 +173,7 @@ checkservice() {
# { "name": "lightning", "active":true },
# { "name": "sparkwallet", "active":true }
# ]
- for container in gatekeeper proxy proxycron pycoin <%= (features.indexOf('otsclient') != -1)?'otsclient ':'' %>bitcoin <%= (features.indexOf('lightning') != -1)?'lightning ':'' %> <%= (features.indexOf('sparkwallet') != -1)?'sparkwallet ':'' %>; do
+ for container in gatekeeper proxy proxycron pycoin <%= (features.indexOf('otsclient') != -1)?'otsclient ':'' %>bitcoin <%= (features.indexOf('lightning') != -1)?'lightning sparkwallet ':'' %>; do
[ -n "${result}" ] && result="${result},"
result="${result}{\"name\":\"${container}\",\"active\":"
eval "returncode=\$c_${container}"
@@ -330,9 +330,7 @@ else
fi
finalreturncode=$((${returncode} | ${finalreturncode}))
result="${result}$(feature_status ${returncode} 'Lightning error!')}"
-<% } %>
-<% if (features.indexOf('sparkwallet') != -1) { %>
result="${result},{\"name\":\"sparkwallet\",\"working\":"
status=$(echo "{${containers}}" | jq ".containers[] | select(.name == \"sparkwallet\") | .active")
if [[ "${brokenproxy}" != "true" && "${status}" = "true" ]]; then
diff --git a/install/generator-cyphernode/generators/app/templates/lightning/c-lightning/nginx-spark-conf b/install/generator-cyphernode/generators/app/templates/lightning/c-lightning/nginx-spark-conf
new file mode 100644
index 0000000..7de9208
--- /dev/null
+++ b/install/generator-cyphernode/generators/app/templates/lightning/c-lightning/nginx-spark-conf
@@ -0,0 +1,18 @@
+<% if ( features.indexOf('lightning') !== -1 && lightning_implementation === 'c-lightning' ) { %>
+location /sparkwallet/ {
+ auth_basic "sparkwallet";
+ auth_basic_user_file conf.d/status/htpasswd;
+
+ proxy_set_header Host $host;
+ proxy_set_header Referer $http_referer;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-Host $host;
+
+ # Hardcoding sparkwallet password, it's only accessible from here anyway using htpasswd above
+ proxy_set_header Authorization "Basic Y3lwaGVybm9kZTpzcGFya3dhbGxldA==";
+
+ proxy_pass http://sparkwallet:9737/;
+}
+<% } %>