Skip to content
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

secure ipfs gateway #538

Closed
wants to merge 1 commit into from
Closed

secure ipfs gateway #538

wants to merge 1 commit into from

Conversation

pldespaigne
Copy link
Contributor

@pldespaigne pldespaigne commented Nov 27, 2019

Hello guys 👋 @makoto @Arachnid @jefflau

I have updated the code to resolve ipfs hash trough a secure gateway.
This is a huge security improvement.

This PR has a dependency on this other PR 👇

Everything is detailed on the other PR

As always thanks a lot for your time and your work!

PS : you can read more about secure ipfs in this MetaMask PR

Copy link

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you really want to switch to {cid}.ipfs.dweb.link.

It solves the problem raised in MetaMask/metamask-extension#5724 with solution from ipfs/in-web-browsers#89

Both gateway.ipfs.io and .ipfs.dweb.link use the same hosting, so there won't be any difference performance-wise.

cc @parkan @chris-remus

Copy link

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pldespaigne see comment inline

@@ -39,7 +39,7 @@ const ContentHashLink = ({ value, contentType }) => {
return <DecodedError>{error}</DecodedError>
}
if (protocolType === 'ipfs') {
externalLink = `https://gateway.ipfs.io/ipfs/${decoded}`
externalLink = `https://${decoded}.ipfs.dweb.link` // using ipfs's secured origin gateway
Copy link

@lidel lidel Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
externalLink = `https://${decoded}.ipfs.dweb.link` // using ipfs's secured origin gateway
externalLink = `https://dweb.link/ipfs/${decoded}` // using ipfs's secured origin gateway

@makoto
We recommend keeping the path-based router for improved compatibility.
go-ipfs 0.5+ will redirect to correct subdomain, and go-ipfs 0.7+ will even convert CID to DNS-compatible encoding, if the default is too long (eg. if ED25519 key is used in IPNS it will use Base36 to fit in a single DNS label)

@makoto
Copy link
Member

makoto commented Oct 6, 2020

Duplicate to #936

@makoto makoto closed this Oct 6, 2020
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