group "nogroup"
end
+ssl_certificate "operations.osmfoundation.org" do
+ domains "operations.osmfoundation.org"
+ fallback_certificate "osmfoundation"
+ notifies :reload, "service[apache2]"
+end
+
apache_site "operations.osmfoundation.org" do
template "apache.owg.erb"
directory "/srv/operations.osmfoundation.org/_site"
# DO NOT EDIT - This file is being maintained by Chef
-<VirtualHost *:80>
+<VirtualHost *:443>
ServerName <%= @name %>
ServerAdmin webmaster@openstreetmap.org
CustomLog /var/log/apache2/<%= @name %>-access.log combined
ErrorLog /var/log/apache2/<%= @name %>-error.log
- Redirect permanent / https://<%= @name %>/
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+ SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
+
+ DocumentRoot <%= @directory %>
</VirtualHost>
-<VirtualHost *:443>
+<VirtualHost *:80>
ServerName <%= @name %>
ServerAdmin webmaster@openstreetmap.org
CustomLog /var/log/apache2/<%= @name %>-access.log combined
ErrorLog /var/log/apache2/<%= @name %>-error.log
- DocumentRoot <%= @directory %>
-
- SSLEngine on
+ RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+ RedirectPermanent / https://<%= @name %>/
</VirtualHost>
<Directory <%= @directory %>>
default_action :create
property :name, String
-property :domains, Array, :required => true
+property :domains, [String, Array], :required => true
property :fallback_certificate, String
action :create do
node.default[:letsencrypt][:certificates][name] = {
- :domains => domains
+ :domains => Array(domains)
}
if letsencrypt
owner "root"
group "root"
mode 0o644
- variables :domains => new_resource.domains
+ variables :domains => Array(new_resource.domains)
not_if do
::File.exist?("/etc/ssl/certs/#{new_resource.name}.pem") && ::File.exist?("/etc/ssl/private/#{new_resource.name}.key")
end