]> git.openstreetmap.org Git - chef.git/commitdiff
Switch to using containers for ideditor and hot. Move to naga
authorGrant Slater <github@firefishy.com>
Mon, 3 Apr 2023 11:48:21 +0000 (12:48 +0100)
committerGrant Slater <github@firefishy.com>
Mon, 3 Apr 2023 11:48:21 +0000 (12:48 +0100)
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/hot/metadata.rb
cookbooks/hot/recipes/default.rb
cookbooks/hot/templates/default/apache.erb [deleted file]
cookbooks/ideditor/metadata.rb
cookbooks/ideditor/recipes/default.rb
cookbooks/ideditor/templates/default/apache.erb [deleted file]
roles/naga.rb
roles/ridley.rb
test/integration/ideditor/serverspec/apache_spec.rb [new file with mode: 0644]

index 7159b11deebb60cdcb2c7a401a466393a042ceca..63b74169556c2f4279bbd1d95dc0120da7d27abc 100644 (file)
@@ -53,6 +53,7 @@ jobs:
           - gps-tile
           - hardware
           - hot
+          - ideditor
           - irc
           - kibana
           - letsencrypt
index 9b18826f2bf3adea6b7f01b392065c6cefb19deb..2b5b581f8eaad5f9cca6d8aeb940dc73f4134f2e 100644 (file)
@@ -185,6 +185,9 @@ suites:
   - name: hot
     run_list:
       - recipe[hot::default]
+  - name: ideditor
+    run_list:
+      - recipe[ideditor::default]
   - name: irc
     run_list:
       - recipe[irc::default]
index 118521e91159cf98a553da1a4fa233b8eb5bbe3e..9f689b2f766774f5650bf6012c80868748086e8e 100644 (file)
@@ -6,4 +6,4 @@ description       "Configures hot web site"
 
 version           "1.0.0"
 supports          "ubuntu"
-depends           "apache"
+depends           "podman"
index b4d31692309c5aef2139b7f3d3dc81005894e0eb..8f12dc193badc0d1e8a5e6d86e255fe3d9f66a55 100644 (file)
 # limitations under the License.
 #
 
-include_recipe "apache"
+include_recipe "podman::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"
+podman_site "hot.openstreetmap.org" do
+  image "ghcr.io/openstreetmap/hot.openstreetmap.org-website:latest"
+  aliases ["hot.osm.org"]
 end
diff --git a/cookbooks/hot/templates/default/apache.erb b/cookbooks/hot/templates/default/apache.erb
deleted file mode 100644 (file)
index 71682aa..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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 c177fdb9c7766e922d18f962a2c1a3c543e4398d..dc3b802110ba9ca11201a90b399f302e79998991 100644 (file)
@@ -6,4 +6,4 @@ description       "Configures ideditor.com web site"
 
 version           "1.0.0"
 supports          "ubuntu"
-depends           "apache"
+depends           "podman"
index b65209fa22de8caed83fe26d37dd40abb79ac0bc..753ac1222217db1ea829d62f4274810cbe574872 100644 (file)
 # limitations under the License.
 #
 
-include_recipe "apache"
+include_recipe "podman::apache"
 
-ssl_certificate "preview.ideditor.com" do
-  domains ["preview.ideditor.com"]
-  notifies :reload, "service[apache2]"
-end
-
-apache_site "preview.ideditor.com" do
-  template "apache.erb"
+podman_site "preview.ideditor.com" do
+  image "ghcr.io/openstreetmap/preview.ideditor.com-website:latest"
 end
diff --git a/cookbooks/ideditor/templates/default/apache.erb b/cookbooks/ideditor/templates/default/apache.erb
deleted file mode 100644 (file)
index c9af627..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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
-
-  RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
-  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
-
-  SSLEngine on
-  SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
-  SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
-
-  RewriteEngine on
-  RewriteRule ^/release/?.* https://ideditor-release.netlify.app/ [QSD,L,R=307]
-  RewriteRule ^/?.* https://ideditor.netlify.app/ [QSD,L,R=307]
-</VirtualHost>
index ab310808a3f038575bd5c9a9c97c4f00802f5d0c..aa9db6707817c3355cd6e04e0f15a33e9ed24511 100644 (file)
@@ -42,5 +42,7 @@ run_list(
   "role[switch2osm]",
   "recipe[foundation::owg]",
   "recipe[foundation::welcome]",
-  "recipe[stateofthemap::container]"
+  "recipe[stateofthemap::container]",
+  "recipe[hot]",
+  "recipe[ideditor]"
 )
index 60ebf295c5fb78a4eed6b28be285f4897033e910..7a653f422be9eb0e63fc8a42f1dffe3acd8027f8 100644 (file)
@@ -45,8 +45,6 @@ run_list(
   "role[blog]",
   "role[otrs]",
   "role[donate]",
-  "recipe[hot]",
   "recipe[dmca]",
-  "recipe[dhcpd]",
-  "recipe[ideditor]"
+  "recipe[dhcpd]"
 )
diff --git a/test/integration/ideditor/serverspec/apache_spec.rb b/test/integration/ideditor/serverspec/apache_spec.rb
new file mode 100644 (file)
index 0000000..dcd625a
--- /dev/null
@@ -0,0 +1,21 @@
+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("tcp6") }
+end
+
+describe port(443) do
+  it { should be_listening.with("tcp6") }
+end