Move PostgreSQL to VMs and access via Zerotier #282

Merged
raucao merged 40 commits from feature/postgres_vms into master 2021-01-25 10:56:42 +00:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 8a870f6fd6 - Show all commits

View File

@ -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

View File

@ -1,8 +1,10 @@
<% if @onion_address %>
server {
listen 80;
server_name mastodon.<%= @onion_address %>;
include <%= @shared_config_path %>;
}
<% end %>
map $http_upgrade $connection_upgrade {
default upgrade;