]> git.openstreetmap.org Git - chef.git/commitdiff
Update phppgadmin site to use https
authorTom Hughes <tom@compton.nu>
Thu, 4 Jan 2018 18:21:31 +0000 (18:21 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 4 Jan 2018 18:21:31 +0000 (18:21 +0000)
cookbooks/dev/recipes/default.rb
cookbooks/dev/templates/default/apache.phppgadmin.erb

index 35efa45f71ded8c9694aedb998dbbc0050c4761d..bdcec265a4aa7ed3ce4474e8b0ac2a948c556428 100644 (file)
@@ -111,6 +111,11 @@ file "/etc/apache2/conf.d/phppgadmin" do
   action :delete
 end
 
+ssl_certificate "phppgadmin.dev.openstreetmap.org" do
+  domains "phppgadmin.dev.openstreetmap.org"
+  notifies :reload, "service[apache2]"
+end
+
 apache_site "phppgadmin.dev.openstreetmap.org" do
   template "apache.phppgadmin.erb"
 end
index 8f81e9d421dcd1293078b89a81279a527169f00a..ec74a54da0638f99f47468e88f2822b858e2c4c8 100644 (file)
@@ -1,9 +1,13 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
-<VirtualHost *:80>
+<VirtualHost *:443>
        ServerName phppgadmin.dev.openstreetmap.org
        ServerAdmin webmaster@openstreetmap.org
 
+       SSLEngine on
+       SSLCertificateFile /etc/ssl/certs/phppgadmin.dev.openstreetmap.org.pem
+       SSLCertificateKeyFile /etc/ssl/private/phppgadmin.dev.openstreetmap.org.key
+
        CustomLog /var/log/apache2/phppgadmin.dev.openstreetmap.org-access.log combined
        ErrorLog /var/log/apache2/phppgadmin.dev.openstreetmap.org-error.log
 
        ProxyPassMatch ^/(.*\.phpj(/.*)?)$ fcgi://127.0.0.1:7000/usr/share/phppgadmin
 </VirtualHost>
 
+<VirtualHost *:80>
+       ServerName phppgadmin.dev.openstreetmap.org
+       ServerAdmin webmaster@openstreetmap.org
+
+       CustomLog /var/log/apache2/phppgadmin.dev.openstreetmap.org-access.log combined
+       ErrorLog /var/log/apache2/phppgadmin.dev.openstreetmap.org-error.log
+
+       RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+       RedirectPermanent / https://phppgadmin.dev.openstreetmap.org/
+</VirtualHost>
+
 <Directory /usr/share/phppgadmin>
        Require all granted
 </Directory>