Skip to content

Web3HostnameContentList

Source: src/Cloudflare/Web3/ContentList.ts

The IPFS content-blocking list of a Web3 universal-path gateway hostname — blocks specific CIDs or content paths from being served.

The content list is a per-hostname singleton: it always exists for an ipfs_universal_path hostname (empty by default), so this resource never creates or deletes a physical object. Reconciliation replaces the whole list declaratively via the bulk PUT, and destroy resets the list to empty.

Block a CID and a content path

const gateway = yield* Cloudflare.Web3Hostname("UniversalGateway", {
zoneId: zone.zoneId,
name: "gateway.example.com",
target: "ipfs_universal_path",
});
yield* Cloudflare.Web3HostnameContentList("Blocklist", {
zoneId: zone.zoneId,
hostnameId: gateway.hostnameId,
entries: [
{
type: "cid",
content: "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco",
description: "blocked CID",
},
{
type: "content_path",
content: "/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki",
},
],
});

Clear the blocklist

// An empty entries array removes every block (also what destroy does).
yield* Cloudflare.Web3HostnameContentList("Blocklist", {
zoneId: zone.zoneId,
hostnameId: gateway.hostnameId,
entries: [],
});