diff --git a/divers.md b/divers.md new file mode 100644 index 0000000..1b33097 --- /dev/null +++ b/divers.md @@ -0,0 +1,3 @@ + +config et changement d'ip locator +https://rackerjack.uk/fail2ban-map/ diff --git a/fail2map.py b/fail2map.py index 0cd7037..6c72db9 100644 --- a/fail2map.py +++ b/fail2map.py @@ -8,7 +8,8 @@ import random JSON_FILE = "places.geojson" -GEOIP_API = "http://www.telize.com/geoip/%s" +GEOIP_API = "http://ip-api.com/json/%s" +#GEOIP_API = "http://www.telize.com/geoip/%s" ----------------- HS 404 error # free IP geolocation usually gives very approximate results # there is a big chance that we get the same place multiple times, so @@ -27,7 +28,7 @@ def find_lat_lng(ipaddr): geo_value = json.loads(req.read()) if len(geo_value) > 0: - point["geometry"]["coordinates"] = [float(geo_value['longitude']), float(geo_value['latitude'])] + point["geometry"]["coordinates"] = [float(geo_value['lon']), float(geo_value['lat'])] point["properties"]["place"] = "{0}, {1}".format(geo_value.get('city', ''), geo_value.get('country', '')) point["properties"]["show_on_map"] = True diff --git a/js/maps.js b/js/maps.js index 4157b16..cb4b949 100644 --- a/js/maps.js +++ b/js/maps.js @@ -42,7 +42,7 @@ window.onload = function() { map = L.map('map').setView([23.26, 0], 3); // list of tile providers can be seen here: http://leaflet-extras.github.io/leaflet-providers/preview/ - baseLayer = L.tileLayer.provider('Thunderforest.Landscape', { + baseLayer = L.tileLayer.provider('OpenStreetMap.Mapnik', { //Thunderforest.Landscape', { // write options and credentials here // id: 'MAPBOX_ID', // accessToken: 'MAPBOX_TOKEN'