Browse Source

more

pull/4/head
Jeff Becker 8 years ago
parent
commit
4c5c4c953c
  1. 2
      baddiefinder/baddiefinder/__main__.py
  2. 29
      baddiefinder/baddiefinder/web.py
  3. 3
      baddiefinder/requirements.txt

2
baddiefinder/baddiefinder/__main__.py

@ -17,7 +17,7 @@ def main(): @@ -17,7 +17,7 @@ def main():
args = ap.parse_args()
s = settings.load(args.settings)
fmax = s.get("thresholds", "max_floodfills_per_ip", fallback=5)
fmax = s.get("thresholds", "max_floodfills_per_ip", fallback=3)
f = filter.FloodfillFilter(fmax)
p = processor.BaddieProcessor([f])
netdb.inspect(p.hook)

29
baddiefinder/baddiefinder/web.py

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
import flask
import io
import netdb
from . import settings
from . import filter
from . import processor
app = flask.Flask(__name__)
@app.route("/baddies.txt")
def baddies():
s = settings.load('baddies.ini')
fmax = s.get("thresholds", "max_floodfills_per_ip", fallback=3)
f = filter.FloodfillFilter(fmax)
p = processor.BaddieProcessor([f])
path = s.get("netdb", "directory", fallback=None)
if path:
netdb.inspect(p.hook, path)
else:
netdb.inspect(p.hook)
body = io.BytesIO()
p.write_blocklist(body)
return body
@app.route("/")
def index():
return """this server serves a router info blocklist of ip addresses with unreasonably high desnity of i2p routers (right now just floodfills)
"""

3
baddiefinder/requirements.txt

@ -1,2 +1 @@ @@ -1,2 +1 @@
python-geoip
python-geoip-geolite2
flask

Loading…
Cancel
Save