Migrate Drone CI proxy to openresty

This commit is contained in:
Râu Cao
2023-07-26 14:07:48 +02:00
parent 543b482adb
commit 53abc2ec9a
4 changed files with 9 additions and 15 deletions

View File

@@ -12,21 +12,16 @@ end
# No Discourse host, stop here
return if upstream_ip_addresses.empty?
nginx_certbot_site domain
tls_cert_for domain do
auth "gandi_dns"
action :create
end
template "#{node['nginx']['dir']}/sites-available/#{domain}" do
source "nginx_conf.erb"
owner 'www-data'
mode 0640
openresty_site domain do
template "nginx_conf.erb"
variables server_name: domain,
upstream_ip_addresses: upstream_ip_addresses,
upstream_port: node["kosmos_drone"]["upstream_port"],
ssl_cert: "/etc/letsencrypt/live/#{domain}/fullchain.pem",
ssl_key: "/etc/letsencrypt/live/#{domain}/privkey.pem"
notifies :reload, 'service[nginx]', :delayed
end
nginx_site domain do
action :enable
end