Skip to content

Commit

Permalink
usingcurl/ipfs: add
Browse files Browse the repository at this point in the history
Fixes #327
  • Loading branch information
bagder committed Dec 16, 2023
1 parent 1925187 commit b98bf2b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions usingcurl.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ here to help you do your file transfer tasks as conveniently as possible.
* [TELNET](usingcurl/telnet.md)
* [DICT](usingcurl/dict.md)
* [TLS](usingcurl/tls.md)
* [IPFS](usingcurl/ipfs.md)
* [Copy as curl](usingcurl/copyas.md)
22 changes: 22 additions & 0 deletions usingcurl/ipfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# IPFS

IPFS is the *InterPlanetary File System*. curl supports IPFS only via a *HTTP
gateway*. It means that it understands IPFS URLs when given to it, but you
must also provide a working gateway URL for curl to use to retrieve the
content. curl does not speak IPFS natively.

## Gateway

The `--ipfs-gateway` lets the user specify the IPFS HTTP gateway URL. Like this:

curl --ipfs-gateway http://localhost:8080 ipfs://bafybeigagd5nmnn2iys2f3d/

If you opt to go for a remote gateway you should be aware that you completely
trust the gateway. This is fine in local gateways as you host it yourself.
With remote gateways there could potentially be a malicious actor returning
you data that does not match the request you made, inspect or even interfere
with the request. You will not notice this when getting IPFS using curl.

If the `--ipfs-gateway` option is not used, curl will check the `IPFS_GATEWAY`
environment variable for guidance and if not set, the `~/.ipfs/gateway` file
that can be used to identify the gateway.

0 comments on commit b98bf2b

Please sign in to comment.