]> git.openstreetmap.org Git - chef.git/commitdiff
stateofthemap: Move Chooser to container
authorGrant Slater <github@firefishy.com>
Mon, 13 Feb 2023 22:06:45 +0000 (22:06 +0000)
committerGrant Slater <github@firefishy.com>
Mon, 13 Feb 2023 22:27:39 +0000 (22:27 +0000)
Signed-off-by: Grant Slater <github@firefishy.com>
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/stateofthemap/metadata.rb
cookbooks/stateofthemap/recipes/container.rb
cookbooks/stateofthemap/recipes/default.rb
cookbooks/stateofthemap/templates/default/apache.erb [deleted file]
test/integration/stateofthemap/serverspec/apache_spec.rb [deleted file]

index 2469ab522bc67dadbf4cca6e9604e29e39610bab..69995287de9084a4f1e05149e65a608248da81ab 100644 (file)
@@ -96,7 +96,6 @@ jobs:
           - snmpd
           - spamassassin
           - ssl
           - snmpd
           - spamassassin
           - ssl
-          - stateofthemap
           - stateofthemap-container
           - stateofthemap-wordpress
           - subversion
           - stateofthemap-container
           - stateofthemap-wordpress
           - subversion
index c867618c0e6f93fe18e45dc4ae257e70c18416c1..b298b8f60869cf784ef89bf1bfbc33cc2b4be489 100644 (file)
@@ -337,9 +337,6 @@ suites:
   - name: ssl
     run_list:
       - recipe[ssl::default]
   - name: ssl
     run_list:
       - recipe[ssl::default]
-  - name: stateofthemap
-    run_list:
-      - recipe[stateofthemap::default]
   - name: stateofthemap-container
     run_list:
       - recipe[stateofthemap::container]
   - name: stateofthemap-container
     run_list:
       - recipe[stateofthemap::container]
index 4844cef30f49ea44291b660832178d7003202744..139ba825e79c3df42576e82ad93dd58b660efdc6 100644 (file)
@@ -7,6 +7,5 @@ description       "Installs and configures State of the Map services"
 version           "1.0.0"
 supports          "ubuntu"
 depends           "apache"
 version           "1.0.0"
 supports          "ubuntu"
 depends           "apache"
-depends           "git"
 depends           "podman"
 depends           "wordpress"
 depends           "podman"
 depends           "wordpress"
index 6320e81ee768e6fbcf134ef207f62a4e4aedf4e9..5a7de8d527d59286a59789b47fb51695c8fcfc3d 100644 (file)
@@ -22,6 +22,26 @@ include_recipe "podman"
 
 apache_module "proxy_http"
 
 
 apache_module "proxy_http"
 
+docker_external_port = 8096
+
+podman_service "www.stateofthemap.org" do
+  description "Container service for www.stateofthemap.org"
+  image "ghcr.io/openstreetmap/stateofthemap-website:latest"
+  ports docker_external_port => "8080"
+end
+
+ssl_certificate "stateofthemap.org" do
+  domains ["stateofthemap.org", "www.stateofthemap.org",
+           "stateofthemap.com", "www.stateofthemap.com",
+           "sotm.org", "www.sotm.org"]
+  notifies :reload, "service[apache2]"
+end
+
+apache_site "stateofthemap.org" do
+  template "apache.container.erb"
+  variables :docker_external_port => docker_external_port, :aliases => ["www.stateofthemap.org", "stateofthemap.com", "www.stateofthemap.com", "sotm.org", "www.sotm.org"]
+end
+
 %w[2013 2016 2017 2018 2019 2020 2021 2022].each do |year|
   docker_external_port = 6180 + year.to_i # 8193+
 
 %w[2013 2016 2017 2018 2019 2020 2021 2022].each do |year|
   docker_external_port = 6180 + year.to_i # 8193+
 
index aa98e5bc5b36d931eee37b20e3a1327cb77c8c5d..3047f77a84f98c73dc6bafa8690d2b84688fbcf8 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-
-include_recipe "apache"
-include_recipe "git"
-
-apache_module "expires"
-
-git "/srv/stateofthemap.org" do
-  action :sync
-  repository "https://git.openstreetmap.org/public/stateofthemap.git"
-  revision "chooser"
-  depth 1
-  user "root"
-  group "root"
-end
-
-ssl_certificate "stateofthemap.org" do
-  domains ["stateofthemap.org", "www.stateofthemap.org",
-           "stateofthemap.com", "www.stateofthemap.com",
-           "sotm.org", "www.sotm.org"]
-  notifies :reload, "service[apache2]"
-end
-
-apache_site "stateofthemap.org" do
-  template "apache.erb"
-  directory "/srv/stateofthemap.org"
-end
diff --git a/cookbooks/stateofthemap/templates/default/apache.erb b/cookbooks/stateofthemap/templates/default/apache.erb
deleted file mode 100644 (file)
index 7cca3c5..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# DO NOT EDIT - This file is being maintained by Chef
-
-<VirtualHost *:80>
-        ServerName stateofthemap.org
-        ServerAlias stateofthemap.com
-        ServerAlias sotm.org
-        ServerAlias www.stateofthemap.org
-        ServerAlias www.stateofthemap.com
-        ServerAlias www.sotm.org
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/stateofthemap.org-access.log combined
-        ErrorLog /var/log/apache2/stateofthemap.org-error.log
-
-        RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
-        RedirectPermanent / https://stateofthemap.org/
-</VirtualHost>
-
-<VirtualHost *:443>
-        ServerName stateofthemap.com
-        ServerAlias sotm.org
-        ServerAlias www.stateofthemap.org
-        ServerAlias www.stateofthemap.com
-        ServerAlias www.sotm.org
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/stateofthemap.org-access.log combined
-        ErrorLog /var/log/apache2/stateofthemap.org-error.log
-
-        SSLEngine on
-        SSLCertificateFile /etc/ssl/certs/stateofthemap.org.pem
-        SSLCertificateKeyFile /etc/ssl/private/stateofthemap.org.key
-
-        RedirectPermanent / https://stateofthemap.org/
-</VirtualHost>
-
-<VirtualHost *:443>
-        ServerName stateofthemap.org
-        ServerAdmin webmaster@openstreetmap.org
-
-        CustomLog /var/log/apache2/stateofthemap.org-access.log combined
-        ErrorLog /var/log/apache2/stateofthemap.org-error.log
-
-        SSLEngine on
-        SSLCertificateFile /etc/ssl/certs/stateofthemap.org.pem
-        SSLCertificateKeyFile /etc/ssl/private/stateofthemap.org.key
-
-        DocumentRoot /srv/stateofthemap.org/html
-
-        ErrorDocument 404 /404.html
-
-        ExpiresActive On
-        ExpiresDefault "access plus 12 hours"
-</VirtualHost>
-
-<Directory /srv/stateofthemap.org/html>
-        Require all granted
-</Directory>
diff --git a/test/integration/stateofthemap/serverspec/apache_spec.rb b/test/integration/stateofthemap/serverspec/apache_spec.rb
deleted file mode 100644 (file)
index 446d3b9..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-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.with("tcp") }
-end
-
-describe port(443) do
-  it { should be_listening.with("tcp") }
-end