From 315acac63c2a513b70bbc2984d9a0b7f56fd3450 Mon Sep 17 00:00:00 2001 From: BT Date: Tue, 18 Aug 2020 10:05:18 +0700 Subject: [PATCH 1/2] Add RPCUSER as a default username --- switch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/switch.sh b/switch.sh index 50a88cc..54018a7 100755 --- a/switch.sh +++ b/switch.sh @@ -15,6 +15,7 @@ # Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up) +RPCUSER="${RPCUSER:-lncm}" # Default Username: lncm RPCPASS="${RPCPASS:-$(cat /secrets/rpcpass.txt)}" # Default password location: /secrets/rpcpass.txt SLEEPTIME="${SLEEPTIME:-3600}" # Default sleep: 3600 JSONRPCURL="${JSONRPCURL:-http://10.254.2.2:8332}" # Default RPC endpoint: http://10.254.2.2:8332 @@ -38,7 +39,7 @@ switch_on_sync_done() { echo 'If set to neutrino then lets check bitcoind' - if ! INFO="$(curl --silent --user "lncm:$RPCPASS" --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' "$JSONRPCURL")"; then + if ! INFO="$(curl --silent --user "$RPCUSER:$RPCPASS" --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' "$JSONRPCURL")"; then echo "Error: 'getblockchaininfo' request to bitcoind failed" return fi From 65c253504793964bfa429613fe99633417283263 Mon Sep 17 00:00:00 2001 From: BT Date: Tue, 18 Aug 2020 10:06:34 +0700 Subject: [PATCH 2/2] Update readme to reflect changes --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index eff6da6..724d84d 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ You may map these anywhere in your filesystem. For best results works best with Other than that everything should be in the default paths. +- RPCUSER (default: lncm) - RPCPASS (default: whatever is set in /secrets/rpcpass.txt .) - If we set this, we do not need to link rpcpass.txt (this is generated by configure-box.sh by [the box configure script](https://github.com/lncm/thebox-compose-system/blob/master/configure-box.sh)) - JSONRPCURL (Default: http://10.254.2.2:8332) : Is the JSON-RPC interface for bitcoind - LND_CONTAINER_NAME (Default: lnd) : is the container name to restart