From cc77b32ae65800f0378e3a752083de8464ba05f6 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Fri, 9 May 2025 18:25:01 -0700 Subject: [PATCH] vectortile: add a demo page for shortbread tiles --- cookbooks/vectortile/metadata.rb | 1 + cookbooks/vectortile/recipes/default.rb | 7 +++++++ cookbooks/vectortile/templates/default/index.html.erb | 2 +- cookbooks/vectortile/templates/default/nginx.erb | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cookbooks/vectortile/metadata.rb b/cookbooks/vectortile/metadata.rb index d3b44e37e..5f4619dc6 100644 --- a/cookbooks/vectortile/metadata.rb +++ b/cookbooks/vectortile/metadata.rb @@ -9,6 +9,7 @@ supports "ubuntu" depends "accounts" depends "git" depends "nginx" +depends "podman" depends "postgresql" depends "prometheus" depends "python" diff --git a/cookbooks/vectortile/recipes/default.rb b/cookbooks/vectortile/recipes/default.rb index c233f28a6..ce3424130 100644 --- a/cookbooks/vectortile/recipes/default.rb +++ b/cookbooks/vectortile/recipes/default.rb @@ -20,6 +20,7 @@ include_recipe "accounts" include_recipe "git" include_recipe "nginx" +include_recipe "podman" include_recipe "postgresql" include_recipe "prometheus" include_recipe "python" @@ -324,3 +325,9 @@ node.default[:prometheus][:exporters][10013] = { :name => "tilekiln", :address => "#{node[:prometheus][:address]}:10013", } + +podman_service "vectortile_demo" do + description "Container service for /demo pages" + image "ghcr.io/openstreetmap/vectortile-website:latest" + ports 8080 => 8080 +end diff --git a/cookbooks/vectortile/templates/default/index.html.erb b/cookbooks/vectortile/templates/default/index.html.erb index feb7f36fa..9fefec130 100644 --- a/cookbooks/vectortile/templates/default/index.html.erb +++ b/cookbooks/vectortile/templates/default/index.html.erb @@ -11,7 +11,7 @@ You've reached the OpenStreetMap.org vector tile server (<%= node['fqdn'] %>)
If you are a user...
-
You probably want OpenStreetMap itself.
+
You probably want OpenStreetMap or the Shortbread demo page.
If you are a developer...
Please be aware of the tile usage policy.
diff --git a/cookbooks/vectortile/templates/default/nginx.erb b/cookbooks/vectortile/templates/default/nginx.erb index 838d30a4f..846a24460 100644 --- a/cookbooks/vectortile/templates/default/nginx.erb +++ b/cookbooks/vectortile/templates/default/nginx.erb @@ -2,6 +2,10 @@ upstream tilekiln { server 127.0.0.1:8000; } +upstream demo { + server 127.0.0.1:8080; +} + server { listen 80 default_server; listen [::]:80 default_server; @@ -42,5 +46,8 @@ server { location /shortbread_v1/ { proxy_pass http://tilekiln; } + location /demo/ { + proxy_pass http://demo; + } root /srv/vector.openstreetmap.org/html; } -- 2.39.5