Don't fail on first run, when Tor hostname missing
This commit is contained in:
@@ -24,6 +24,8 @@ template "#{node['nginx']['dir']}/snippets/mastodon.conf" do
|
||||
notifies :reload, 'service[nginx]', :delayed
|
||||
end
|
||||
|
||||
onion_address = File.read("/var/lib/tor/mastodon/hostname").strip rescue nil
|
||||
|
||||
template "#{node['nginx']['dir']}/sites-available/#{server_name}" do
|
||||
source 'nginx_conf_mastodon.erb'
|
||||
owner 'www-data'
|
||||
@@ -32,7 +34,7 @@ template "#{node['nginx']['dir']}/sites-available/#{server_name}" do
|
||||
ssl_cert: "/etc/letsencrypt/live/#{server_name}/fullchain.pem",
|
||||
ssl_key: "/etc/letsencrypt/live/#{server_name}/privkey.pem",
|
||||
shared_config_path: "#{node['nginx']['dir']}/snippets/mastodon.conf",
|
||||
onion_address: File.read("/var/lib/tor/mastodon/hostname").strip
|
||||
onion_address: onion_address
|
||||
notifies :reload, 'service[nginx]', :delayed
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user