From 184480f8d8081176968fc31f5438c2d8b0ae86f2 Mon Sep 17 00:00:00 2001 From: Ian Ross Date: Mon, 1 Aug 2016 14:49:14 +0200 Subject: [PATCH] Make OSM tile access be over HTTPS Keep on using HTTP for OSM in development to make Squid caching of tiles easy for functional testing. --- cadasta/config/settings/default.py | 2 +- cadasta/config/settings/dev.py | 8 ++++++++ cadasta/config/settings/travis.py | 8 ++++++++ provision/roles/cadasta/application/tasks/main.yml | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cadasta/config/settings/default.py b/cadasta/config/settings/default.py index 1cfd812e0..acf24c815 100644 --- a/cadasta/config/settings/default.py +++ b/cadasta/config/settings/default.py @@ -157,7 +157,7 @@ LEAFLET_CONFIG = { 'TILES': [('OpenStreetMap', - 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {'attribution': 'Map data © ' 'OpenStreetMap contributors, ' diff --git a/cadasta/config/settings/dev.py b/cadasta/config/settings/dev.py index ac41196a8..e1531266e 100644 --- a/cadasta/config/settings/dev.py +++ b/cadasta/config/settings/dev.py @@ -58,3 +58,11 @@ DEFAULT_FILE_STORAGE = 'buckets.test.storage.FakeS3Storage' MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'core/media') MEDIA_URL = '/media/' + +# Use HTTP for OSM for testing only, to make caching tiles for +# functional tests a bit simpler. +LEAFLET_CONFIG['TILES'][0] = ( + LEAFLET_CONFIG['TILES'][0][0], + 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + LEAFLET_CONFIG['TILES'][0][2] +) diff --git a/cadasta/config/settings/travis.py b/cadasta/config/settings/travis.py index 48bd84569..decca9fea 100644 --- a/cadasta/config/settings/travis.py +++ b/cadasta/config/settings/travis.py @@ -23,3 +23,11 @@ DEFAULT_FILE_STORAGE = 'buckets.test.storage.FakeS3Storage' MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'core/media') MEDIA_URL = '/media/' + +# Use HTTP for OSM for testing only, to make caching tiles for +# functional tests a bit simpler. +LEAFLET_CONFIG['TILES'][0] = ( + LEAFLET_CONFIG['TILES'][0][0], + 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + LEAFLET_CONFIG['TILES'][0][2] +) diff --git a/provision/roles/cadasta/application/tasks/main.yml b/provision/roles/cadasta/application/tasks/main.yml index b1626f4e1..30876836f 100644 --- a/provision/roles/cadasta/application/tasks/main.yml +++ b/provision/roles/cadasta/application/tasks/main.yml @@ -66,7 +66,7 @@ - name: Download world boundary data files become: yes become_user: "{{ app_user }}" - get_url: url=http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip + get_url: url=http://naciscdn.org/naturalearth/10m/cultural/ne_10m_admin_0_countries.zip dest="{{ application_path }}cadasta/geography/data/ne_10m_admin_0_countries.zip" - name: Unzip world boundary data files