From 366a93e8f7a423a7341849d0f95ab915d17cd363 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 21 Apr 2017 18:28:35 +0200 Subject: [PATCH 1/5] Bump social-auth --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index bf12a923..d303b0e0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ django-leaflet-storage==0.8.2 Pillow==4.0.0 psycopg2==2.6.2 requests==2.13.0 -social-auth-app-django==1.0.1 -social-auth-core==1.1.0 +social-auth-app-django==1.1.0 +social-auth-core==1.2.0 From ee312b07eb04d34e9a445a33c6d5be7e2dfe5619 Mon Sep 17 00:00:00 2001 From: michael spreng Date: Wed, 16 May 2018 15:11:08 +0200 Subject: [PATCH 2/5] bump social-auth to use https:// for osm.org oauth openstreetmap.org switched to https:// login with umap does not work anymore with old social-auth version. The new version now has the https:// urls. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d303b0e0..ba508772 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ Pillow==4.0.0 psycopg2==2.6.2 requests==2.13.0 social-auth-app-django==1.1.0 -social-auth-core==1.2.0 +social-auth-core==1.7.0 From 249c3fa32b27668cd1c52449a1d57cdf5baadd8a Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 10 May 2017 11:12:10 +0200 Subject: [PATCH 3/5] Add travis.yml --- .travis.yml | 25 +++++++++++++++++++++++++ README.md | 2 +- pytest.ini | 2 +- requirements-dev.txt | 6 +++--- umap/settings/base.py | 6 ++++++ umap/tests/settings.py | 3 +++ umap/views.py | 11 +++++++++-- 7 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 .travis.yml create mode 100644 umap/tests/settings.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..cca3b66d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +sudo: false +language: python +python: +- "2.7" +- "3.4" +- "3.5" +- "3.6" +services: +- postgresql +env: +- UMAP_SETTINGS=umap/tests/settings.py +install: +- pip install . +- pip install -r requirements-dev.txt +script: make test +notifications: + irc: + channels: + - "irc.freenode.net#umap" + on_success: change + on_failure: always + email: false +branches: + only: + - master diff --git a/README.md b/README.md index 45422738..c65ae66d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # uMap project [![Requirements Status](https://requires.io/github/umap-project/umap/requirements.svg?branch=master)](https://requires.io/github/umap-project/umap/requirements/?branch=master) -[![Join the chat at https://gitter.im/umap-project/umap](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/umap-project/umap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Documentation Status](https://readthedocs.org/projects/umap-project/badge/?version=latest)](http://umap-project.readthedocs.io/en/latest/?badge=latest) +[![Join the chat at https://gitter.im/umap-project/umap](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/umap-project/umap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Documentation Status](https://readthedocs.org/projects/umap-project/badge/?version=latest)](http://umap-project.readthedocs.io/en/latest/?badge=latest)[![Build Status](https://travis-ci.org/umap-project/umap.svg?branch=master)](https://travis-ci.org/umap-project/umap) ## About diff --git a/pytest.ini b/pytest.ini index 10d3ed6f..b9589e63 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,2 @@ [pytest] -DJANGO_SETTINGS_MODULE=umap.settings.local +DJANGO_SETTINGS_MODULE=umap.settings diff --git a/requirements-dev.txt b/requirements-dev.txt index 86559899..59dc14cc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,3 @@ -pytest -pytest-django -mkdocs +pytest==3.0.7 +pytest-django==3.1.2 +mkdocs==0.16.3 diff --git a/umap/settings/base.py b/umap/settings/base.py index 19319b0b..9c9c1166 100644 --- a/umap/settings/base.py +++ b/umap/settings/base.py @@ -168,6 +168,12 @@ MAP_SHORT_URL_NAME = "umap_short_url" UMAP_USE_UNACCENT = False UMAP_FEEDBACK_LINK = "https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help" # noqa USER_MAPS_URL = 'user_maps' +DATABASES = { + 'default': { + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'NAME': 'umap', + } +} # ============================================================================= # Third party app settings diff --git a/umap/tests/settings.py b/umap/tests/settings.py new file mode 100644 index 00000000..a018ce88 --- /dev/null +++ b/umap/tests/settings.py @@ -0,0 +1,3 @@ +from umap.settings.base import * # pylint: disable=W0614,W0401 + +SECRET_KEY = 'justfortests' diff --git a/umap/views.py b/umap/views.py index 55a481e8..bfc98ab0 100644 --- a/umap/views.py +++ b/umap/views.py @@ -1,5 +1,6 @@ import json import mimetypes +import re import socket try: @@ -30,6 +31,13 @@ from leaflet_storage.forms import DEFAULT_CENTER User = get_user_model() +PRIVATE_IP = re.compile(r'((^127\.)|(^10\.)' + r'|(^172\.1[6-9]\.)' + r'|(^172\.2[0-9]\.)' + r'|(^172\.3[0-1]\.)' + r'|(^192\.168\.))') + + class PaginatorMixin(object): per_page = 5 @@ -229,8 +237,7 @@ def validate_url(request): ipaddress = socket.gethostbyname(toproxy.hostname) except: raise AssertionError() - assert not ipaddress.startswith('127.') - assert not ipaddress.startswith('192.168.') + assert not PRIVATE_IP.match(ipaddress) return url From 19fad173bb94f9510e622a09058e645e51d88036 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 17 May 2018 09:55:51 +0200 Subject: [PATCH 4/5] Fix Travis failing to load gdal --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index cca3b66d..ed33d532 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,12 @@ python: - "3.6" services: - postgresql +addons: + postgresql: "9.6" + apt: + packages: + - libgdal-dev + - postgresql-9.6-postgis-2.3 env: - UMAP_SETTINGS=umap/tests/settings.py install: From 88d78df2bc0d74bc5254605cc0bad12306bd9711 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 17 May 2018 11:10:31 +0200 Subject: [PATCH 5/5] 0.8.3 --- umap/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/__init__.py b/umap/__init__.py index c6a83330..2e1b5111 100644 --- a/umap/__init__.py +++ b/umap/__init__.py @@ -1,5 +1,5 @@ "Create maps with OpenStreetMap layers in a minute and embed them in your site." -VERSION = (0, 8, 2) +VERSION = (0, 8, 3) __author__ = 'Yohan Boniface' __contact__ = "ybon@openstreetmap.fr"