Skip to content

secure ipfs gateway#538

Closed
pldespaigne wants to merge 1 commit intoensdomains:devfrom
pldespaigne:ipfs_base32_cid_v1
Closed

secure ipfs gateway#538
pldespaigne wants to merge 1 commit intoensdomains:devfrom
pldespaigne:ipfs_base32_cid_v1

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

}
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