From 75eca79daa073da45d87034732b033aea440aa88 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Thu, 7 Feb 2019 15:07:17 -0500 Subject: [PATCH] documentation/logging improvements for rpc cookie usage --- .env-sample | 1 + app/config.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.env-sample b/.env-sample index 2ee997b..60b5758 100644 --- a/.env-sample +++ b/.env-sample @@ -10,6 +10,7 @@ #BTCEXP_BITCOIND_PORT = 8332 #BTCEXP_BITCOIND_USER = rpcusername #BTCEXP_BITCOIND_PASS = rpcpassword +#BTCEXP_BITCOIND_COOKIE = /path/to/bitcoind/.cookie # Optional ElectrumX Servers, used to display address transaction histories # Ref: https://uasf.saltylemon.org/electrum diff --git a/app/config.js b/app/config.js index 9776c85..6b1dbaa 100644 --- a/app/config.js +++ b/app/config.js @@ -10,6 +10,8 @@ var currentCoin = process.env.BTCEXP_COIN || "BTC"; var rpcCred = credentials.rpc; if (rpcCred.cookie && !rpcCred.username && !rpcCred.password && fs.existsSync(rpcCred.cookie)) { + console.log(`Loading RPC cookie file: ${rpcCred.cookie}`); + [ rpcCred.username, rpcCred.password ] = fs.readFileSync(rpcCred.cookie).toString().split(':', 2); if (!rpcCred.password) {