mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
IP address lookup using MaxMind GeoLite2 database
This commit is contained in:
parent
f5bfa67c69
commit
c96b1eb09d
22 changed files with 2886 additions and 32 deletions
|
@ -2608,6 +2608,7 @@ class WebInterface(object):
|
|||
"imgur_client_id": plexpy.CONFIG.IMGUR_CLIENT_ID,
|
||||
"cache_images": checked(plexpy.CONFIG.CACHE_IMAGES),
|
||||
"pms_version": plexpy.CONFIG.PMS_VERSION,
|
||||
"geoip_db": plexpy.CONFIG.GEOIP_DB
|
||||
}
|
||||
|
||||
return serve_template(templatename="settings.html", title="Settings", config=config)
|
||||
|
@ -2795,6 +2796,19 @@ class WebInterface(object):
|
|||
else:
|
||||
return {'result': 'error', 'message': 'Database backup failed.'}
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
def install_geoip_db(self):
|
||||
""" Downloads and installs the GeoIP database """
|
||||
|
||||
result = helpers.install_geoip_db()
|
||||
|
||||
if result:
|
||||
return {'result': 'success', 'message': 'GeoIP database installed successful.'}
|
||||
else:
|
||||
return {'result': 'error', 'message': 'GeoIP database install failed.'}
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth(member_of("admin"))
|
||||
def get_notification_agent_config(self, agent_id, **kwargs):
|
||||
|
@ -4244,3 +4258,12 @@ class WebInterface(object):
|
|||
pms_connect = pmsconnect.PmsConnect()
|
||||
result = pms_connect.get_update_staus()
|
||||
return result
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth()
|
||||
def get_geoip_lookup(self, ip_address='', **kwargs):
|
||||
geo_info = helpers.geoip_lookup(ip_address)
|
||||
if isinstance(geo_info, basestring):
|
||||
return {'error': geo_info}
|
||||
return geo_info
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue