Skip to content

Commit

Permalink
Make OSM tile access be over HTTPS
Browse files Browse the repository at this point in the history
Keep on using HTTP for OSM in development to make Squid caching of tiles
easy for functional testing.
  • Loading branch information
Ian Ross committed Aug 1, 2016
1 parent d6319cb commit 184480f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cadasta/config/settings/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 &copy; <a href="http://openstreetmap.org">'
'OpenStreetMap</a> contributors, '
Expand Down
8 changes: 8 additions & 0 deletions cadasta/config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
8 changes: 8 additions & 0 deletions cadasta/config/settings/travis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
2 changes: 1 addition & 1 deletion provision/roles/cadasta/application/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 184480f

Please sign in to comment.