]> git.openstreetmap.org Git - chef.git/commitdiff
community: fix the acme redirect templating madness master
authorGrant Slater <github@firefishy.com>
Fri, 7 Feb 2025 04:59:14 +0000 (04:59 +0000)
committerGrant Slater <github@firefishy.com>
Fri, 7 Feb 2025 04:59:14 +0000 (04:59 +0000)
cookbooks/community/recipes/default.rb
cookbooks/community/templates/default/data.yml.erb
cookbooks/community/templates/default/web_only.yml.erb
cookbooks/imagery/recipes/au_act_aerial.rb [new file with mode: 0644]
cookbooks/imagery/recipes/au_vic_melbourne_aerial.rb [new file with mode: 0644]
cookbooks/imagery/resources/site.rb
cookbooks/imagery/templates/default/nginx_imagery_layer_fragment.conf.erb
cookbooks/mediawiki/templates/default/composer.local.json.erb
roles/geodns.rb
roles/imagery.rb

index 51c4624eac89ebe2643a6659c88ae8c966ddc89f..6ba2160134d01b83bee34f19db9bbbd2fc527a1c 100644 (file)
@@ -63,7 +63,7 @@ git "/srv/community.openstreetmap.org/docker" do
   action :sync
   repository "https://github.com/discourse/discourse_docker.git"
   # DANGER launch wrapper automatically updates git repo if rebuild method used: https://github.com/discourse/discourse_docker/blob/107ffb40fe8b1ea40e00814468db974a4f3f8e8f/launcher#L799
-  revision "136c63890674b95df1327d24270c55e4ef8e87a8"
+  revision "efd6bc8ccbd9057c04d909ff48ecf8b704cae3ff"
   user "root"
   group "root"
   notifies :run, "notify_group[discourse_container_new_data]"
@@ -155,6 +155,7 @@ execute "discourse_container_data_bootstrap" do
   cwd "/srv/community.openstreetmap.org/docker/"
   user "root"
   group "root"
+  retries 2 # Postgres upgrades required a second run
 end
 
 execute "discourse_container_data_destroy" do
index c5c59d2884cea75a777babf715a85126d582ed4e..37573874eb0ebb09c77b8f23854f7e175e622eee 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 templates:
-  - "templates/postgres.13.template.yml" # NOTE UPDATE THE HOOK REPLACE FOR MAX CONNECTIONS BELOW
+  - "templates/postgres.15.template.yml" # NOTE UPDATE THE HOOK REPLACE FOR MAX CONNECTIONS BELOW
   - "templates/redis.template.yml"
 
 # any extra arguments for Docker?
@@ -51,6 +51,6 @@ hooks:
 run:
   # Make sure this matches the postgresql version template above
   - replace:
-      filename: "/etc/postgresql/13/main/postgresql.conf"
+      filename: "/etc/postgresql/15/main/postgresql.conf"
       from: /#?max_connections *=.*/
       to: "max_connections = $db_max_connections"
index 5beef48028613719c639700ff74c01e7af6fe50e..cdced0a8a349de8cf443dfadf2fa7711819c9191 100644 (file)
@@ -19,7 +19,7 @@ links:
 # any extra arguments for Docker?
 # docker_args:
 
-# Latest Version v3.3.3
+# Latest Version v3.4.0
 # Discourse only support tests-passed and stable branches
 params:
   version: stable
@@ -116,14 +116,6 @@ hooks:
         cmd:
           - sudo -H -E -u discourse cp /shared/feeds/update-feeds.atom public/update-feeds.atom
   after_ssl:
-    - replace:
-        filename: "/etc/nginx/conf.d/discourse.conf"
-        from: /listen 80;/
-        to: |
-          listen 80;
-          listen [::]:80;
-          rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
-
     - replace:
         filename: "/etc/nginx/conf.d/discourse.conf"
         from: /add_header.+/
@@ -133,3 +125,11 @@ hooks:
           resolver <%= @resolvers.join(" ") %>;
           resolver_timeout 5s;
           ssl_dhparam /shared/ssl/dhparam.pem;
