-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust logic for IPFS redirections #21505
Comments
related issue #21454 |
This was referenced Jul 5, 2022
This was referenced Sep 12, 2022
This was referenced Oct 20, 2022
This was referenced Dec 5, 2022
The IPFS local node and scheme has been deprecated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are 2 options and we need to prioritise rules between each other
Redirect IPFS resources to the configured IPFS gateway
Automatically redirect to IPFS pages via DNSLink when possible
If (1) is enabled, we detect
/ipfs/{cid}
in URL, confirm{cid}
is a real CID, and if so, redirect that toipfs://{cid}
(local node) orhttps://dweb.link/ipfs/{cid}
(gateway).If (2) is enabled, we either do DNSLink lookup for every domain name (only if server returned 5xx error codes), or only if
x-ipfs-path
is present. If we confirm DNSLink is present (we only care about its presence, not its value), then we redirect toipns://{example.com}
(local node) orhttps://dweb.link/ipns/{example.com}
(gateway), and IPFS node will resolve DNSLink and load the correct data internally.Test cases:
https://blog.ipfs.io/24-uncensorable-wikipedia -> ipns://blog.ipfs.io/24-uncensorable-wikipedia
https://en.wikipedia-on-ipfs.org/wiki/Wikipedia/ -> ipns://en.wikipedia-on-ipfs.org/wiki/Wikipedia/
if we have both (1) and (2) enabled then links like
https://ipfs.io/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
that have both both/ipfs/{cid}
resources and a DNSLink, the logic from (1) should take a priority and we have to end up on http://localhost:48080/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnRThe text was updated successfully, but these errors were encountered: