Compare commits
No commits in common. "db9009bb28384daa7e35f6be63906c8225fb8246" and "d78739157b72c9769fd9aa8b6392c723f2241f49" have entirely different histories.
db9009bb28
...
d78739157b
File diff suppressed because one or more lines are too long
|
@ -59,7 +59,7 @@ compress_output_files = ['html', 'css', 'js']
|
||||||
locales_path = './locales'
|
locales_path = './locales'
|
||||||
|
|
||||||
# Default locale (english)
|
# Default locale (english)
|
||||||
locale = 'en'
|
locale = 'en_EN'
|
||||||
|
|
||||||
# Don't keep requests of all visitors into database
|
# Don't keep requests of all visitors into database
|
||||||
keep_requests = False
|
keep_requests = False
|
||||||
|
|
18
display.py
18
display.py
|
@ -365,20 +365,20 @@ class DisplayHTMLPage(object):
|
||||||
self.logger.debug('Write %s' % (filename))
|
self.logger.debug('Write %s' % (filename))
|
||||||
|
|
||||||
f = codecs.open(filename, 'w', 'utf-8')
|
f = codecs.open(filename, 'w', 'utf-8')
|
||||||
f.write(u'<!DOCTYPE html>\n')
|
f.write(u'<!DOCTYPE html>')
|
||||||
f.write(u'<html lang="{}">\n'.format(self.iwla.getConfValue('locale', 'en')))
|
f.write(u'<html>')
|
||||||
f.write(u'<head>\n')
|
f.write(u'<head>')
|
||||||
f.write(u'<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>\n')
|
f.write(u'<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />')
|
||||||
f.write(u'<link rel="icon" type="image/png" href="/resources/icon/favicon.png"/>\n')
|
f.write(u'<link rel="icon" type="image/png" href="/resources/icon/favicon.png"/>')
|
||||||
for css in self.css_path:
|
for css in self.css_path:
|
||||||
f.write(u'<link rel="stylesheet" href="/%s"/>\n' % (css))
|
f.write(u'<link rel="stylesheet" href="/%s"/>' % (css))
|
||||||
if self.title:
|
if self.title:
|
||||||
f.write(u'<title>%s</title>\n' % (self.title))
|
f.write(u'<title>%s</title>' % (self.title))
|
||||||
f.write(u'</head><body>\n')
|
f.write(u'</head><body>')
|
||||||
for block in self.blocks:
|
for block in self.blocks:
|
||||||
block.build(f, filters=filters)
|
block.build(f, filters=filters)
|
||||||
if displayVersion:
|
if displayVersion:
|
||||||
f.write(u'<div style="text-align:center;width:100%%">Generated by <a href="%s">IWLA %s</a></div>\n' %
|
f.write(u'<div style="text-align:center;width:100%%">Generated by <a href="%s">IWLA %s</a></div>' %
|
||||||
("http://indefero.soutade.fr/p/iwla", self.iwla.getVersion()))
|
("http://indefero.soutade.fr/p/iwla", self.iwla.getVersion()))
|
||||||
f.write(u'</body></html>')
|
f.write(u'</body></html>')
|
||||||
f.close()
|
f.close()
|
||||||
|
|
4
iwla.py
4
iwla.py
|
@ -605,11 +605,11 @@ class IWLA(object):
|
||||||
break
|
break
|
||||||
|
|
||||||
def _generateDisplay(self):
|
def _generateDisplay(self):
|
||||||
if self.args.disable_display: return
|
if self.args.dry_run or\
|
||||||
|
self.args.disable_display: return
|
||||||
self._generateDisplayDaysStats()
|
self._generateDisplayDaysStats()
|
||||||
self._callPlugins(conf.DISPLAY_HOOK_DIRECTORY)
|
self._callPlugins(conf.DISPLAY_HOOK_DIRECTORY)
|
||||||
self._generateDisplayWholeMonthStats()
|
self._generateDisplayWholeMonthStats()
|
||||||
if self.args.dry_run: return
|
|
||||||
self.display.build(conf.DISPLAY_ROOT)
|
self.display.build(conf.DISPLAY_ROOT)
|
||||||
self._compressFiles(conf.DISPLAY_ROOT)
|
self._compressFiles(conf.DISPLAY_ROOT)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import json
|
||||||
|
|
||||||
def geoiplookup(ip):
|
def geoiplookup(ip):
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
r = http.request('GET', f'http://ip-api.com/json/{ip}')
|
r = http.request('GET', f'https://api.geoiplookup.net/?query={ip}&json=true')
|
||||||
|
|
||||||
if r.status != 200:
|
if r.status != 200:
|
||||||
raise Exception(r)
|
raise Exception(r)
|
||||||
|
|
|
@ -85,8 +85,8 @@ class IWLADisplayFilterUsers(IPlugin):
|
||||||
isp = location.get('isp', '')
|
isp = location.get('isp', '')
|
||||||
str_location = ''
|
str_location = ''
|
||||||
city = location.get('city', unknown)
|
city = location.get('city', unknown)
|
||||||
country = location.get('country', unknown)
|
country = location.get('countryname', unknown)
|
||||||
if location.get('city', '') or location.get('country', ''):
|
if location.get('city', '') or location.get('countryname'):
|
||||||
str_location = f'{city}/{country}'
|
str_location = f'{city}/{country}'
|
||||||
if isp:
|
if isp:
|
||||||
if str_location: str_location += '<br/>'
|
if str_location: str_location += '<br/>'
|
||||||
|
|
|
@ -59,9 +59,7 @@ class IWLADisplayVisitorIP(IPlugin):
|
||||||
|
|
||||||
def processIP(self, host_name, ip):
|
def processIP(self, host_name, ip):
|
||||||
host_name = host_name.replace(ip, 'IP')
|
host_name = host_name.replace(ip, 'IP')
|
||||||
# IPv4
|
|
||||||
ip = ip.replace('.', '-')
|
ip = ip.replace('.', '-')
|
||||||
# IPv6
|
|
||||||
ip = ip.replace(':', '-')
|
ip = ip.replace(':', '-')
|
||||||
host_name = host_name.replace(ip, 'IP')
|
host_name = host_name.replace(ip, 'IP')
|
||||||
ip = ip.replace('-', '')
|
ip = ip.replace('-', '')
|
||||||
|
|
|
@ -136,7 +136,6 @@ class IWLAPostAnalysisReferers(IPlugin):
|
||||||
for r in super_hit['requests'][::-1]:
|
for r in super_hit['requests'][::-1]:
|
||||||
if not self.iwla.isValidForCurrentAnalysis(r): break
|
if not self.iwla.isValidForCurrentAnalysis(r): break
|
||||||
if not r['http_referer']: continue
|
if not r['http_referer']: continue
|
||||||
if not self.iwla.hasBeenViewed(r): continue
|
|
||||||
|
|
||||||
uri = r['extract_referer']['extract_uri']
|
uri = r['extract_referer']['extract_uri']
|
||||||
if self.own_domain_re.match(uri): continue
|
if self.own_domain_re.match(uri): continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user