+
+run:
+  - replace:
+      filename: "/etc/nginx/conf.d/discourse.conf"
+      from: /return 301.+/
+      to: |
+        rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
+        return 301 https://$$ENV_DISCOURSE_HOSTNAME$request_uri;
diff --git a/cookbooks/imagery/recipes/au_act_aerial.rb b/cookbooks/imagery/recipes/au_act_aerial.rb
new file mode 100644 (file)
index 0000000..cc01359
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Cookbook:: imagery
+# Recipe:: au_act_aerial
+#
+# Copyright:: 2025, 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 "imagery"
+
+imagery_site "act-imagery.openstreetmap.org" do
+  title "OpenStreetMap - ACT Imagery"
+  aliases ["act-imagery.osm.org"]
+  # https://leafletjs.com/reference.html#latlngbounds format
+  # [[south, west], [north, east]]
+  bbox [[-35.942, 148.729], [-35.117, 149.430]]
+end
+
+imagery_layer "act_aerial_imagery_202409" do
+  site "act-imagery.openstreetmap.org"
+  title "ACT Aerial Imagery 202409"
+  projection "EPSG:7855"
+  source "https://tiles.arcgis.com/tiles/E5n4f1VY84i0xSjy/arcgis/rest/services/ACT_Aerial_Imagery_202409/MapServer/WMTS/1.0.0/WMTSCapabilities.xml"
+  # attribution per https://www.actmapi.act.gov.au/terms-and-conditions and https://tiles.arcgis.com/tiles/E5n4f1VY84i0xSjy/arcgis/rest/services/ACT_Aerial_Imagery_202409/MapServer/
+  copyright "ACT Imagery from <a href='https://www.actmapi.act.gov.au/home'>ACTmapi</a> (c) Australian Capital Territory and MetroMap. "
+  default_layer true
+  background_colour "0 0 0"
+  extension "jpeg"
+  max_zoom 22
+end
+
+imagery_layer "act_aerial_imagery_202311" do
+  site "act-imagery.openstreetmap.org"
+  title "ACT Aerial Imagery 202311"
+  projection "EPSG:7855"
+  source "https://tiles.arcgis.com/tiles/E5n4f1VY84i0xSjy/arcgis/rest/services/ACT_Aerial_Imagery_202311/MapServer/WMTS/1.0.0/WMTSCapabilities.xml"
+  # attribution per https://www.actmapi.act.gov.au/terms-and-conditions and https://tiles.arcgis.com/tiles/E5n4f1VY84i0xSjy/arcgis/rest/services/ACT_Aerial_Imagery_202311/MapServer/
+  copyright "ACT Imagery from <a href='https://www.actmapi.act.gov.au/home'>ACTmapi</a> (c) Australian Capital Territory and MetroMap. "
+  background_colour "0 0 0"
+  extension "jpeg"
+  max_zoom 22
+end
+
+imagery_layer "act_aerial_imagery_202305" do
+  site "act-imagery.openstreetmap.org"
+  title "ACT Aerial Imagery 202305"
+  projection "EPSG:7855"
+  source "https://tiles.arcgis.com/tiles/E5n4f1VY84i0xSjy/arcgis/rest/services/ACT_Aerial_Imagery_202305/MapServer/WMTS/1.0.0/WMTSCapabilities.xml"
+  # attribution per https://www.actmapi.act.gov.au/terms-and-conditions and https://tiles.arcgis.com/tiles/E5n4f1VY84i0xSjy/arcgis/rest/services/ACT_Aerial_Imagery_202305/MapServer/
+  copyright "ACT Imagery from <a href='https://www.actmapi.act.gov.au/home'>ACTmapi</a> (c) Australian Capital Territory and MetroMap. "
+  background_colour "0 0 0"
+  extension "jpeg"
+  max_zoom 22
+end
diff --git a/cookbooks/imagery/recipes/au_vic_melbourne_aerial.rb b/cookbooks/imagery/recipes/au_vic_melbourne_aerial.rb
new file mode 100644 (file)
index 0000000..cda5e80
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Cookbook:: imagery
+# Recipe:: au_vic_melbourne_aerial
+#
+# Copyright:: 2024, 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 "imagery"
+
+imagery_site "au-vic-melbourne-imagery.openstreetmap.org" do
+  title "OpenStreetMap - City of Melbourne - Aerial Imagery"
+  aliases ["au-vic-melbourne-imagery.osm.org"]
+  # https://leafletjs.com/reference.html#latlngbounds format
+  # [[south, west], [north, east]]
+  bbox [[-37.850667, 144.896981], [-37.775451, 144.991351]]
+end
+
+imagery_layer "melbourne-2020" do
+  site "au-vic-melbourne-imagery.openstreetmap.org"
+  title "City of Melbourne 2020"
+  source "/store/imagery/au/city-of-melbourne/CoM_May2020_2cm.cog.tiff"
+  copyright "(c) 2020 City of Melbourne"
+  max_zoom 23
+  extension "jpeg"
+  revision 2
+  default_layer true
+end
+
+imagery_layer "melbourne-2019" do
+  site "au-vic-melbourne-imagery.openstreetmap.org"
+  title "City of Melbourne 2019"
+  source "/store/imagery/au/city-of-melbourne/CoM_03Feb2019.cog.tiff"
+  copyright "(c) 2019 City of Melbourne"
+  max_zoom 21
+  extension "jpeg"
+  revision 2
+end
+
+imagery_layer "melbourne-2018" do
+  site "au-vic-melbourne-imagery.openstreetmap.org"
+  title "City of Melbourne 2018"
+  source "/store/imagery/au/city-of-melbourne/CoM_May2018_10cm.COG.tiff"
+  copyright "(c) 2018 City of Melbourne"
+  max_zoom 21
+  extension "jpeg"
+  revision 2
+end
index 5eddb448c47d6a6356297cf75367b5171d482926..6a20594c79d2204a017b419c505a4f6017f46e00 100644 (file)
@@ -105,7 +105,10 @@ action :create do
     description "Map server for #{new_resource.site} layer"
     environment "MS_DEBUGLEVEL" => "0",
                 "MS_ERRORFILE" => "stderr",
