1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 03:19:47 +08:00

211 Commits

Author SHA1 Message Date
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
7992025254 fix(gw): 404 when a valid DAG is missing link 2022-07-23 00:16:31 +02:00
3182986151 fix(gw): ensure dir URLs have trailing slash
This fixes a regression around directory listing and index.html hosting.
Seems that during one of recent refactors code changed and we no longer
check for trailing slash in HTTP request path, but look at content path
instead.

This cleans this up and also ensures dir behavior is the same for
both index.html hosting and dir-index-html (generated listing).

It also adds more tests so we catch any future regressions.
2022-07-21 21:06:18 +02:00
a6687744c7 fix(gw): no backlink when listing root dir
Closes #9071
2022-07-18 23:35:44 +00:00
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
a433064d72 chore: replace ioutil with io and os (#8969)
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
2022-06-14 12:37:02 -04:00
67fdb6efcd feat(gw): improved If-None-Match support (#8891)
Improves the way we handle If-None-Match header:
- Support for more than one Etag passed in If-None-Match
- Match both strong and weak Etags to maximize caching across
  various HTTP clients and libraries (some send weak Etags by default)
- Support for wildcard '*'
- Tests for If-None-Match behavior
2022-04-19 20:57:11 +02:00
4cabdfefbf feat(gateway): Block and CAR response formats (#8758)
* feat: serveRawBlock implements ?format=block
* feat: serveCar implements ?format=car
* feat(gw): ?format= or Accept HTTP header

- extracted file-like content type responses to separate .go files
- Accept HTTP header with support for application/vnd.ipld.* types

* fix: use .bin for raw block content-disposition

.raw may be handled by something, depending on OS, and .bin
seems to be universally "binary file" across all systems:
https://en.wikipedia.org/wiki/List_of_filename_extensions_(A%E2%80%93E)

* refactor: gateway_handler_unixfs.go

- Moved UnixFS response handling to gateway_handler_unixfs*.go files.
- Removed support for X-Ipfs-Gateway-Prefix (Closes #7702)

* refactor: prefix cleanup and readable paths

- removed dead code after X-Ipfs-Gateway-Prefix is gone
  (https://github.com/ipfs/go-ipfs/issues/7702)
- escaped special characters in content paths returned with http.Error
  making them both safer and easier to reason about (e.g. when invisible
  whitespace Unicode is used)
2022-03-17 17:15:24 +01:00
8d549f03f3 fix: rewrite dependencies over the go-ipfs-config package 2022-03-04 09:45:16 +01:00
0b923b7951 chore: update dir-index-html to v1.2.2
https://github.com/ipfs/dir-index-html/releases/tag/1.2.2
2021-10-07 12:42:17 -04:00
3a84352f18 feat(cli): add daemon option --agent-version-suffix (#8419)
* feat(cli): add daemon option --agent-version-suffix
* fix sharness test when commit is empty (release)
2021-09-21 20:31:08 +02:00
3db9551f79 Extract the namesys and the keystore submodules
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can
resolve and publish /ipns/ paths.

This functionality does not need to be sequestered inside go-ipfs as it can
and should be used without IPFS, for example, for implementing lightweight
IPNS publishing services or for resolving /ipns/ paths.

"keystore" extraction was necessary, as there is a dependency to it in
namesys. Keystore is also a useful module by itself within the stack.

Fixes #6537
2021-03-12 14:09:36 -05:00
a0f90d3a14 test: cover 2 remaining lines 2021-01-14 20:53:20 +01:00
3de5b14e0c fix: ?uri= url-decode and preserve query
This makes ?uri= param able to process URIs passed by web browsers
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
2021-01-14 20:52:04 +01:00
36368ee4dd feat: support requests from registerProtocolHandler
This commit adds support for requests produced by navigator.registerProtocolHandler on gateways. Now one can register `dweb.link` as an URI handler for `ipfs://`:

```
navigator.registerProtocolHandler('ipfs', 'https://dweb.link/ipfs/?uri=%s', 'ipfs resolver')
```

Then opening `ipfs://QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR` will produce an HTTP GET call to:

```
https://dweb.link/ipfs?uri=ipfs%3A%2F%2FQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
```

The query parameter `uri` will now be parsed and the given content identifier resolved via:

`https://dweb.link/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR`
2021-01-14 20:52:04 +01:00
3ed46d995f test(gw): add t0115-gateway-dir-listing.sh to sharness
This adds proper end-to-end tests for directory listing on Gateway port
that protects us against regressions oni each gw type:
- path gateway
- subdomain gateway
- dnslink website gateway

Tests cover:
- etag/unicode support
- breadcrumbs
- file name column
- hash column
2020-09-29 02:27:28 +02:00
cd1feb3af4 fix(gateway): correct breadcrumbs on dnslink site 2020-09-25 23:11:53 +02:00
bd08c0a4a6 Merge pull request #7550 from trashhalo/dry-up-close
use t.Cleanup() to reduce the need to clean up servers in tests
2020-08-25 12:06:26 -04:00
2feff33235 test: update gateway tests for dir-index-html v1.1.0 2020-08-19 20:31:23 -04:00
4dbdbe0e02 use t.Cleanup() to reduce the need to clean up servers 2020-07-18 14:47:07 -04:00
6a2fe0a20d fix: support directory listings even if a 404 page is present
fixes https://github.com/ipfs/go-ipfs/pull/4233#issuecomment-631454543

Basically, there's a trade-off here:

1. We can support directory listings while supporting 404 pages (this PR).
2. If a 404 page is present, directory listings don't work.

Given that option 1 is more flexible and users shouldn't be _too_ confused if
they land on a directory with no index.html page, I've gone with that option.
2020-05-20 19:11:50 -07:00
dfceafdbd3 Gateway renders pretty 404 pages if available
In the same way that an `index.html` file is rendered, if one is present, when the
requested path is a directory, now an `ipfs-404.html` file is rendered if
the requested file is not present within the specified IPFS object.

`ipfs-404.html` files are looked for in the directory of the requested path and each
parent until one is found, falling back on the well-known 404 error message.

License: MIT
Signed-off-by: JP Hastings-Spital <jphastings@gmail.com>
2020-05-19 14:41:21 -07:00
46ae021733 feat: show the absolute path every time
Even for dnslink websites.

fixes https://github.com/ipfs/go-ipfs/issues/7205
2020-04-26 17:19:17 -07:00
3ecccd6e1d feat(gateway): subdomain and proxy gateway
License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2020-03-18 08:50:38 -07:00
5eea0a4ba0 http: use Method* constants
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-01-10 10:19:08 +01:00
853ed0be5d chore: fix deprecation warnings 2019-09-26 15:38:12 -07:00
e8c2852179 migrate to go-libp2p-core.
closes #6391

License: MIT
Signed-off-by: Raúl Kripalani <raul@protocol.ai>
2019-05-31 23:23:52 -07:00
667b7f9927 coreiface: updates for moving path to subpackage
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
1f293eff1b chore: fix a bunch of issues caught by golangci-lint
Most of these are probably harmless but a few looked like they might actually be
bugs. Most of them are just faulty tests.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-29 11:57:45 +00:00
c5b81e918f coreapi: remove hidden file handling in add
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-03-21 19:17:58 +01:00
2e8bb8c0e6 coreapi add wrap: fix gotests
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-03-21 19:17:58 +01:00
dc6423f7de gomod/gx: use correct go-is-domain
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:58 +01:00
42e191c017 gx: unrewrite
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:56 +01:00
23616af314 fix gateway_test on 32bit oses
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-04 19:35:43 -08:00
f227862e88 gx: update go-ipfs-cmds, go-bitswap, go-libp2p-kad-dht, and go-mplex
Fixes the latest batch of bugs found in RC testing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-27 12:39:24 -08:00
6972a9aa4d Gx Bubble. libp2p-6.0.38
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-02-27 01:10:59 +00:00
fea7ae727f gx: update go-cid
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 20:29:06 -08:00
f924f57c61 gx: update go-bitswap and go-libp2p-kad-dht
* go-bitswap: fix some race conditions.
* go-libp2p-kad-dht: fix a goroutine leak.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 17:19:54 -08:00
91ca5911be coreapi: return coreiface.ErrNotSupported when "catting" symlinks.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-19 03:48:04 -08:00
28cf3de0f9 Update protobuf
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-02-18 20:46:22 +01:00
cf0d4706e2 gx: update libp2p stuff
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-14 14:58:35 -08:00
e97a60b073 gx: update go-ipfs-files
fix compatibility issue with js-ipfs

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-11 10:48:58 -08:00
648cc40ec3 coreapi: fix import grouping after extracting iface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-09 01:57:26 +01:00
7ed6b518b6 coreapi: update imports to updated interface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-09 01:42:32 +01:00
1ff6349729 coreapi: move namesys options to coreapi
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-08 19:27:39 +01:00
2c93eeffc6 gx: update go-libp2p-peer
Switch _back_ to the 0.4.18 style of peer IDs while we figure things out. See
https://github.com/libp2p/specs/issues/138.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-07 17:41:39 -08:00
7c2aa0e9a9 gx: update go-unixfs to propagate archive changes
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-30 20:58:32 +01:00
a49c07a176 Drop some coreunix code
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-24 04:16:55 -08:00
53e55e3314 gx: update go-unixfs to 1.2.14 and go-bitswap to 1.1.21
(and everything else...)

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-23 11:01:38 -08:00
08cc5da55f gx: update deps
Importantly:

* fixes a bunch of MFS bugs
* pulls in some bitswap improvements

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-08 19:19:34 -08:00