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) {