Only store wallet in encrypted dir

Storing all chain data in encfs caused unsolvable issues with leveldb.
So now we're only storing wallet data in the encrypted dir.
This commit is contained in:
Basti 2020-08-17 16:46:59 +02:00
parent d65363f964
commit b0daa3d463
Signed by untrusted user: basti
GPG Key ID: 9F88009D31D99C72
2 changed files with 20 additions and 13 deletions

View File

@ -3,7 +3,8 @@ node.default['bitcoin']['checksum'] = '4bbd62fd6acfa5e9864ebf37a24a04bc2dcfe3e3
node.default['bitcoin']['username'] = 'satoshi'
node.default['bitcoin']['usergroup'] = 'bitcoin'
node.default['bitcoin']['network'] = 'mainnet'
node.default['bitcoin']['datadir'] = '/mnt/data/bitcoin'
node.default['bitcoin']['datadir'] = '/home/satoshi/.bitcoin'
node.default['bitcoin']['walletdir'] = '/mnt/data/bitcoin'
node.default['bitcoin']['conf'] = {
irc: 1,

View File

@ -72,6 +72,7 @@ end
bitcoin_user = node['bitcoin']['username']
bitcoin_group = node['bitcoin']['usergroup']
bitcoin_datadir = node['bitcoin']['datadir']
bitcoin_walletdir = node['bitcoin']['walletdir']
credentials = Chef::EncryptedDataBagItem.load('credentials', 'bitcoin')
group bitcoin_group
@ -82,20 +83,25 @@ user bitcoin_user do
shell "/bin/bash"
end
directory bitcoin_datadir do
[bitcoin_datadir, bitcoin_walletdir].each do |path|
directory path do
owner bitcoin_user
group bitcoin_group
mode '0750'
recursive true
action :create
end
end
config = node['bitcoin']['conf'].merge({
rpcpassword: credentials["rpcpassword"]
})
template "#{bitcoin_datadir}/bitcoin.conf" do
owner bitcoin_user
group bitcoin_group
mode '0640'
# TODO Create new in data bag and use here
variables conf: node['bitcoin']['conf'].merge({rpcpassword: credentials["rpcpassword"]}),
variables conf: config,
mainnet_conf: node['bitcoin']['mainnet_conf'],
testnet_conf: node['bitcoin']['testnet_conf'],
regtest_conf: node['bitcoin']['regtest_conf']