reorganize checks
This commit is contained in:
parent
3afeb5a3fd
commit
93e7fa3431
2 changed files with 12 additions and 18 deletions
|
@ -1,15 +1,14 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from asyncio import run, sleep
|
||||
from .checks import (first_checks, new_checks,
|
||||
likely_checks, unlikely_checks, top100)
|
||||
from .db import RespoDB
|
||||
from .ips import blocks, is_bogon
|
||||
from .pooler import make_simple_pooler
|
||||
from .structs import Options, Entry
|
||||
from .util import right_now, read_ips, getaddrs, detect_gfw
|
||||
from argparse import ArgumentParser
|
||||
from asyncio import run, sleep
|
||||
from sys import argv, stdin, stderr, exit
|
||||
import respodns.checks as chk
|
||||
|
||||
def process_result(res, ip, check, opts: Options):
|
||||
# TODO: get more accurate times by inserting start-end into getaddrs.
|
||||
|
@ -164,11 +163,11 @@ def ui(program, args):
|
|||
a = parser.parse_args(args)
|
||||
|
||||
checks = []
|
||||
checks += first_checks
|
||||
#checks += new_checks
|
||||
checks += likely_checks
|
||||
#checks += unlikely_checks
|
||||
#checks += top100
|
||||
checks += chk.first
|
||||
#checks += chk.new
|
||||
checks += chk.likely
|
||||
#checks += chk.unlikely
|
||||
#checks += chk.top100
|
||||
|
||||
opts = Options()
|
||||
opts.dry = a.database is None
|
||||
|
|
|
@ -25,11 +25,11 @@ def head(n, it):
|
|||
|
||||
Check = namedtuple("Check", ("kind", "domain"))
|
||||
|
||||
first_checks = [
|
||||
first = [
|
||||
Check("common", "baidu.com"), # this avoids issues with chinese censorship: https://www.bortzmeyer.org/sichuan-pepper.html
|
||||
]
|
||||
|
||||
new_checks = [
|
||||
new = [
|
||||
# via dnsvalidator
|
||||
Check("adtrack", "bet365.com"),
|
||||
Check("common", "facebook.com"),
|
||||
|
@ -39,7 +39,7 @@ new_checks = [
|
|||
Check("news", "telegram.com"),
|
||||
]
|
||||
|
||||
likely_checks = [
|
||||
likely = [
|
||||
# these checks are, in practice, the most likely to weed out unwanted DNS servers.
|
||||
Check("news", "huanqiu.com"),
|
||||
Check("adware", rot13("nqf789.pbz")),
|
||||
|
@ -69,7 +69,7 @@ likely_checks = [
|
|||
Check("common", "google.com"), # surely a fully-functional server would resolve the most popular domain in existence
|
||||
]
|
||||
|
||||
unlikely_checks = [
|
||||
unlikely = [
|
||||
Check("piracy", "thepiratebay.org"),
|
||||
Check("porn", "xvideos.com"),
|
||||
Check("usercontent","imgur.com"),
|
||||
|
@ -107,8 +107,3 @@ def _top1m_gen():
|
|||
|
||||
top100 = head(100, _top1m_gen())
|
||||
top1000 = head(1000, _top1m_gen())
|
||||
|
||||
#__all__ = [
|
||||
# "first_checks", "new_checks", "likely_checks", "unlikely_checks", "top100",
|
||||
# "defunct",
|
||||
#]
|
||||
|
|
Loading…
Reference in a new issue