From: Tom Hughes Date: Wed, 10 Jan 2018 18:39:58 +0000 (+0000) Subject: Add static site for 2013.stateofthemap.org X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/92fe4a42d003e40c2d7218de7aedbd8128969178 Add static site for 2013.stateofthemap.org --- diff --git a/cookbooks/stateofthemap/recipes/default.rb b/cookbooks/stateofthemap/recipes/default.rb index f0936381f..13803a3e9 100644 --- a/cookbooks/stateofthemap/recipes/default.rb +++ b/cookbooks/stateofthemap/recipes/default.rb @@ -266,6 +266,27 @@ wordpress_plugin "2012.stateofthemap.org-wp-sticky" do site "2012.stateofthemap.org" end +%w[2013].each do |year| + git "/srv/#{year}.stateofthemap.org" do + action :sync + repository "git://git.openstreetmap.org/stateofthemap.git" + revision "site-#{year}" + user "root" + group "root" + end + + ssl_certificate "#{year}.stateofthemap.org" do + domains ["#{year}.stateofthemap.org", "#{year}.stateofthemap.com"] + notifies :reload, "service[apache2]" + end + + apache_site "#{year}.stateofthemap.org" do + template "apache.static.erb" + directory "/srv/#{year}.stateofthemap.org" + variables :year => year + end +end + %w[2016 2017 2018].each do |year| git "/srv/#{year}.stateofthemap.org" do action :sync diff --git a/cookbooks/stateofthemap/templates/default/apache.static.erb b/cookbooks/stateofthemap/templates/default/apache.static.erb new file mode 100644 index 000000000..af83be7a9 --- /dev/null +++ b/cookbooks/stateofthemap/templates/default/apache.static.erb @@ -0,0 +1,45 @@ +# DO NOT EDIT - This file is being maintained by Chef + + + ServerName <%= @year %>.stateofthemap.org + ServerAlias <%= @year %>.stateofthemap.com + ServerAdmin webmaster@openstreetmap.org + + CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined + ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log + + RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ + RedirectPermanent / https://<%= @year %>.stateofthemap.org/ + + + + ServerName <%= @year %>.stateofthemap.com + ServerAdmin webmaster@openstreetmap.org + + CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined + ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log + + SSLEngine on + SSLCertificateFile /etc/ssl/certs/<%= @year %>.stateofthemap.org.pem + SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key + + RedirectPermanent / https://<%= @year %>.stateofthemap.org/ + + + + ServerName <%= @year %>.stateofthemap.org + ServerAdmin webmaster@openstreetmap.org + + CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined + ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log + + SSLEngine on + SSLCertificateFile /etc/ssl/certs/<%= @year %>.stateofthemap.org.pem + SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key + + DocumentRoot /srv/<%= @year %>.stateofthemap.org + + +.stateofthemap.org> + Require all granted +