From d5c8e6ec9ba9502e06d0d51e468180384bc00747 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 18 Feb 2023 10:42:27 +0100 Subject: [PATCH] nominatim: add static files to serve in production These came previously with the OSMF-specific Nominatim source code. This doesn't work anymore since the project directory is used for serving. --- .../nominatim/files/default/website/403.html | 23 ++++ .../nominatim/files/default/website/509.html | 12 ++ .../files/default/website/crossdomain.xml | 5 + .../files/default/website/favicon.ico | Bin 0 -> 1406 bytes .../files/default/website/nominatim.xml | 15 +++ .../files/default/website/robots.txt | 14 +++ .../files/default/website/taginfo.json | 112 ++++++++++++++++++ cookbooks/nominatim/recipes/default.rb | 11 ++ 8 files changed, 192 insertions(+) create mode 100644 cookbooks/nominatim/files/default/website/403.html create mode 100644 cookbooks/nominatim/files/default/website/509.html create mode 100644 cookbooks/nominatim/files/default/website/crossdomain.xml create mode 100644 cookbooks/nominatim/files/default/website/favicon.ico create mode 100644 cookbooks/nominatim/files/default/website/nominatim.xml create mode 100644 cookbooks/nominatim/files/default/website/robots.txt create mode 100644 cookbooks/nominatim/files/default/website/taginfo.json diff --git a/cookbooks/nominatim/files/default/website/403.html b/cookbooks/nominatim/files/default/website/403.html new file mode 100644 index 000000000..8d8e3233b --- /dev/null +++ b/cookbooks/nominatim/files/default/website/403.html @@ -0,0 +1,23 @@ + + +Access blocked + + +

Access blocked

+ +

You have been blocked because you have violated the +usage policy +of OSM's Nominatim geocoding service. Please be aware that OSM's resources are +limited and shared between many users. The usage policy is there to ensure that +the service remains usable for everybody.

+ +

Please review the terms and make sure that your +software adheres to the terms. You should in particular verify that you have set a +custom HTTP referrer or HTTP user agent that identifies your application, and +that you are not overusing the service with massive bulk requests.

+ +

If you feel that this block is unjustified or remains after you have adopted +your usage, you may contact the Nominatim system administrator at +nominatim@openstreetmap.org to have this block lifted.

+ + diff --git a/cookbooks/nominatim/files/default/website/509.html b/cookbooks/nominatim/files/default/website/509.html new file mode 100644 index 000000000..628c53bdf --- /dev/null +++ b/cookbooks/nominatim/files/default/website/509.html @@ -0,0 +1,12 @@ + + +Bandwidth limit exceeded + + +

Bandwidth limit exceeded

+ +

You have been temporarily blocked because you have been overusing OSM's geocoding service or because you have not provided sufficient identification of your application. This block will be automatically lifted after a while. Please take the time and adapt your scripts to reduce the number of requests and make sure that you send a valid UserAgent or Referer.

+ +

For more information, consult the usage policy for the OSM Nominatim server.

