ipfs-chrome-extension icon indicating copy to clipboard operation
ipfs-chrome-extension copied to clipboard

ipfs.pics support?

Open interfect opened this issue 10 years ago • 6 comments

Can you make the actual image urls from ipfs.pics go through the local gateway instead?

interfect avatar Nov 21 '15 07:11 interfect

I think adding a configuration option where user can provide a list of domains from which https?://<domain>/ipfs/ is redirected to the local gateway is a better idea.

That way not only ipfs.pics is supported, but any other site.

lidel avatar Nov 22 '15 11:11 lidel

make sense to me.

want to point out --though-- that:

ipfs.pics/<hash>  !=  ipfs.io/ipfs/<hash>

See:

  • https://ipfs.pics/QmagBFqo41RrHpk3GKvBCpjrd2H61ntgaQWNMVasZuJJn3
  • https://ipfs.io/ipfs/QmagBFqo41RrHpk3GKvBCpjrd2H61ntgaQWNMVasZuJJn3

the ipfs.pics server returns the ipfs.pics UI in the same page. I would probably build it with URIs like this:

  • /ipns/ipfs.pics/view#/ipfs/QmagBFqo41RrHpk3GKvBCpjrd2H61ntgaQWNMVasZuJJn3
  • /dns/ipfs.pics/#/ipfs/QmagBFqo41RrHpk3GKvBCpjrd2H61ntgaQWNMVasZuJJn3

So the app is always returned, and the parameter is fed to the app directly via the URI hash (or query string params).

jbenet avatar Dec 01 '15 02:12 jbenet

though yeah, hash-links are really annoying... maybe we can come up with some way to make ipfs implementations understand that a url like:

  • /dns/ipfs.pics/view/ (where /<rest> could be /ipfs/<hash>)

means

  • use the app at /dns/ipfs.pics/view
  • feed /<rest> to that app.

maybe we could establish a convention of defining apps such that ipfs implementations know to load a resource and feed "the rest of the path" to the app? (the same way that unix file systems will defer to a filesystem implementation mounted at a particular mount point, and feed the rest of the path to that, or the way that url routers in servers (or single page webapps) work)

jbenet avatar Dec 01 '15 02:12 jbenet

maybe continue that part of the discussion here https://github.com/ipfs/notes/issues/73

jbenet avatar Dec 01 '15 02:12 jbenet

Even with current design of ipfs.pics we can fetch images from IPFS. Look at the actual, direct URL of a single image -- It is what we expect:

<img src="//ipfs.pics/ipfs/QmagBFqo41RrHpk3GKvBCpjrd2H61ntgaQWNMVasZuJJn3" class="picture">

Which gives:

ipfs.pics/ipfs/<hash>  ==  ipfs.io/ipfs/<hash>

FYI I added ipfs.pics to the list of known public IPFS gateways in ipfs-firefox-addon v1.3.1

To be precise, the implementation in my addon is that only URLs matching

<one-of-whitelisted-gateway-hosts>/ipfs/<hash>

are redirected to a local gateway

lidel avatar Dec 02 '15 10:12 lidel

oh nice

jbenet avatar Dec 02 '15 17:12 jbenet