From 490a14e53a6f9fb5639e4e1bdd0f0113d6956838 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 Jul 2023 20:12:33 +0100 Subject: [PATCH] Configure imagery blacklist for the web site --- cookbooks/web/recipes/rails.rb | 10 ++++++++++ cookbooks/web/resources/rails_port.rb | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cookbooks/web/recipes/rails.rb b/cookbooks/web/recipes/rails.rb index 8a2acef32..f321ef537 100644 --- a/cookbooks/web/recipes/rails.rb +++ b/cookbooks/web/recipes/rails.rb @@ -143,6 +143,16 @@ rails_port "www.openstreetmap.org" do trace_image_storage_url "https://openstreetmap-gps-images.s3.dualstack.eu-west-1.amazonaws.com" overpass_url "https://query.openstreetmap.org/query-features" overpass_credentials true + imagery_blacklist [ + # Current Google imagery URLs have google or googleapis in the domain + ".*\\.google(apis)?\\..*/.*", + # Blacklist VWorld + "http://xdworld\\.vworld\\.kr:8080/.*", + # Blacklist here + ".*\\.here\\.com[/:].*", + # Blacklist Mapy.cz + ".*\\.mapy\\.cz.*" + ] end systemd_service "rails-jobs@" do diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index e92c03bd4..4825307b2 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -85,6 +85,7 @@ property :avatar_storage_url, String property :trace_image_storage_url, String property :trace_icon_storage_url, String property :tile_cdn_url, String +property :imagery_blacklist, Array action :create do package %W[ @@ -334,7 +335,8 @@ action :create do "avatar_storage_url", "trace_image_storage_url", "trace_icon_storage_url", - "tile_cdn_url" + "tile_cdn_url", + "imagery_blacklist" ).compact.merge( "server_protocol" => "https", "server_url" => new_resource.site, -- 2.39.5