From c2ff078bfc6519fad2c741f04ef84fcf4f6530f3 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Sat, 12 Oct 2024 22:52:09 -0700 Subject: [PATCH 1/1] vectortile: Set the base URL of the site --- cookbooks/vectortile/recipes/default.rb | 2 +- test/integration/vectortile/inspec/tilekiln_spec.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cookbooks/vectortile/recipes/default.rb b/cookbooks/vectortile/recipes/default.rb index 6fcf25317..39c54e5dd 100644 --- a/cookbooks/vectortile/recipes/default.rb +++ b/cookbooks/vectortile/recipes/default.rb @@ -222,7 +222,7 @@ systemd_service "tilekiln" do wants "postgresql.service" sandbox :enable_network => true restrict_address_families "AF_UNIX" - exec_start "#{tilekiln_directory}/bin/tilekiln serve #{tilekiln_mode} --storage-dbname tiles --num-threads #{node[:vectortile][:serve][:threads]}" + exec_start "#{tilekiln_directory}/bin/tilekiln serve #{tilekiln_mode} --storage-dbname tiles --num-threads #{node[:vectortile][:serve][:threads]} --base-url 'https://vector.openstreetmap.org'" end service "tilekiln" do diff --git a/test/integration/vectortile/inspec/tilekiln_spec.rb b/test/integration/vectortile/inspec/tilekiln_spec.rb index 2887571db..d44562d4c 100644 --- a/test/integration/vectortile/inspec/tilekiln_spec.rb +++ b/test/integration/vectortile/inspec/tilekiln_spec.rb @@ -21,6 +21,10 @@ describe http("https://localhost/shortbread_v1/tilejson.json", :ssl_verify => fa its("status") { should cmp 200 } end +describe json(:content => http("https://localhost/shortbread_v1/tilejson.json", :ssl_verify => false)) do + its(["tiles"]) { should eq(["https://vector.openstreetmap.org/shortbread_v1/{z}/{x}/{y}.mvt"]) } +end + # There are no tiles so everything should return a 404 describe http("https://localhost/shortbread_v1/0/0/0.mvt", :ssl_verify => false) do its("status") { should cmp 404 } -- 2.39.5