From d5ae34c2a6ea58ce6120ffc3a7be0e2b5b36f159 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 28 Nov 2023 03:41:49 +0000 Subject: [PATCH] Add basic en.openstreetmap.town redirect service --- .github/workflows/test-kitchen.yml | 1 + .kitchen.yml | 6 +++++ cookbooks/foundation/recipes/mastodon.rb | 25 +++++++++++++++++++ roles/naga.rb | 1 + .../foundation-mastodon/inspec/apache_spec.rb | 18 +++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 cookbooks/foundation/recipes/mastodon.rb create mode 100644 test/integration/foundation-mastodon/inspec/apache_spec.rb diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 95cbdc878..1b8541af5 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -42,6 +42,7 @@ jobs: - fail2ban - foundation-board - foundation-dwg + - foundation-mastodon - foundation-mwg - foundation-owg - foundation-welcome diff --git a/.kitchen.yml b/.kitchen.yml index 5795b9c7f..cb1c2ffde 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -86,6 +86,9 @@ suites: - name: blogs run_list: - recipe[blogs::default] + - name: chef + run_list: + - recipe[chef::default] - name: civicrm run_list: - recipe[civicrm::default] @@ -153,6 +156,9 @@ suites: - name: foundation-dwg run_list: - recipe[foundation::dwg] + - name: foundation-mastodon + run_list: + - recipe[foundation::mastodon] - name: foundation-mwg run_list: - recipe[foundation::mwg] diff --git a/cookbooks/foundation/recipes/mastodon.rb b/cookbooks/foundation/recipes/mastodon.rb new file mode 100644 index 000000000..a1b290146 --- /dev/null +++ b/cookbooks/foundation/recipes/mastodon.rb @@ -0,0 +1,25 @@ +# +# Cookbook:: foundation +# Recipe:: mastodon +# +# Copyright:: 2023, 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 "podman::apache" + +podman_site "en.openstreetmap.town" do + image "ghcr.io/openstreetmap/owg-website:latest" + aliases ["operations.openstreetmap.org", "operations.osm.org"] +end diff --git a/roles/naga.rb b/roles/naga.rb index 6ed3323f4..4b8587fd9 100644 --- a/roles/naga.rb +++ b/roles/naga.rb @@ -40,6 +40,7 @@ run_list( "role[blogs]", "role[munin]", "role[switch2osm]", + "recipe[foundation::mastodon]", "recipe[foundation::owg]", "recipe[foundation::welcome]", "recipe[stateofthemap::container]", diff --git a/test/integration/foundation-mastodon/inspec/apache_spec.rb b/test/integration/foundation-mastodon/inspec/apache_spec.rb new file mode 100644 index 000000000..8006330b4 --- /dev/null +++ b/test/integration/foundation-mastodon/inspec/apache_spec.rb @@ -0,0 +1,18 @@ +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 } + its("protocols") { should cmp "tcp" } +end + +describe port(443) do + it { should be_listening } + its("protocols") { should cmp "tcp" } +end -- 2.43.2