Tor improvements for bitcoin cookbook

This commit is contained in:
Basti 2022-04-19 14:08:02 +02:00
parent a633834a1b
commit 71f9b06d28
Signed by untrusted user: basti
GPG Key ID: 9F88009D31D99C72
2 changed files with 10 additions and 4 deletions

View File

@ -62,6 +62,7 @@ template "#{lnd_dir}/lnd.conf" do
lnd_feerate: node['lnd']['feerate'], lnd_feerate: node['lnd']['feerate'],
lnd_dir: lnd_dir, lnd_dir: lnd_dir,
auto_unlock: node['lnd']['auto_unlock'], auto_unlock: node['lnd']['auto_unlock'],
tor_enabled: node['bitcoin']['tor_enabled'],
bitcoin_datadir: node['bitcoin']['datadir'], bitcoin_datadir: node['bitcoin']['datadir'],
bitcoin_rpc_user: node['bitcoin']['conf']['rpcuser'], bitcoin_rpc_user: node['bitcoin']['conf']['rpcuser'],
bitcoin_rpc_password: bitcoin_credentials["rpcpassword"], bitcoin_rpc_password: bitcoin_credentials["rpcpassword"],
@ -71,9 +72,6 @@ template "#{lnd_dir}/lnd.conf" do
notifies :restart, "systemd_unit[lnd.service]", :delayed notifies :restart, "systemd_unit[lnd.service]", :delayed
end end
exec_flags = ""
exec_flags += "--tor.active --tor.v3" if node['bitcoin']['tor_enabled']
systemd_unit 'lnd.service' do systemd_unit 'lnd.service' do
content({ content({
Unit: { Unit: {
@ -86,7 +84,7 @@ systemd_unit 'lnd.service' do
User: bitcoin_user, User: bitcoin_user,
Group: bitcoin_group, Group: bitcoin_group,
Type: 'simple', Type: 'simple',
ExecStart: "/opt/go/bin/lnd #{exec_flags}", ExecStart: "/opt/go/bin/lnd",
Restart: 'always', Restart: 'always',
RestartSec: '30', RestartSec: '30',
TimeoutSec: '240', TimeoutSec: '240',

View File

@ -25,3 +25,11 @@ bitcoind.rpcuser=<%= @bitcoin_rpc_user %>
bitcoind.rpcpass=<%= @bitcoin_rpc_password %> bitcoind.rpcpass=<%= @bitcoin_rpc_password %>
bitcoind.zmqpubrawblock=<%= @bitcoin_zmqpubrawblock %> bitcoind.zmqpubrawblock=<%= @bitcoin_zmqpubrawblock %>
bitcoind.zmqpubrawtx=<%= @bitcoin_zmqpubrawtx %> bitcoind.zmqpubrawtx=<%= @bitcoin_zmqpubrawtx %>
<% if @tor_enabled %>
[tor]
tor.active=true
tor.v3=true
tor.streamisolation=false
tor.skip-proxy-for-clearnet-targets=true
<% end %>