Add public HTTP reverse proxy for LndHub

This commit is contained in:
2021-11-21 13:22:40 -06:00
parent e48cf04e6c
commit 931a3a196f
4 changed files with 51 additions and 3 deletions

View File

@@ -93,3 +93,25 @@ firewall_rule 'lndhub_private' do
protocol :tcp
command :allow
end
unless node.chef_environment == "development"
include_recipe "kosmos-base::letsencrypt"
include_recipe "kosmos-nginx"
nginx_certbot_site node[app_name]['domain']
template "#{node['nginx']['dir']}/sites-available/#{node[app_name]['domain']}" do
source 'nginx_conf_lndhub.erb'
owner node["nginx"]["user"]
mode 0640
variables port: node[app_name]['port'],
server_name: node[app_name]['domain'],
ssl_cert: "/etc/letsencrypt/live/#{node[app_name]['domain']}/fullchain.pem",
ssl_key: "/etc/letsencrypt/live/#{node[app_name]['domain']}/privkey.pem"
notifies :reload, 'service[nginx]', :delayed
end
nginx_site node[app_name]['domain'] do
action :enable
end
end