Skip to content

add: [tools] generator for public-ipfs-gateways - #381

Merged
adulau merged 2 commits into
MISP:mainfrom
elhoim:warninglists/add-ipfs-generator
Aug 30, 2026
Merged

add: [tools] generator for public-ipfs-gateways#381
adulau merged 2 commits into
MISP:mainfrom
elhoim:warninglists/add-ipfs-generator

Conversation

@elhoim

@elhoim elhoim commented Aug 29, 2026

Copy link
Copy Markdown
Member

What

Adds tools/generate-public-ipfs-gateways.py, an automated generator for the previously hand-maintained lists/public-ipfs-gateways/list.json (frozen since 2025-03-19), and registers it in generate_all.sh.

Source

The requested source, https://ipfs.github.io/public-gateway-checker/, is a client-side JS SPA and cannot be scraped with requests. It renders from two JSON data files in the same GitHub repo, which the generator fetches directly:

  • https://raw.githubusercontent.com/ipfs/public-gateway-checker/main/gateways.json
  • https://raw.githubusercontent.com/ipfs/public-gateway-checker/main/onion-gateways.json

Both verified to return HTTP 200 with small JSON arrays of gateway origin URLs (e.g. "https://ipfs.filebase.io").

Normalization

Each entry is parsed with urlparse(...).hostname to strip scheme, port, path and any legacy :hash placeholder, then lowercased and trailing-dot-stripped, matching the bare-hostname shape already used by the existing list (type: string, matching_attributes: domain/hostname/domain|ip/url/uri).

Important: list size will shrink significantly (89 -> 14)

This is a genuine upstream change, not a bug. Upstream commit 73103999 ("chore: trim gateway list", 2026-08-21) deliberately removed ipfs.io, dweb.link, and trustless-gateway.link because bots/scrapers were probing all three shared-backend hostnames, tripling non-organic load; commit 782d89aa removed further dead gateways. Only 3 of the original 89 MISP entries survive unchanged (4everland.io, gateway.pinata.cloud, ipfs.cyou); storry.tv survives as a rename (ipfs.storry.tv). This PR (script + generate_all.sh only, per the intended two-PR split) does not itself change list.json content review scope, but running the generator will produce a much smaller list — flagging this explicitly for review rather than shipping it silently.

Validation

  • jsonschema -i lists/public-ipfs-gateways/list.json schema.json -> exit 0
  • tools/validate_values.py -> exit 0
  • generators.log shows no ERROR/WARNING for this run
  • README.md index entry for this list already existed and needed no change
  • generate_all.sh entry inserted next to generate-github.py rather than appended at the end, to avoid colliding with other in-flight PRs

🤖 Generated with Claude Code

https://claude.ai/code/session_0121gk7vaCXX9bMri7tC9XVd

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0121gk7vaCXX9bMri7tC9XVd
try:
with open(get_abspath_list_file("public-ipfs-gateways")) as existing_file:
hostnames.update(json.load(existing_file)["list"])
except (IOError, OSError, ValueError, KeyError):
@adulau
adulau merged commit 7a09ae8 into MISP:main Aug 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants