]> git.openstreetmap.org Git - chef.git/commitdiff
Switch svn to letsencrypt
authorTom Hughes <tom@compton.nu>
Sun, 12 Feb 2017 10:31:16 +0000 (10:31 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 12 Feb 2017 10:31:16 +0000 (10:31 +0000)
cookbooks/subversion/recipes/default.rb
cookbooks/subversion/templates/default/apache.erb

index 96941ed73d125b3c9a2fe5c0c56c348b58f8caac..8419bbc40dfd3d6348e51e76870961ec54c894a0 100644 (file)
@@ -51,6 +51,12 @@ apache_module "authz_svn" do
   package "libapache2-svn"
 end
 
+ssl_certificate site_name do
+  domains site_name
+  fallback_certificate "openstreetmap"
+  notifies :reload, "service[apache2]"
+end
+
 apache_site site_name do
   template "apache.erb"
   directory repository_directory
index ae5c4031737577247ab2b8c3b21118a4d7011e07..2ae7d0a1951289b95733bae32ef9e70058c6e7fd 100644 (file)
@@ -1,13 +1,12 @@
 # DO NOT EDIT - This file is being maintained by Chef
-<% [80, 443].each do |port| -%>
 
-<VirtualHost *:<%= port %>>
+<VirtualHost *:443>
         ServerName <%= @name %>
         ServerAdmin webmaster@openstreetmap.org
-<% if port == 443 -%>
 
         SSLEngine on
-<% end -%>
+        SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+        SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
 
         CustomLog /var/log/apache2/<%= @name %>-access.log combined
         CustomLog /var/log/apache2/<%= @name %>-svn-access.log "%h %t %u %{SVN-ACTION}e" env=SVN-ACTION
                 </LimitExcept>
         </Location>
 </VirtualHost>
-<% end -%>
+
+<VirtualHost *:80>
+        ServerName <%= @name %>
+        ServerAdmin webmaster@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>