SPB Git forge
15commits 1branches 0releases
29.7 MBsize
maindefault branch
10 days agolast push
TypeScript 36.3% Python 31.8% Go 18% JavaScript 9.8% Shell 1.9% SQL 1.4% CSS 0.5%

seed: coerce YAML scalars to strings

Simon-Pierre Boucher committed 11 days ago (Sep 13, 2026) parent 9431fc5

1 changed file +5 −2

modified apps/api/src/internetpressure/registry.py +5 −2
@@ -262,8 +262,11 @@ async def seed(*, targets: bool = True, services: bool = True, probes: bool = Tr
262 262 log.info("seed: %d fragment entries skipped as duplicates (id or host)", skipped)
263 263 for t in all_targets:
264 264 row = {
265 "target_id": str(t["id"]), "name": str(t["name"]), "hostname": str(t["host"]), "url": t.get("url"), "ip": t.get("ip"),
266 "port": t.get("port", 443), "category": t["cat"], "provider": t.get("provider"), "service_id": t.get("svc"),
265 + "target_id": str(t["id"]), "name": str(t["name"]), "hostname": str(t["host"]),
266 + "url": None if t.get("url") is None else str(t["url"]), "ip": None if t.get("ip") is None else str(t["ip"]),
267 + "port": t.get("port", 443), "category": str(t["cat"]),
268 + "provider": None if t.get("provider") is None else str(t["provider"]),
269 + "service_id": None if t.get("svc") is None else str(t["svc"]),
267 270 "country": t.get("cc"), "region": regions.region_of_country(t.get("cc")),
268 271 "importance": t.get("imp", defaults.get("imp", 3)), "tier": t.get("tier", defaults.get("tier", 2)),
269 272 "checks": t.get("checks", defaults.get("checks", ["http", "dns", "ping"])),
270 273