Support Tor connections for LND
Adds basics for general Tor support in bitcoin recipes, and specific support for Tor to the lnd recipe.
This commit is contained in:
@@ -71,6 +71,9 @@ template "#{lnd_dir}/lnd.conf" do
|
||||
notifies :restart, "systemd_unit[lnd.service]", :delayed
|
||||
end
|
||||
|
||||
exec_flags = ""
|
||||
exec_flags += "--tor.active --tor.v3" if node['bitcoin']['tor_enabled']
|
||||
|
||||
systemd_unit 'lnd.service' do
|
||||
content({
|
||||
Unit: {
|
||||
@@ -83,7 +86,7 @@ systemd_unit 'lnd.service' do
|
||||
User: bitcoin_user,
|
||||
Group: bitcoin_group,
|
||||
Type: 'simple',
|
||||
ExecStart: '/opt/go/bin/lnd',
|
||||
ExecStart: "/opt/go/bin/lnd #{exec_flags}",
|
||||
Restart: 'always',
|
||||
RestartSec: '30',
|
||||
TimeoutSec: '240',
|
||||
@@ -108,3 +111,8 @@ firewall_rule 'lnd' do
|
||||
protocol :tcp
|
||||
command :allow
|
||||
end
|
||||
|
||||
if node['bitcoin']['tor_enabled']
|
||||
node.override['tor']['ControlPort'] = 9051
|
||||
node.override['tor']['CookieAuthentication'] = true
|
||||
end
|
||||
|
||||
@@ -81,6 +81,14 @@ user bitcoin_user do
|
||||
shell "/bin/bash"
|
||||
end
|
||||
|
||||
if node['bitcoin']['tor_enabled']
|
||||
group 'debian-tor' do
|
||||
action :modify
|
||||
members bitcoin_user
|
||||
append true
|
||||
end
|
||||
end
|
||||
|
||||
[bitcoin_datadir, bitcoin_walletdir].each do |path|
|
||||
directory path do
|
||||
owner bitcoin_user
|
||||
|
||||
Reference in New Issue
Block a user