From bc251cc899341e5c55166e660d94621ec4b51350 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 12 Nov 2020 10:55:35 -0800 Subject: [PATCH] docs --- README.md | 1 - docs/docker_deployment.md | 3 +- docs/myNode_deployment.md | 58 +++++++---------------------------- docs/raspiblitz_deployment.md | 29 +++--------------- 4 files changed, 17 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 12b32f0..75868cd 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,6 @@ To connect your Desktop Sphinx to your Relay: - restart the Relay machine; - connect as `admin`; - switch to user `bitcoin` with `sudo su bitcoin`; -- make sure `NODE_IP` environment variable contains correct `:` values, `export` again if necessary; - `cd ~/sphinx-relay; npm run prod` Then try again. diff --git a/docs/docker_deployment.md b/docs/docker_deployment.md index d5bc34d..da96eb9 100644 --- a/docs/docker_deployment.md +++ b/docs/docker_deployment.md @@ -68,8 +68,7 @@ Edit the "production" section of config/config.json - Update "storage" to point to where you want your DB file to live To connect to your app - - `export NODE_IP=x.x.x.x` (you can use a domain name instead if you have that set up) - - For extra security, `export USE_PASSWORD=true` + - edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name ### run diff --git a/docs/myNode_deployment.md b/docs/myNode_deployment.md index 331d29a..c41d36f 100644 --- a/docs/myNode_deployment.md +++ b/docs/myNode_deployment.md @@ -19,7 +19,7 @@ python2 (if not present): `$ sudo apt install python2` ### Open port 53001 on myNode -**note**: Port 3001 is now taken by one of myNode apps. In this document we use port 53001, but this port can be whatever number you want. Just add PORT to your environment like `export PORT=55005`. +**note**: Port 3001 is now taken by one of myNode apps. In this document we use port 53001, but this port can be whatever number you want. Just edit the `node_http_port` setting in config/app.json Open up a console window with SSH. And login as root ```sh @@ -65,7 +65,9 @@ Change the following 4 lines: "macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", "tls_location": "/mnt/hdd/mynode/lnd/tls.cert", "lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", -``` +``` + +Edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name Save and exit: `Ctrl + X` @@ -91,12 +93,8 @@ Save and exit: #### If you want to use your Sphinx client within the same local network -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:3001 -``` -where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network. +Edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name + **note:** Sphinx client uses HTTP to communicate with **sphinx-relay**. Since setting up SSL on a local network is problematic (you don't have any domain names to authenticate with certificates), you have to rely on your local network security. Below is an example of how Sphinx/sphinx-relay communications look like in **tcpdump**: @@ -110,19 +108,11 @@ where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay **note:** it is recommended to use SSL encryption for any communications between **Sphinx** and **sphinx-relay** outside of a trusted network. [**Docker deployment guide**](docs/docker-deployment.md) sets up SSL encryption for you automatically, you only have to obtain your domain and certificates. If you still want to set up **sphinx-relay** manually, the instructions to set up the SSL are below. -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:53001 -``` -where `x.x.x.x` is the permanent public IP address of your router. +Edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name Make sure that port 53001 forwarding is properly set up. -For extra security: -```sh -$ export USE_PASSWORD=true -``` + As noted in the previous section, you might want to protect communications between your Sphinx client and **sphinx-relay** with SSL. In order to do that, obtain a domain and an SSL certificate for your **sphinx-relay** server and set up a reverse proxy with NGINX (or a more lightweight alternative). @@ -259,23 +249,7 @@ Save and exit: `Enter` -Now we have to set the environment variables `PORT` and `NODE_IP` for the new `sphinx-relay.service`: - -`sudo systemctl edit sphinx-relay` - -This opens `nano` editor with an empty configuration file that you should type the following text into: - -``` -[Service] -Environment="PORT=53001" -Environment="NODE_IP=x.x.x.x:53001" -``` -Save and exit: -`Ctrl + X` - -`Y` - -`Enter` +Edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name. Let's run! ```sh @@ -370,21 +344,11 @@ Save and exit: #### If you want to use your Sphinx client within the same local network -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:53001 -``` -where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network. +Edit the `public_url` in config/app.json to equal the local IP address of your node #### If you want to connect to your Sphinx-Relay from outside of your local network -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:53001 -``` -where `x.x.x.x` is the permanent public IP address of your router. +Edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name > Make sure that port 53001 forwarding is properly set up. diff --git a/docs/raspiblitz_deployment.md b/docs/raspiblitz_deployment.md index 94b9a96..e0f63ab 100644 --- a/docs/raspiblitz_deployment.md +++ b/docs/raspiblitz_deployment.md @@ -19,7 +19,7 @@ python2 (if not present): `$ sudo apt install python2` ### Open port 3001 on Raspiblitz -**note**: This port can be whatever number you want. Just add PORT to your environment like `export PORT=5005`. +**note**: This port can be whatever number you want. You can edit it in config/app.json in the `node_http_port` setting Open up a console window with SSH. And log in as root ```sh @@ -90,12 +90,7 @@ Save and exit: #### If you want to use your Sphinx client within the same local network -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:3001 -``` -where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network. +Edit the `public_url` in config/app.json to equal your local IP **note:** Sphinx client uses HTTP to communicate with **sphinx-relay**. Since setting up SSL on a local network is problematic (you don't have any domain names to authenticate with certificates), you have to rely on your local network security. Below is an example of how Sphinx/sphinx-relay communications look like in **tcpdump**: @@ -109,12 +104,7 @@ where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay **note:** it is recommended to use SSL encryption for any communications between **Sphinx** and **sphinx-relay** outside of a trusted network. [**Docker deployment guide**](docs/docker-deployment.md) sets up SSL encryption for you automatically, you only have to obtain your domain and certificates. If you still want to set up **sphinx-relay** manually, the instructions to set up the SSL are below. -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:3001 -``` -where `x.x.x.x` is the permanent public IP address of your router. +Edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name Make sure that port 3001 forwarding is properly set up. @@ -325,6 +315,8 @@ Change the following 4 lines: "lncli_location": "/home/bitcoin/go/bin", ``` +Also edit the `public_url` in config/app.json to equal your public IP or fully qualified domain name + Save and exit: `Ctrl + X` @@ -347,17 +339,6 @@ Save and exit: `Enter` -To connect to your app: -(replace x.x.x.x with your IP - NOTE: This is your external IP) -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:3001 -``` -For extra security: -```sh -$ export USE_PASSWORD=true -``` ### Turn on the service. Login as admin. ```sh