- name: bind
run_list:
- recipe[bind::default]
+ - name: blogs
+ run_list:
+ - recipe[accounts::default]
+ - recipe[blogs::default]
- name: forum
run_list:
- recipe[accounts::default]
--- /dev/null
+~FC001
+~FC003
+~FC064
+~FC065
--- /dev/null
+# Blogs cookbook
+
+This cookbook configures the blog aggregator website found at
+[blogs.openstreetmap.org](https://blogs.openstreetmap.org). The code for
+the website itself is available at [github.com/gravitystorm/blogs.osm.org](https://github.com/gravitystorm/blogs.osm.org).
--- /dev/null
+default[:accounts][:users][:blogs][:status] = :role
--- /dev/null
+name "blogs"
+maintainer "OpenStreetMap Administrators"
+maintainer_email "admins@openstreetmap.org"
+license "Apache 2.0"
+description "Configures server-info web site"
+long_description IO.read(File.join(File.dirname(__FILE__), "README.md"))
+version "1.0.0"
+depends "apache"
+depends "git"
--- /dev/null
+#
+# Cookbook Name:: blogs
+# Recipe:: default
+#
+# Copyright 2016, 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
+#
+# http://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"
+include_recipe "git"
+
+package "ruby"
+package "ruby-dev"
+package "make"
+package "gcc"
+package "libsqlite3-dev"
+
+gem_package "bundler"
+
+directory "/srv/blogs.openstreetmap.org" do
+ owner "blogs"
+ group "blogs"
+ mode 0o755
+end
+
+git "/srv/blogs.openstreetmap.org" do
+ action :sync
+ repository "git://github.com/gravitystorm/blogs.osm.org.git"
+ user "blogs"
+ group "blogs"
+ notifies :run, "execute[/srv/blogs.openstreetmap.org/Gemfile]", :immediate
+end
+
+execute "/srv/blogs.openstreetmap.org/Gemfile" do
+ action :nothing
+ command "bundle install"
+ cwd "/srv/blogs.openstreetmap.org"
+ user "root"
+ group "root"
+ notifies :run, "execute[/srv/blogs.openstreetmap.org]", :immediate
+end
+
+execute "/srv/blogs.openstreetmap.org" do
+ action :nothing
+ command "/usr/local/bin/pluto build -t osm -o build"
+ cwd "/srv/blogs.openstreetmap.org"
+ user "blogs"
+ group "blogs"
+end
+
+apache_site "blogs.openstreetmap.org" do
+ template "apache.erb"
+ directory "/srv/blogs.openstreetmap.org/build"
+end
+
+template "/etc/cron.d/blogs" do
+ source "cron.erb"
+ owner "root"
+ group "root"
+ mode "0644"
+end
--- /dev/null
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:80>
+ ServerName <%= @name %>
+ ServerAdmin webmaster@openstreetmap.org
+
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+ Redirect permanent / https://<%= @name %>/
+</VirtualHost>
+
+<VirtualHost *:443>
+ ServerName <%= @name %>
+ ServerAdmin webmaster@openstreetmap.org
+
+ CustomLog /var/log/apache2/<%= @name %>-access.log combined
+ ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+ DocumentRoot <%= @directory %>
+ DirectoryIndex planet.html
+
+ SSLEngine on
+</VirtualHost>
+
+<Directory <%= @directory %>>
+ Require all granted
+</Directory>
--- /dev/null
+*/30 * * * * blogs /usr/local/bin/pluto update
--- /dev/null
+{
+ "id": "blogs",
+ "uid": "525",
+ "comment": "Blog Aggregator",
+ "manage_home": false
+}
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+ it { should be_installed }
+end
+
+describe service("apache2") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe port(80) do
+ it { should be_listening }
+end
+
+describe port(443) do
+ it { should be_listening }
+end