-                "GDAL_CACHEMAX" => "128"
+                "GDAL_CACHEMAX" => "128",
+                "GDAL_HTTP_TCP_KEEPALIVE" => "YES",
+                "GDAL_HTTP_VERSION" => "2TLS",
+                "GDAL_ENABLE_WMS_CACHE" => "NO"
     limit_nofile 16384
     memory_high "12G"
     memory_max "12G"
@@ -113,7 +116,7 @@ action :create do
     group "imagery"
     exec_start "/usr/bin/multiwatch -f 8 --signal=TERM -- /usr/lib/cgi-bin/mapserv"
     standard_input "socket"
-    sandbox true
+    sandbox :enable_network => true
     restrict_address_families "AF_UNIX"
     timeout_stop_sec 60
     not_if { new_resource.uses_tiler }
@@ -154,7 +157,7 @@ action :create do
 
   systemd_timer "mapserv-fcgi-#{new_resource.site}-stop" do
     on_boot_sec "10m"
-    on_unit_inactive_sec "30m"
+    on_unit_inactive_sec "6h"
     randomized_delay_sec "20m"
     not_if { new_resource.uses_tiler }
   end
index 723d0d0f2b8522a1345b753158084860569cd73b..97f411a181ba799b5b41635260ff3e2040ed8718 100644 (file)
@@ -3,7 +3,7 @@
 location ~* "^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(jpg|jpeg|png|webp)$" {
 <% if @uses_tiler -%>
   set $args "";
-  rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(jpg|jpeg|png|webp) /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first&tile_format=$4 break;
+  rewrite ^/layer/<%= @layer %>/(\d+)/(\d+)/(\d+)\.(jpg|jpeg|png|webp) /mosaicjson/tiles/WebMercatorQuad/$1/$2/$3@1x.$4?url=<%= URI.encode_www_form_component(@source) %>&pixel_selection=first break;
   proxy_pass http://<%= @site %>_tiler_backend;
   proxy_set_header Host $host;
   proxy_set_header Referer $http_referer;
index 73678e1cc8580e11ae4141028e549bf243e51d52..338a0de9d97871541b387a1608cf17d9041f3a66 100644 (file)
@@ -8,6 +8,13 @@
     }
   },
   "require": {
-    "guzzlehttp/psr7": "2.4.5"
+    "guzzlehttp/psr7": "2.4.5",
+    "data-values/common": "1.0.0",
+    "data-values/data-values": "3.0.0",
+    "data-values/geo": "4.2.3",
+    "data-values/interfaces": "1.0.0",
+    "data-values/number": "0.11.1",
+    "data-values/serialization": "1.2.4",
+    "data-values/time": "1.0.4"
   }
 }
index a2ad092f323812b6e142dc427bb0ea7bdadaaf0f..a1df0153233badae3c3e4c7a23d101eb1c6848e1 100644 (file)
@@ -12,8 +12,10 @@ default_attributes(
         :list => false,
         :transfer_logging => false,
         :hosts_allow => [
-          "184.104.226.102",  # idris
-          "2001:470:1:b3b::6" # idris
+          "184.104.226.102",  # idris HE
+          "2001:470:1:b3b::6", # idris HE
+          "87.252.214.102", # idris Equinix
+          "2001:4d78:fe03:1c::6" # idris  Equinix
         ]
       }
     }
index d6caa11e9fb3f02f0a434d6dace9c662869388dc..f024515a927bdfe43bba7ad9e24456ee3a9d6050 100644 (file)
@@ -35,6 +35,8 @@ default_attributes(
 
 run_list(
   "recipe[imagery::au_agri]",
+  "recipe[imagery::au_act_aerial]",
+  "recipe[imagery::au_vic_melbourne_aerial]",
   "recipe[imagery::gb_ea]",
   "recipe[imagery::gb_hampshire_aerial]",
   "recipe[imagery::gb_os_sv]",