Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions divers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

config et changement d'ip locator
https://rackerjack.uk/fail2ban-map/
5 changes: 3 additions & 2 deletions fail2map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion js/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down