From 0ba64ccc3c2b935b93fa9150c7cd6813a8bb06b8 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 30 May 2018 19:11:10 +0100 Subject: [PATCH] Add simple redirect site for hot.osm.org --- cookbooks/hot/.foodcritic | 5 ++++ cookbooks/hot/README.md | 4 +++ cookbooks/hot/metadata.rb | 9 +++++++ cookbooks/hot/recipes/default.rb | 29 ++++++++++++++++++++++ cookbooks/hot/templates/default/apache.erb | 28 +++++++++++++++++++++ roles/ridley.rb | 1 + 6 files changed, 76 insertions(+) create mode 100644 cookbooks/hot/.foodcritic create mode 100644 cookbooks/hot/README.md create mode 100644 cookbooks/hot/metadata.rb create mode 100644 cookbooks/hot/recipes/default.rb create mode 100644 cookbooks/hot/templates/default/apache.erb diff --git a/cookbooks/hot/.foodcritic b/cookbooks/hot/.foodcritic new file mode 100644 index 000000000..b0f9b4b7d --- /dev/null +++ b/cookbooks/hot/.foodcritic @@ -0,0 +1,5 @@ +~FC003 +~FC064 +~FC065 +~FC066 +~FC071 diff --git a/cookbooks/hot/README.md b/cookbooks/hot/README.md new file mode 100644 index 000000000..08b88b195 --- /dev/null +++ b/cookbooks/hot/README.md @@ -0,0 +1,4 @@ +# Hot cookbook + +This cookbook configures the the redirect website found at +[hot.openstreetmap.org](https://hot.openstreetmap.org). diff --git a/cookbooks/hot/metadata.rb b/cookbooks/hot/metadata.rb new file mode 100644 index 000000000..147ff8787 --- /dev/null +++ b/cookbooks/hot/metadata.rb @@ -0,0 +1,9 @@ +name "hot" +maintainer "OpenStreetMap Administrators" +maintainer_email "admins@openstreetmap.org" +license "Apache-2.0" +description "Configures hot web site" +long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) +version "1.0.0" +supports "ubuntu" +depends "apache" diff --git a/cookbooks/hot/recipes/default.rb b/cookbooks/hot/recipes/default.rb new file mode 100644 index 000000000..55c2a2637 --- /dev/null +++ b/cookbooks/hot/recipes/default.rb @@ -0,0 +1,29 @@ +# +# Cookbook Name:: hot +# Recipe:: default +# +# Copyright 2018, OpenStreetMap Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "apache" + +ssl_certificate "hot.openstreetmap.org" do + domains ["hot.openstreetmap.org", "hot.osm.org"] + notifies :reload, "service[apache2]" +end + +apache_site "hot.openstreetmap.org" do + template "apache.erb" +end diff --git a/cookbooks/hot/templates/default/apache.erb b/cookbooks/hot/templates/default/apache.erb new file mode 100644 index 000000000..71682aae7 --- /dev/null +++ b/cookbooks/hot/templates/default/apache.erb @@ -0,0 +1,28 @@ +# DO NOT EDIT - This file is being maintained by Chef + + + ServerName hot.openstreetmap.org + ServerAlias hot.osm.org + ServerAdmin webmaster@openstreetmap.org + + CustomLog /var/log/apache2/hot.openstreetmap.org-access.log combined + ErrorLog /var/log/apache2/hot.openstreetmap.org-error.log + + RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ + RedirectPermanent / https://www.hotosm.org/ + + + + ServerName hot.openstreetmap.org + ServerAlias hot.osm.org + ServerAdmin webmaster@openstreetmap.org + + CustomLog /var/log/apache2/hot.openstreetmap.org-access.log combined + ErrorLog /var/log/apache2/hot.openstreetmap.org-error.log + + SSLEngine on + SSLCertificateFile /etc/ssl/certs/hot.openstreetmap.org.pem + SSLCertificateKeyFile /etc/ssl/private/hot.openstreetmap.org.key + + RedirectPermanent / https://www.hotosm.org/ + diff --git a/roles/ridley.rb b/roles/ridley.rb index f9ec9ebc7..3d742bf5f 100644 --- a/roles/ridley.rb +++ b/roles/ridley.rb @@ -87,6 +87,7 @@ run_list( "role[blog]", "role[otrs]", "role[donate]", + "recipe[hot]", "recipe[dhcpd]", "recipe[openvpn]" ) -- 2.43.2