Support proxy domain validation for Garage web domains
Also rename the data bag item
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
# Recipe:: nginx_web
|
||||
#
|
||||
|
||||
gandi_api_credentials = data_bag_item('credentials', 'gandi_api')
|
||||
|
||||
file "#{node['openresty']['dir']}/conf.d/garage.conf" do
|
||||
content <<-EOF
|
||||
upstream garage_web {
|
||||
@@ -40,8 +42,12 @@ end
|
||||
#
|
||||
|
||||
node['garage']['s3_web_domains'].each do |domain_name|
|
||||
second_level_domain = domain_name.match(/(?:.*\.)?([^.]+\.[^.]+)$/) { $1 }
|
||||
proxy_validation = !gandi_api_credentials["domains"].include?(second_level_domain)
|
||||
|
||||
tls_cert_for domain_name do
|
||||
auth "gandi_dns"
|
||||
acme_domain "letsencrypt.kosmos.org" if proxy_validation
|
||||
action :create
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user