Closed jbenet closed 9 years ago
@harlantwood i'm going to merge this one -- fixed a newline thing and improved the makefile. thanks again!
to try it out, see: http://gateway.ipfs.io/ipfs/QmVppgFNC8TCJg3zJmSebFtZAJRSw1pS8seuYVstbzEW78/viz#QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D
(but not yet-- @lgierth looks like we haven't deployed the readable-API changes? thought we had? cc @krl)
@krl pinged me about that a couple of days ago and the gateways are running this commit since then: https://github.com/ipfs/infrastructure/commit/dd11325f869611a00987029ee8796fad310aaa23
Hrm except they don't...
explorable dag, looks very cool!!!
(the ipfs dataviz tree stored on an ipfs tree, visualized as a tree on ipfs)
Nevermind, the gateways do run ipfs/go-ipfs@fbac82046dd28e6d98c34db88db9f56d7b617027 as expected
@lgierth This is what i get:
http://gateway.ipfs.io/api/v0/cat?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/cat?arg=%2Fipns%2FQmReJX55vhC5HbkBEZFW9V37vvirR1E7s2JW63cRt23BiN&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/object/get?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/id?stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/object/get?arg=%2Fipns%2FQmReJX55vhC5HbkBEZFW9V37vvirR1E7s2JW63cRt23BiN&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
The id should fail of course
maybe an nginx route missing?
I know, I get the same.
This seems to work fine though:
curl -v 'gateway.ipfs.io/api/v0/cat?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true'
and also works if I directly request it in the browser: http://gateway.ipfs.io/api/v0/cat?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true
Not sure what's happening, maybe a lack of CORS headers or something like that?
Mh no, it must be nginx yielding a 403 for some reason.
oh it might be CORS, not sure. see the updated docs on ipfs daemon
:
> ipfs daemon --help
<snip>
HTTP Headers
IPFS supports passing arbitrary headers to the API and Gateway. You can
do this by setting headers on the API.HTTPHeaders and Gateway.HTTPHeaders
keys:
ipfs config --json API.HTTPHeaders.X-Special-Header '["so special :)"]'
ipfs config --json Gateway.HTTPHeaders.X-Special-Header '["so special :)"]'
Note that the value of the keys is an _array_ of strings. This is because
headers can have more than one value, and it is convenient to pass through
to other libraries.
CORS Headers (for API)
You can setup CORS headers the same way:
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
DEPRECATION NOTICE
Previously, IPFS used an environment variable as seen below:
export API_ORIGIN="http://localhost:8888/"
This is deprecated. It is still honored in this version, but will be removed in a
future version, along with this notice. Please move to setting the HTTP Headers.
as on irc: gateway api test page:
http://gateway.ipfs.io/ipfs/QmZmgC5Cw1scmQwUZp9X7QZBPFyPrXt1Uz1hXYSTeV1tL1/
same page but local:
http://localhost:5001/ipfs/QmZmgC5Cw1scmQwUZp9X7QZBPFyPrXt1Uz1hXYSTeV1tL1/
Awesome, looks like this is working on the gateway now : )
@harlantwood nice!
btw, looks like the dag is unixfs aware? (i.e. distinguishes files and dirs). so i cant use it to visualize file chunking algorithms. it may be worth not distinguishing unixfs, and just showing the raw dag (i.e. files have links too)
Not on purpose ; )
It's pulling all refs from the refs api call: https://github.com/ipfs/dataviz/pull/5/files#diff-aab1e940c09e6ef405d72f6e75b9a432R15
Is that call suppose to be unixfs aware?
We are switching over to using the ipfs node api lib, and the ls
command from that, in another viz. We could move this D3 viz to that too, if that call is better behaved...
e27f6a4 (Juan Batiz-Benet, 3 minutes ago)
ffdb0b2 (Juan Batiz-Benet, 14 hours ago)
a383961 (Juan Batiz-Benet, 14 hours ago)
e44b51a (Harlan T Wood, 2 months ago)
107ec66 (Harlan T Wood, 3 months ago)
6021cea (Harlan T Wood, 3 months ago)
1e5b0a2 (Harlan T Wood, 3 months ago)