]> git.openstreetmap.org Git - chef.git/commitdiff
replace MultiMaps extension with Kartographer extension, closes openstreetmap/operati...
authorTigerfell <tigerfell-688@tuta.io>
Sat, 17 Dec 2022 12:34:10 +0000 (13:34 +0100)
committerGrant <github@firefishy.com>
Wed, 11 Jan 2023 20:48:22 +0000 (20:48 +0000)
cookbooks/wiki/recipes/default.rb
cookbooks/wiki/templates/default/mw-ext-JsonConfig.inc.php.erb [new file with mode: 0644]
cookbooks/wiki/templates/default/mw-ext-Kartographer.inc.php.erb [new file with mode: 0644]
cookbooks/wiki/templates/default/mw-ext-MultiMaps.inc.php.erb [deleted file]

index 2485932b3df66596bbc52146bf71b789e19da3af..58836b54fd182e58f96048101b139b5695456a9a 100644 (file)
@@ -107,6 +107,19 @@ mediawiki_extension "MultiMaps" do
   template "mw-ext-MultiMaps.inc.php.erb"
   template_cookbook "wiki"
   variables :thunderforest_key => passwords["thunderforest"]
+  action :delete
+end
+
+mediawiki_extension "JsonConfig" do
+  site "wiki.openstreetmap.org"
+  template "mw-ext-JsonConfig.inc.php.erb"
+  template_cookbook "wiki"
+end
+
+mediawiki_extension "Kartographer" do
+  site "wiki.openstreetmap.org"
+  template "mw-ext-Kartographer.inc.php.erb"
+  template_cookbook "wiki"
 end
 
 cookbook_file "/srv/wiki.openstreetmap.org/osm_logo_wiki.png" do
diff --git a/cookbooks/wiki/templates/default/mw-ext-JsonConfig.inc.php.erb b/cookbooks/wiki/templates/default/mw-ext-JsonConfig.inc.php.erb
new file mode 100644 (file)
index 0000000..b3c666b
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+
+# JsonConfig is a requirement for Kartographer extension
+wfLoadExtension( 'JsonConfig' );
+
diff --git a/cookbooks/wiki/templates/default/mw-ext-Kartographer.inc.php.erb b/cookbooks/wiki/templates/default/mw-ext-Kartographer.inc.php.erb
new file mode 100644 (file)
index 0000000..60cba9a
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+# DO NOT EDIT - This file is being maintained by Chef
+
+wfLoadExtension( 'Kartographer' );
+$wgKartographerMapServer = 'https://tile.openstreetmap.org';
+$wgKartographerDfltStyle = '';
+$wgKartographerStyles = [];
+
diff --git a/cookbooks/wiki/templates/default/mw-ext-MultiMaps.inc.php.erb b/cookbooks/wiki/templates/default/mw-ext-MultiMaps.inc.php.erb
deleted file mode 100644 (file)
index ddcfb62..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-# DO NOT EDIT - This file is being maintained by Chef
-
-require_once "$IP/extensions/MultiMaps/MultiMaps.php";
-
-# Array of String. Array containing all the mapping services that will be made available to the user.
-# First value - default service, which will be used if the service is not in the parameters
-# Values may be a valid name of class based on class BaseMapService or some string and an array if they
-# denote different tiles within a BaseMapService
-$egMultiMaps_MapServices = [
-  'Leaflet',
-  'cyclosm' => [
-    'service' => 'Leaflet',
-    'attribution' => '&copy; <a href="https://osm.org/copyright">OpenStreetMap contributors</a>. Tiles style by <a href="https://www.cyclosm.org/" target="_blank">CyclOSM</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>',
-    'source' => 'https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png',
-  ],
-  'cycle' => [
-    'service' => 'Leaflet',
-    'attribution' => '&copy; <a href="https://osm.org/copyright">OpenStreetMap contributors</a>. Tiles courtesy of <a href="https://www.thunderforest.com/" target="_blank">Andy Allan</a>',
-    'source' => 'https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=<%= @thunderforest_key %>',
-  ],
-  'transport' => [
-    'service' => 'Leaflet',
-    'attribution' => '&copy; <a href="https://osm.org/copyright">OpenStreetMap contributors</a>. Tiles courtesy of <a href="https://www.thunderforest.com/" target="_blank">Andy Allan</a>',
-    'source' => 'https://tile.thunderforest.com/transport/{z}/{x}/{y}.png?apikey=<%= @thunderforest_key %>',
-  ],
-  'oepnv' => [
-    'service' => 'Leaflet',
-    'attribution' => '&copy; <a href="https://osm.org/copyright">OpenStreetMap contributors</a>. Tiles courtesy of <a href="https://memomaps.de/" target="_blank">MeMoMaps</a>',
-    'source' => 'https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png',
-  ],
-  'humanitarian' => [
-    'service' => 'Leaflet',
-    'attribution' => '&copy; <a href="https://osm.org/copyright">OpenStreetMap contributors</a>. Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>',
-    'source' => 'https://tile.openstreetmap.fr/hot/{z}/{x}/{y}.png'
-  ],
-];