bitcoind: clarify how bitcoin-cli RPC access is enabled

It's not immediately clear why rpcuser/rpcpassword are needed in addition to the rpcauth
config entries.
This commit is contained in:
Erik Arvstedt 2020-08-26 21:15:35 +02:00
parent 4790c601a1
commit 1408403dec
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -38,8 +38,6 @@ let
}
${lib.concatMapStrings (rpcbind: "rpcbind=${rpcbind}\n") cfg.rpcbind}
${lib.concatMapStrings (rpcallowip: "rpcallowip=${rpcallowip}\n") cfg.rpcallowip}
# Credentials for bitcoin-cli
rpcuser=${cfg.rpc.users.privileged.name}
# Wallet options
${optionalString (cfg.addresstype != null) "addresstype=${cfg.addresstype}"}
@ -325,7 +323,8 @@ in {
cfg=$(
cat ${configFile};
${extraRpcauth}
printf "rpcpassword="; cat "${secretsDir}/bitcoin-rpcpassword-privileged";
${/* Enable bitcoin-cli for group 'bitcoin' */ ""}
printf "rpcuser=${cfg.rpc.users.privileged.name}\nrpcpassword="; cat "${secretsDir}/bitcoin-rpcpassword-privileged";
)
confFile='${cfg.dataDir}/bitcoin.conf'
if [[ ! -e $confFile || $cfg != $(cat $confFile) ]]; then