Browse Source

documentation/logging improvements for rpc cookie usage

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
75eca79daa
  1. 1
      .env-sample
  2. 2
      app/config.js

1
.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

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

Loading…
Cancel
Save