From 05849114038980869921ced4120720aac42edda5 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 18 Sep 2019 14:22:39 -0700 Subject: [PATCH 1/2] fix rand pw length value --- bitcoind.run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoind.run b/bitcoind.run index 8f0abd3..85b6b78 100644 --- a/bitcoind.run +++ b/bitcoind.run @@ -3,7 +3,7 @@ export HOME="/var/lib/bitcoind" # gen random pw for rpc server -RANDOMPW=$(openssl rand -hex 20) +RANDOMPW=$(openssl rand -hex 10) cat < $HOME/bitcoin.conf rpcuser=${BITCOIND_RPCUSER:-rpcuser} From 9238db09556a45477c6d78e6a2703b87307af75e Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 18 Sep 2019 14:23:32 -0700 Subject: [PATCH 2/2] dont overwrite existing config --- bitcoind.run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitcoind.run b/bitcoind.run index 85b6b78..87924df 100644 --- a/bitcoind.run +++ b/bitcoind.run @@ -5,10 +5,12 @@ export HOME="/var/lib/bitcoind" # gen random pw for rpc server RANDOMPW=$(openssl rand -hex 10) +if [[ ! -e $HOME/bitcoin.conf ]]; then cat < $HOME/bitcoin.conf rpcuser=${BITCOIND_RPCUSER:-rpcuser} rpcpassword=${BITCOIND_RPCPASSWORD:-$RANDOMPW} EOF +fi # SECURITY this puts the rpc password into the container log cat $HOME/bitcoin.conf