Also change existing 'Node' type to 'ProtoNode' and use that most
everywhere for now. As we move forward with the integration we will try
and use the Node interface in more places that we're currently using
ProtoNode.
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
This change adds the /ipfs/bitswap/1.1.0 protocol. The new protocol
adds a 'payload' field to the protobuf message and deprecates the
existing 'blocks' field. The 'payload' field is an array of pairs of cid
prefixes and block data. The cid prefixes are used to ensure the correct
codecs and hash functions are used to handle the block on the receiving
end.
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
This patch is in preparation for the gateway's extraction.
It's interesting to trace technical debt back to its
origin, understanding the circumstances in which it
was introduced and built up, and then cutting it back
at exactly the right places.
- Clean up the gateway's surface
The option builder GatewayOption() now takes only
arguments which are relevant for HTTP handler muxing,
i.e. the paths where the gateway should be mounted.
All other configuration happens through the
GatewayConfig object.
- Remove BlockList
I know why this was introduced in the first place,
but it never ended up fulfilling that purpose.
Somehow it was only ever used by the API server,
not the gateway, which really doesn't make sense.
It was also never wired up with CLI nor fs-repo.
Eventually @krl started punching holes into it
to make the Web UI accessible.
- Remove --unrestricted-api
This was holes being punched into BlockList too,
for accessing /ipfs and /ipn on the API server.
With BlockList removed and /ipfs and /ipns freely
accessible, putting this option out of action
is safe. With the next major release,
the option can be removed for good.
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
The gateway accepts an X-Ipfs-Path-Prefix header,
and assumes that it is mounted in a reverse proxy
like nginx, at this path. Links in directory listings,
as well as trailing-slash redirects need to be rewritten
with that prefix in mind.
We don't want a potential attacker to be able to
pass in arbitrary path prefixes, which would end up
in redirects and directory listings, which is why
every prefix has to be explicitly allowed in the config.
Previously, we'd accept *any* X-Ipfs-Path-Prefix header.
Example:
We mount blog.ipfs.io (a dnslink page) at ipfs.io/blog.
nginx_ipfs.conf:
location /blog/ {
rewrite "^/blog(/.*)$" $1 break;
proxy_set_header Host blog.ipfs.io;
proxy_set_header X-Ipfs-Gateway-Prefix /blog;
proxy_pass http://127.0.0.1:8080;
}
.ipfs/config:
"Gateway": {
"PathPrefixes": ["/blog"],
// ...
},
dnslink:
> dig TXT _dnslink.blog.ipfs.io
dnslink=/ipfs/QmWcBjXPAEdhXDATV4ghUpkAonNBbiyFx1VmmHcQe9HEGd
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
panic: net/http: CloseNotify called after ServeHTTP finished
goroutine 180 [running]:
net/http.(*response).CloseNotify(0xc8220684e0, 0x0)
/home/r/go/src/net/http/server.go:1535 +0x9d
github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/prometheus/client_golang/
/home/r/src/github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/prome
github.com/ipfs/go-ipfs/core/corehttp.(*gatewayHandler).getOrHeadHandler.func1(0x7
/home/r/src/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:119 +
created by github.com/ipfs/go-ipfs/core/corehttp.(*gatewayHandler).getOrHeadHandle
/home/r/src/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:123 +
License: MIT
Signed-off-by: Robert Carlsen <rwcarlsen@gmail.com>
OPTIONS is a noop request that is used by the browsers
to check if server will accept cross-site XMLHttpRequest
(indicated by the presence of CORS headers)
Before this fix user could enable CORS headers in the Gateway config,
but XHR failed due to the lack of support for OPTIONS request type
(as described in https://git.io/vzgGe)
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
dont GC blocks used by pinner
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
comment GC algo
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
add lock to blockstore to prevent GC from eating wanted blocks
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
improve FetchGraph
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
separate interfaces for blockstore and GCBlockstore
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
reintroduce indirect pinning, add enumerateChildren dag method
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
Pinner had method GetManual that returned a ManualPinner, so every
Pinner had to implement ManualPinner anyway.
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
Instead put it inside of DAG.Get.
The fix is applied only in the case when the context.WithCancel
before a DAG.Get is also used later on in the scope.
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
IPNSHostnameOption() touches the URL path only on the way in,
but not on the way out. This commit makes it complete by
touching the following URLs in responses:
- Heading, file links, back links in directory listings
- Redirecting /foo to /foo/ if there's an index.html link
- Omit Suborigin header
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
implement rabin fingerprinting as a chunker for ipfs
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
vendor correctly
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
refactor chunking interface a little
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
work chunking interface changes up into importer
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
move chunker type parsing into its own file in chunk
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
this commit adds the ability to specify arbitrary HTTP headers
for either the Gateway or the API. simply set the desired headers
on the config:
ipfs config --json API.HTTPHeaders.X-MyHdr '["meow :)"]'
ipfs config --json Gateway.HTTPHeaders.X-MyHdr '["meow :)"]'
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
- First tab at integrating @krl's new index page
File icons are embedded in side icons.css (QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED contains both the icons and bootstrap)
- Fix back links (..) (fixes#1365)
Thanks @JasonWoof for the insight. The back links now stop a t the root hash and work for links that do and dont end with a slash.
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>