]> git.ipfire.org Git - location/libloc.git/commitdiff
importer: Import Spamhaus DROP feeds into the new feeds table
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Mar 2024 09:45:19 +0000 (09:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Mar 2024 09:45:19 +0000 (09:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 878710d8c8c68fde1710ce13a443493e50be4757..dfdc79a31c5dbbb7d0a0bf96f62af3055aa7facd 100644 (file)
@@ -1835,7 +1835,7 @@ class CLI(object):
                                # Conduct a very basic sanity check to rule out CDN issues causing bogus DROP
                                # downloads.
                                if len(fcontent) > 10:
-                                       self.db.execute("DELETE FROM network_overrides WHERE source = %s", name)
+                                       self.db.execute("DELETE FROM network_feeds WHERE source = %s", name)
                                else:
                                        log.warning("%s (%s) returned likely bogus file, ignored" % (name, url))
                                        continue
@@ -1865,15 +1865,17 @@ class CLI(object):
 
                                        # Conduct SQL statement...
                                        self.db.execute("""
-                                               INSERT INTO network_overrides(
+                                               INSERT INTO
+                                                       network_feeds
+                                               (
                                                        network,
                                                        source,
                                                        is_drop
-                                               ) VALUES (%s, %s, %s)
-                                               ON CONFLICT (network) DO UPDATE SET is_drop = True""",
-                                               "%s" % network,
-                                               name,
-                                               True
+                                               )
+                                               VALUES
+                                               (
+                                                       %s, %s, %s
+                                               )""", "%s" % network, name, True,
                                        )
 
                for name, url in asn_lists: