#
include_recipe "git"
-include_recipe "apache"
+include_recipe "apache::ssl"
passwords = data_bag_item("dns", "passwords")
variables :zones => zones
end
+ssl_certificate "dns.openstreetmap.org" do
+ domains "dns.openstreetmap.org"
+ fallback_certificate "openstreetmap"
+ notifies :reload, "service[apache2]"
+end
+
apache_site "dns.openstreetmap.org" do
template "apache.erb"
directory "/srv/dns.openstreetmap.org"
CustomLog /var/log/apache2/<%= @name %>-access.log combined
ErrorLog /var/log/apache2/<%= @name %>-error.log
+ RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+ RedirectPermanent / https://<%= @name %>/
+</VirtualHost>
+
+<VirtualHost *:443>
+ ServerName <%= @name %>
+ ServerAdmin webmaster@openstreetmap.org
+
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+ SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
+
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
DocumentRoot <%= @directory %>/html
Alias /json/ /var/lib/dns/json/
</VirtualHost>