From 0c908a53b6c37df6967560182ae3146d25ac7525 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 18 Sep 2019 13:27:48 -0700 Subject: [PATCH 1/3] update readme --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 2884761..0faeccb 100644 --- a/README.markdown +++ b/README.markdown @@ -20,4 +20,4 @@ generated) to the logs on startup. # Versions * sneak/bitcoind:latest -> bitcoind master -* sneak/bitcoind:0.12.0 -> bitcoind v0.12.0 +* sneak/bitcoind:v0.18.1 -> bitcoind v0.18.1 From eaa7b8b6ffbd33d5571233917e2ad2ae98749e75 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 18 Sep 2019 13:49:56 -0700 Subject: [PATCH 2/3] replace shasum so random pw gets created --- Dockerfile | 2 ++ README.markdown | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/Dockerfile b/Dockerfile index 90960de..9930bd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,12 +21,14 @@ RUN \ libboost-system-dev \ libboost-test-dev \ libboost-thread-dev \ + libdigest-sha-perl \ libevent-dev \ libminiupnpc-dev \ libssl-dev \ libtool \ libzmq3-dev \ libzmq5 \ + perl \ pkg-config \ && \ apt-get clean && \ diff --git a/README.markdown b/README.markdown index 0faeccb..a882428 100644 --- a/README.markdown +++ b/README.markdown @@ -17,7 +17,26 @@ This outputs the config file, including the rpc user password (either from `BITCOIND_RPCPASSWORD` or randomly generated) to the logs on startup. +# Security + +This container logs the rpc password into the container's logfiles. + # Versions * sneak/bitcoind:latest -> bitcoind master * sneak/bitcoind:v0.18.1 -> bitcoind v0.18.1 + +# Usage + +``` +docker run \ + --name bitcoind \ + -v /storage/bitcoin/bitcoind:/var/lib/bitcoind \ + --env BITCOIND_RPCUSER=username \ + --env BITCOIND_RPCPASSWORD=supersecret \ + -p 8333:8333 \ + -p 8332:8332 \ + -d sneak/bitcoind:v0.18.1 + +docker logs -f bitcoind +``` From b9482d0aaf5f7332409f0b7f9f1071eabec77ae2 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 18 Sep 2019 13:52:17 -0700 Subject: [PATCH 3/3] improved random pw generation, no external package --- Dockerfile | 2 -- bitcoind.run | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9930bd0..90960de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,14 +21,12 @@ RUN \ libboost-system-dev \ libboost-test-dev \ libboost-thread-dev \ - libdigest-sha-perl \ libevent-dev \ libminiupnpc-dev \ libssl-dev \ libtool \ libzmq3-dev \ libzmq5 \ - perl \ pkg-config \ && \ apt-get clean && \ diff --git a/bitcoind.run b/bitcoind.run index 745a38d..640ba46 100644 --- a/bitcoind.run +++ b/bitcoind.run @@ -3,7 +3,7 @@ export HOME="/var/lib/bitcoind" # gen random pw for rpc server -RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20) +RANDOMPW=$(tr -dc 'a-f0-9' < /dev/urandom | head -c20) cat < $HOME/bitcoin.conf rpcuser=${BITCOIND_RPCUSER:-rpcuser}