From f4f384d04bcd318c2257c99386677c136defb9ef Mon Sep 17 00:00:00 2001 From: Fuhu Xia Date: Thu, 9 Nov 2023 17:04:46 -0500 Subject: [PATCH 1/2] switch map tile server to openstreetmap.org --- ckan/setup/ckan.ini | 8 ++++---- proxy/nginx-common.conf | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ckan/setup/ckan.ini b/ckan/setup/ckan.ini index 5d87dde8..a32b8e89 100644 --- a/ckan/setup/ckan.ini +++ b/ckan/setup/ckan.ini @@ -232,14 +232,14 @@ ckanext.spatial.search_backend = solr-bbox # Customize map widget ckanext.spatial.common_map.type = custom -# ckanext.spatial.common_map.custom_url = /maptiles/{z}/{x}/{y}.png -# ckanext.spatial.common_map.attribution = OpenStreetMap contributors +ckanext.spatial.common_map.custom_url = /maptiles/{z}/{x}/{y}.png +ckanext.spatial.common_map.attribution = OpenStreetMap contributors # ckanext.spatial.common_map.custom_url = https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x} # ckanext.spatial.common_map.attribution = Tiles courtesy of the U.S. Geological Survey -ckanext.spatial.common_map.custom_url = https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.png -ckanext.spatial.common_map.attribution = Stadia Maps. OpenStreetMap contributors +# ckanext.spatial.common_map.custom_url = https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.png +# ckanext.spatial.common_map.attribution = Stadia Maps. OpenStreetMap contributors ## Harvest settings # ckanext-harvest will use ckan.redis.url if redis configuration diff --git a/proxy/nginx-common.conf b/proxy/nginx-common.conf index 95ba046c..84e112f2 100644 --- a/proxy/nginx-common.conf +++ b/proxy/nginx-common.conf @@ -89,8 +89,8 @@ location ~ ^/(dataset\/new|api\/action\/package_create|api\/action\/resource_cre # use local path for map tiles so that they # can be cached by the CDN location /maptiles { - # only allow requests generated from data.gov - valid_referers server_names *.data.gov; + # only allow requests generated from our apps + valid_referers server_names *.data.gov *admin-datagov.app.cloud.gov; if ($invalid_referer) { return 403; } From 6438878fd0bc105e6d06d321c14afab3709a3f58 Mon Sep 17 00:00:00 2001 From: Fuhu Xia Date: Thu, 9 Nov 2023 17:09:49 -0500 Subject: [PATCH 2/2] refer *.data.gov *.app.cloud.gov --- proxy/nginx-common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/nginx-common.conf b/proxy/nginx-common.conf index 84e112f2..c6d68d78 100644 --- a/proxy/nginx-common.conf +++ b/proxy/nginx-common.conf @@ -90,7 +90,7 @@ location ~ ^/(dataset\/new|api\/action\/package_create|api\/action\/resource_cre # can be cached by the CDN location /maptiles { # only allow requests generated from our apps - valid_referers server_names *.data.gov *admin-datagov.app.cloud.gov; + valid_referers server_names *.data.gov *.app.cloud.gov; if ($invalid_referer) { return 403; }