From 1ee3ccf724597ea009cc7b15562b42eb6cc854f3 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 3 Sep 2020 13:24:38 +0200 Subject: [PATCH] only add a couple IPs and no kinds during database creation --- respodns/db.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/respodns/db.py b/respodns/db.py index 7db2782..ed7aa7e 100644 --- a/respodns/db.py +++ b/respodns/db.py @@ -134,29 +134,14 @@ class RespoDB: self.new_exception(name="Timeout", fail=True) def setup_ips(self): - from .ips import china, blocks - self._fire(create_table_statements["ips"]) - # TODO: upsert? - - self.new_address(ip=addr_to_int("0.0.0.0"), block_target=True) - self.new_address(ip=addr_to_int("127.0.0.1"), block_target=True) - for ip in china: - self.new_address(ip=addr_to_int(ip), china=True) - for ip in blocks: - self.new_address(ip=addr_to_int(ip), block_target=True) + self.modify_address("0.0.0.0", block_target=True) + self.modify_address("127.0.0.1", block_target=True) def setup_kinds(self): self._fire(create_table_statements["kinds"]) - # TODO: upsert? - - if 0: - NXDOMAIN = self.find_one(TException, TException.name == "NXDOMAIN") - self.new_kind(name="bad", exception=NXDOMAIN) - self.new_kind(name="badsub", exception=NXDOMAIN) - def setup_domains(self): self._fire(create_table_statements["domains"])