]> git.openstreetmap.org Git - chef.git/commitdiff
Add simple redirect site for hot.osm.org
authorTom Hughes <tom@compton.nu>
Wed, 30 May 2018 18:11:10 +0000 (19:11 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 30 May 2018 18:11:10 +0000 (19:11 +0100)
cookbooks/hot/.foodcritic [new file with mode: 0644]
cookbooks/hot/README.md [new file with mode: 0644]
cookbooks/hot/metadata.rb [new file with mode: 0644]
cookbooks/hot/recipes/default.rb [new file with mode: 0644]
cookbooks/hot/templates/default/apache.erb [new file with mode: 0644]
roles/ridley.rb

diff --git a/cookbooks/hot/.foodcritic b/cookbooks/hot/.foodcritic
new file mode 100644 (file)
index 0000000..b0f9b4b
--- /dev/null
@@ -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 (file)
index 0000000..08b88b1
--- /dev/null
@@ -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 (file)
index 0000000..147ff87
--- /dev/null
@@ -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 (file)
index 0000000..55c2a26
--- /dev/null
@@ -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 (file)
index 0000000..71682aa
--- /dev/null
@@ -0,0 +1,28 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:80>
+   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/
+</VirtualHost>
+
+<VirtualHost *:443>
+   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/
+</VirtualHost>
index f9ec9ebc782a42d42af0eab6403fc8ffdf4db4ea..3d742bf5fcb018f576ffa14f8d1e86d5c8f2c236 100644 (file)
@@ -87,6 +87,7 @@ run_list(
   "role[blog]",
   "role[otrs]",
   "role[donate]",
   "role[blog]",
   "role[otrs]",
   "role[donate]",
+  "recipe[hot]",
   "recipe[dhcpd]",
   "recipe[openvpn]"
 )
   "recipe[dhcpd]",
   "recipe[openvpn]"
 )