From 1851ebaa544ba4ffc01a999e5c8450e24a4711cc Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sat, 23 Dec 2023 15:53:49 +0000 Subject: [PATCH] planet: add notes S3 redirect --- cookbooks/planet/templates/default/apache.erb | 1 + test/integration/planet/inspec/apache_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/cookbooks/planet/templates/default/apache.erb b/cookbooks/planet/templates/default/apache.erb index 86ed44640..91d142d9b 100644 --- a/cookbooks/planet/templates/default/apache.erb +++ b/cookbooks/planet/templates/default/apache.erb @@ -80,6 +80,7 @@ RewriteRule ^/planet/<%= year %>/(changesets\-<%= year_two %>[0-1][0-9][0-3][0-9]\.osm\.bz2(\.torrent|\.md5)?)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/changesets/osm/<%= year %>/$1 [R,L] RewriteRule ^/planet/<%= year %>/(discussions\-<%= year_two %>[0-1][0-9][0-3][0-9]\.osm\.bz2(\.torrent|\.md5)?)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/discussions/osm/<%= year %>/$1 [R,L] RewriteRule ^/planet/full\-history/<%= year %>/(history\-<%= year_two %>[0-1][0-9][0-3][0-9]\.osm\.bz2(\.torrent|\.md5)?)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/planet-full-history/osm/<%= year %>/$1 [R,L] + RewriteRule ^/notes/<%= year %>/(planet\-notes\-<%= year_two %>[0-1][0-9][0-3][0-9]\.osn\.bz2(\.md5)?)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/notes/osn/<%= year %>/$1 [R,L] RewriteRule ^/tile_logs/(hosts\-<%= year %>\-[01][0-9]\-[0-3][0-9]\.csv)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/tile_logs/standard_layer/hosts/<%= year %>/$1 [R,L] RewriteRule ^/tile_logs/(countries\-<%= year %>\-[01][0-9]\-[0-3][0-9]\.csv)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/tile_logs/standard_layer/countries/<%= year %>/$1 [R,L] RewriteRule ^/tile_logs/(apps\-<%= year %>\-[01][0-9]\-[0-3][0-9]\.csv)$ https://osm-planet-%{ENV:REGION}.s3.dualstack.%{ENV:REGION}.amazonaws.com/tile_logs/standard_layer/apps/<%= year %>/$1 [R,L] diff --git a/test/integration/planet/inspec/apache_spec.rb b/test/integration/planet/inspec/apache_spec.rb index 68fdebe6a..fa98727db 100644 --- a/test/integration/planet/inspec/apache_spec.rb +++ b/test/integration/planet/inspec/apache_spec.rb @@ -167,6 +167,22 @@ describe http("https://127.0.0.1/pbf/full-history/history-231016.osm.pbf", its("headers.Location") { should eq "https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/planet-full-history/pbf/2023/history-231016.osm.pbf" } end +# Notes file + +describe http("https://127.0.0.1/notes/2023/planet-notes-231222.osn.bz2", + :headers => { "Host" => "planet.openstreetmap.org" }, + :ssl_verify => false) do + its("status") { should eq 302 } + its("headers.Location") { should eq "https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/notes/osn/2023/planet-notes-231222.osn.bz2" } +end + +describe http("https://127.0.0.1/notes/2023/planet-notes-231222.osn.bz2.md5", + :headers => { "Host" => "planet.openstreetmap.org" }, + :ssl_verify => false) do + its("status") { should eq 302 } + its("headers.Location") { should eq "https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/notes/osn/2023/planet-notes-231222.osn.bz2.md5" } +end + # Tiles log describe http("https://127.0.0.1/tile_logs/tiles-2023-10-21.txt.xz", -- 2.45.1