+ + diff --git a/cookbooks/nominatim/files/default/website/crossdomain.xml b/cookbooks/nominatim/files/default/website/crossdomain.xml new file mode 100644 index 000000000..963a682b6 --- /dev/null +++ b/cookbooks/nominatim/files/default/website/crossdomain.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/cookbooks/nominatim/files/default/website/favicon.ico b/cookbooks/nominatim/files/default/website/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..0157ea008fd941f507323a72a108baaa3b72d06f GIT binary patch literal 1406 zcmeH{>r>QK7{@<9R%N>w$Z~OstFX&um%Gpc8yA&;pdbvwAZUY7GK?T1B5)&0HrjM) zgNQ96NL&U67#VQP#$p_6j3B@Z7EVlZi=9M6cJQ&WtB+XA;`XM8a|s(dHzRn3YF#Ne0n*m==?W{RhcRF0c5Om=c$;xG*pW=aQ-vv=A;>y(AYnI39R z^kO(|rRsDym9tjrPT6QV)kote0~iHOX9me$?V@(-3##V^u$&pD?c69WCzmkIjbUD% z!Ti}gZJ)2uKDS24!bMuXJHgcXS^B=3#k_Qx&c!QOF05g_w1VyHbM$|ER`4m-l{IWX zEO7S9mkj;5fc@G$BLe%i1%|E*zF%ed>P4on&olbdqF{;9^+oJgFEh5j%;fqK<3BG8 z&NJcQmkUe^j{kazDF?r;FfEw*ef6fl@c+&K_yum={I84dE}mP&2odtR;mch-eM`xC z+BWcJl}1>12xDta+ri=Yj~=TOb!wp z=#eL$O~8YPI_(36cV(pCS8(9Dl1)MIT5osVwtMb<^x=x9THO>da%Aw8$cSgUTJ{?o zRj{Y?-FKePR%IR9S6&@{8$6zi{(-%Dim1R?uUo|XZb%F}oE>TZA0Yb%+GJq-2Qd$g W4n+NzoJ1~?j~)EoJ0g0m + + Nominatim + Nominatim OSM Search + Search for a place in OpenStreetMap Nominatim + UTF-8 + UTF-8 + + + Sarah Hoffmann + false + Data &copy; OpenStreetMap contributors. ODbL, http://www.osm.org/copyright. + + diff --git a/cookbooks/nominatim/files/default/website/robots.txt b/cookbooks/nominatim/files/default/website/robots.txt new file mode 100644 index 000000000..9624d97ce --- /dev/null +++ b/cookbooks/nominatim/files/default/website/robots.txt @@ -0,0 +1,14 @@ +User-agent: ia_archiver +Allow: / + +User-agent: * +Disallow: /search.php +Disallow: /search +Disallow: /details.php +Disallow: /details +Disallow: /reverse.php +Disallow: /reverse +Disallow: /hierarchy +Disallow: /hierarchy.php +Disallow: /lookup +Disallow: /lookup.php diff --git a/cookbooks/nominatim/files/default/website/taginfo.json b/cookbooks/nominatim/files/default/website/taginfo.json new file mode 100644 index 000000000..98f8b978a --- /dev/null +++ b/cookbooks/nominatim/files/default/website/taginfo.json @@ -0,0 +1,112 @@ +{ + "data_format": 1, + "data_url": "http://nominatim.openstreetmap.org/taginfo.json", + "project": { + "name": "Nominatim", + "description": "OSM search engine.", + "project_url": "http://nominatim.openstreetmap.org", + "doc_url": "http://wiki.osm.org/wiki/Nominatim", + "contact_name": "Sarah Hoffmann", + "contact_email": "lonvia@denofr.de" + }, + "tags": [ + { "key" : "ref", "description": "Searchable name of the place."}, + { "key" : "int_ref", "description": "Searchable name of the place."}, + { "key" : "nat_ref", "description": "Searchable name of the place."}, + { "key" : "reg_ref", "description": "Searchable name of the place."}, + { "key" : "loc_ref", "description": "Searchable name of the place."}, + { "key" : "old_ref", "description": "Searchable name of the place."}, + { "key" : "iata", "description": "Searchable name of the place."}, + { "key" : "icao", "description": "Searchable name of the place."}, + { "key" : "pcode", "description": "Searchable name of the place."}, + { "key" : "name", "description": "Searchable name of the place."}, + { "key" : "int_name", "description": "Searchable name of the place."}, + { "key" : "nat_name", "description": "Searchable name of the place."}, + { "key" : "reg_name", "description": "Searchable name of the place."}, + { "key" : "loc_name", "description": "Searchable name of the place."}, + { "key" : "old_name", "description": "Searchable name of the place."}, + { "key" : "alt_name", "description": "Searchable name of the place."}, + { "key" : "official_name", "description": "Searchable name of the place."}, + { "key" : "place_name", "description": "Searchable name of the place."}, + { "key" : "short_name", "description": "Searchable name of the place."}, + { "key" : "addr:housename", "description": "Searchable name of the place."}, + { "key" : "operator", "description": "Searchable name for amenities and shops." }, + { "key" : "brand", "description": "Searchable name of POI places."}, + { "key" : "bridge:name", "description" : "Searchable name for bridges."}, + { "key" : "tunnel:name", "description" : "Searchable name for tunnels."}, + { "key" : "emergency", "description": "POI in the search database." }, + { "key" : "tourism", "description": "POI in the search database." }, + { "key" : "historic", "description": "POI in the search database." }, + { "key" : "military", "description": "POI in the search database." }, + { "key" : "natural", "description": "POI in the search database." }, + { "key" : "man_made", "description": "POI in the search database." }, + { "key" : "mountain_pass", "description": "POI in the search database." }, + { "key" : "highway", "description": "POI or street in the search database (not added are: 'no', 'turning_circle', 'traffic_signals', 'mini_roundabout', 'crossing' and traffic signs)." }, + { "key" : "aerialway", "description": "POI in the search database (unless value is 'no', 'pylon')." }, + { "key" : "aeroway", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "amenity", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "boundary", "description": "Area in the search database (used to compute addresses of other places)." }, + { "key" : "bridge", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "craft", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "leisure", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "office", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "railway", "description": "Geographic feature in the search database (unless value is 'no')." }, + { "key" : "landuse", "description": "Geographic feature in the search database (unless value is 'no')." }, + { "key" : "shop", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "tunnel", "description": "POI in the search database (unless value is 'no')." }, + { "key" : "waterway", "description": "Geographic feature in the search database (unless value is 'riverbank')."}, + { "key" : "place", "description": "Settlement on the search database (used to compute addresses of other places)." }, + { "key" : "postal_code", "description": "Postcode in search database (used to compute postcodes of places around)." }, + { "key" : "postcode", "description": "Postcode in search database (used to compute postcodes of places around)." }, + { "key" : "addr:postcode", "description": "Postcode in search database (used to compute postcodes of places around)." }, + { "key" : "tiger:zip_left", "description": "Postcode in search database (used to compute postcodes of places around)." }, + { "key" : "tiger:zip_right", "description": "Postcode in search database (used to compute postcodes of places around)." }, + { "key" : "addr:street", "description": "Used to determine the street of a house or POI. Note that a street with the same name must exist for the tag to be effective."}, + { "key" : "addr:place", "description": "Used to determine the settlement of a house or POI with a street-less address."}, + { "key" : "country_code", "description": "Used to determine the country a place is in."}, + { "key" : "ISO3166-1", "description": "Used to determine the country a place is in."}, + { "key" : "is_in:country_code", "description": "Used to determine the country a place is in."}, + { "key" : "is_in:country", "description": "Used to determine the country a place is in."}, + { "key" : "addr:country", "description": "Used to determine the country a place is in."}, + { "key" : "addr:country_code", "description": "Used to determine the country a place is in."}, + { "key" : "addr:housenumber", "description": "House number of the place (no ranges)."}, + { "key" : "addr:conscriptionnumber", "description": "House number of the place (Eastern European system)."}, + { "key" : "addr:streetnumber", "description": "House number of the place (Eastern European system)."}, + { "key" : "addr:interpolation", "description": "Way along which house numbers are interpolated."} , + { "key" : "tiger:county", "description": "Used to determine the address in the US (needs a place with the same name and a county suffix)."}, + { "key" : "addr:suburb", "description": "Used to determine the address of a place."}, + { "key" : "addr:city", "description": "Used to determine the address of a place."}, + { "key" : "addr:state_code", "description": "Used to determine the address of a place."}, + { "key" : "addr:state", "description": "Used to determine the address of a place."}, + { "key" : "addr:province", "description": "Used to determine the address of a place."}, + { "key" : "addr:district", "description": "Used to determine the address of a place."}, + { "key" : "addr:region", "description": "Used to determine the address of a place."}, + { "key" : "addr:county", "description": "Used to determine the address of a place."}, + { "key" : "addr:municipality", "description": "Used to determine the address of a place."}, + { "key" : "addr:hamlet", "description": "Used to determine the address of a place."}, + { "key" : "addr:village", "description": "Used to determine the address of a place."}, + { "key" : "addr:subdistrict", "description": "Used to determine the address of a place."}, + { "key" : "addr:town", "description": "Used to determine the address of a place."}, + { "key" : "addr:neighbourhood", "description": "Used to determine the address of a place."}, + { "key" : "addr:quarter", "description": "Used to determine the address of a place."}, + { "key" : "addr:parish", "description": "Used to determine the address of a place."}, + { "key" : "is_in:suburb", "description": "Used to determine the address of a place."}, + { "key" : "is_in:city", "description": "Used to determine the address of a place."}, + { "key" : "is_in:state_code", "description": "Used to determine the address of a place."}, + { "key" : "is_in:state", "description": "Used to determine the address of a place."}, + { "key" : "is_in:province", "description": "Used to determine the address of a place."}, + { "key" : "is_in:district", "description": "Used to determine the address of a place."}, + { "key" : "is_in:region", "description": "Used to determine the address of a place."}, + { "key" : "is_in:county", "description": "Used to determine the address of a place."}, + { "key" : "is_in:municipality", "description": "Used to determine the address of a place."}, + { "key" : "is_in:hamlet", "description": "Used to determine the address of a place."}, + { "key" : "is_in:village", "description": "Used to determine the address of a place."}, + { "key" : "is_in:subdistrict", "description": "Used to determine the address of a place."}, + { "key" : "is_in:town", "description": "Used to determine the address of a place."}, + { "key" : "is_in:neighbourhood", "description": "Used to determine the address of a place."}, + { "key" : "is_in:quarter", "description": "Used to determine the address of a place."}, + { "key" : "is_in:parish", "description": "Used to determine the address of a place."}, + { "key" : "admin_level", "description": "Determines the hierarchy for administrative boundaries."}, + { "key" : "wikipedia", "description": "Linking to the right wikipedia article helps to guess the importance of a place, which determines how far up in the search results it appears."} + ] +} diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 7a5936f32..44bf649ea 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -183,6 +183,17 @@ if node[:nominatim][:flatnode_file] end end +remote_directory "#{project_directory}/website" do + source "website" + owner "nominatim" + group "nominatim" + mode "755" + files_owner "nominatim" + files_group "nominatim" + files_mode "644" + purge false +end + # Normally syncing via chef is a bad idea because syncing might involve # an update of database functions which should not be done while an update # is ongoing. Therefore we sync in between update cycles. There is an -- 2.39.5