1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-12-19 01:30:17 +08:00
Commit Graph

316 Commits

Author SHA1 Message Date
Gus Eggert
b9a4d4592d chore: migrate ipfs/tar-utils to libipfs 2022-12-05 21:28:30 -05:00
Jorropo
4d4841f41c Merge pull request #9318 from ipfs/rvagg/go-merkledag-0.8 2022-12-05 15:15:12 +01:00
Antonio Navarro Perez
5283c6f8b5 chore: Update go-routing-helpers dependency
It will avoid a deadlock when using parallel router to compose routers.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-12-02 13:42:28 -05:00
Rod Vagg
7d0ea08289 deps: go-merkledag@v0.8.1 2022-12-02 10:16:15 +11:00
Mohsin Zaidi
51f60ea05a feat(config): Pubsub.SeenMessagesTTL (#9372)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-11-29 00:05:44 +01:00
Antonio Navarro Perez
6f5e226de6 fix: update go-unixfs lib to v0.4.1
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-11-15 21:51:43 +01:00
Antonio Navarro Perez
9da7f3a02d Update to v0.23.4
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-11-10 10:49:08 -05:00
Antonio Navarro Perez
3550758035 chore: Update go-libp2p to v0.23.3
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-11-10 10:48:07 -05:00
Antonio Navarro Perez
254d81a9d5 feat: Improve ResourceManager UX (#9338)
This PR adds several new functionalities to make easier the usage of ResourceManager:

- Now resource manager logs when resources are exceeded are on ERROR instead of warning.
- The resources exceeded error now shows what kind of limit was reached and the scope.
- When there was no limit exceeded, we print a message for the user saying that limits are not exceeded anymore.
- Added `swarm limit all` command to show all set limits with the same format as `swarm stats all`
- Added `min-used-limit-perc` option to `swarm stats all` to only show stats that are above a specific percentage
- Simplify a lot default values.
- **Enable ResourceManager by default.**

Output example:
```
2022-11-09T10:51:40.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:51:50.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 483095 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:51:50.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:00.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 455294 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:00.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:10.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 471384 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:10.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 8 times with error "peer:12D3KooWKqcaBtcmZKLKCCoDPBuA6AXGJMNrLQUPPMsA5Q6D1eG6: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 192 times with error "peer:12D3KooWPjetWPGQUih9LZTGHdyAM9fKaXtUxDyBhA93E3JAWCXj: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 469746 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 484137 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 29 times with error "peer:12D3KooWPjetWPGQUih9LZTGHdyAM9fKaXtUxDyBhA93E3JAWCXj: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:40.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 468843 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:40.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:50.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 366638 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:50.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:00.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 405526 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:00.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 107 times with error "peer:12D3KooWQZQCwevTDGhkE9iGYk5sBzWRDUSX68oyrcfM9tXyrs2Q: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:00.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:10.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 336923 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:10.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 71 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:64      Resrouce limits are no longer being exceeded.

```
## Validation tests

- Accelerated DHT client runs with no errors when ResourceManager is active. No problems were observed.
- Running an attack with 200 connections and 1M streams using yamux protocol. Node was usable during the attack. With ResourceManager deactivated, the node was killed by the OS because of the amount of memory consumed.
	- Actions done when the attack was active:
		- Add files 
		- Force a reprovide
		- Use the gateway to resolve an IPNS address.

It closes #9001 
It closes #9351
It closes #9322
2022-11-10 12:25:57 +01:00
Henrique Dias
a210abd743 feat(gateway): TAR response format (#9029)
Implementation of IPIP-288 (https://github.com/ipfs/specs/pull/288)

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-11-09 19:20:33 +01:00
Marcin Rataj
d69f7a5ac9 chore: go-multicodec v0.7.0
https://github.com/multiformats/go-multicodec/releases/tag/v0.7.0
2022-11-08 18:33:36 +01:00
Gus Eggert
8c72ea909a feat: add delegated routing metrics (#9354) 2022-10-19 09:50:30 -04:00
Rod Vagg
9e3745ebeb deps: upgrade go-ipld-prime to v0.19.0
Ref: https://github.com/ipld/go-ipld-prime/releases/tag/v0.19.0
2022-10-14 05:23:43 +02:00
Jorropo
baccaef1b5 Merge pull request #9293 from Jorropo/webtransport
feat: add webtransport as an optin transport
2022-09-23 20:09:33 +02:00
Jorropo
8baec10146 feat: add webtransport as an optin transport 2022-09-23 19:50:55 +02:00
Justin Johnson
bcaacdd6c3 feat(gateway): _redirects file support (#8890)
https://github.com/ipfs/kubo/pull/8890
https://github.com/ipfs/specs/pull/290
2022-09-23 18:44:19 +02:00
Antonio Navarro Perez
d1b9e41fc2 feat: Delegated routing with custom configuration. (#9274)
New multi-router configuration system based on https://hackmd.io/G1KRDEX5T3qyfoBMkIrBew#Methods

- Added a new routing type: "custom"
- Added specific struct types for different Routers (instead of map[string]interface{})
- Added `Duration` config type, to make easier time string parsing
- Added config documentation.
- Use the latest go-delegated-routing library version with GET support.
- Added changelog notes for this feature.

It:
- closes #9157
- closes #9079
- closes #9186
2022-09-22 15:47:45 +02:00
Jorropo
74aaf37cec chore: bump go-libp2p v0.23.1
This does not include any WebTransport config code in Kubo, this will be done later in an other PR.
2022-09-21 23:16:03 +02:00
Marcin Rataj
b6b97d90ac fix: require IPNS V2 signatures 2022-09-21 01:09:00 +02:00
Jorropo
aeaf57734a chore: bump go-bitswap v0.10.2 2022-09-13 19:21:18 +02:00
Jorropo
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
Jorropo
849e0478b5 chore: bump go-pinning-service-http-client v0.1.2 to include up to nano precision 2022-09-01 15:36:25 +02:00
Jorropo
1236eb0f58 chore: update github.com/gabriel-vasile/mimetype
See the release notes: https://github.com/gabriel-vasile/mimetype/releases/tag/v1.4.1

This is a valuable release with already public security fixes (which don't affect us AFAIT but better safe than sorry).
More mimetypes and bug fixes.
2022-08-17 02:19:18 +02:00
Marco Munizaga
5c858d5063 Go mod tidy kubo-as-a-library 2022-08-15 14:47:22 -07:00
Marco Munizaga
831135cc9b Update go-libp2p-kad-dht to v0.17.0 2022-08-15 14:14:00 -07:00
Marco Munizaga
194eb2f298 Go mod tidy 2022-08-15 14:12:21 -07:00
Marco Munizaga
4cd437dfe2 Use replace in kubo example as a library 2022-08-15 14:12:21 -07:00
Marco Munizaga
b0adea314a Update go.mod/sum in examples/kubo-as-a-library 2022-08-15 14:12:21 -07:00
Marcin Rataj
2f08eb45e7 chore: update kubo-as-a-library example 2022-07-25 16:48:52 +02:00
Jorropo
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
Antonio Navarro Perez
e8f1ce07b3 fix(ci): make go-ipfs-as-a-library work without external peers (#8978)
* Do not connect to external nodes on ipfs as a lib example.

It was causing some build timeouts error because CircleCI
was throttling WAN connections.

It closes #8956

* style: rename node vars

since this is example, this should make things easier to follow

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-05-25 02:36:01 +02:00
Adin Schmahmann
6d2f790f76 chore: update example deps 2022-05-04 14:56:19 -04:00
Adin Schmahmann
d59730f51e Update Go version to 1.17 (#8815)
* remove building the pre-bundled plugins as shared objects in makefile

* chore: update go version to minimum of 1.17
2022-04-15 14:32:00 -04:00
Shu Shen
012be8ae08 chore: bump to go-ipfs@0.11 in go-ipfs-as-a-library 2022-02-02 21:15:51 -08:00
Adin Schmahmann
52c177ced9 feat: go-libp2p 0.16, UnixFS autosharding and go-datastore with contexts (#8563)
* plumb through go-datastore context changes

* update go-libp2p to v0.16.0
* use LIBP2P_TCP_REUSEPORT instead of IPFS_REUSEPORT
* use relay config
* making deprecation notice match the go-ipfs-config key
* docs(config): circuit relay v2
* docs(config): fix links and headers
* feat(config): Internal.Libp2pForceReachability

This switches to config that supports setting and reading
Internal.Libp2pForceReachability OptionalString flag

* use configuration option for static relays

* chore: go-ipfs-config v0.18.0

https://github.com/ipfs/go-ipfs-config/releases/tag/v0.18.0

* feat: circuit v1 migration prompt when Swarm.EnableRelayHop is set (#8559)
* exit when Swarm.EnableRelayHop is set
* docs: Experimental.ShardingEnabled migration

This ensures existing users of global sharding experiment get notified
that the flag no longer works + that autosharding happens automatically.

For people who NEED to keep the old behavior (eg. have no time to
migrate today) there is a note about restoring it with
`UnixFSShardingSizeThreshold`.

* chore: add dag-jose code to the cid command output

* add support for setting automatic unixfs sharding threshold from the config
* test: have tests use low cutoff for sharding to mimic old behavior
* test: change error message to match the current error
* test: Add automatic sharding/unsharding tests (#8547)
* test: refactored naming in the sharding sharness tests to make more sense

* ci: set interop test executor to convenience image for Go1.16 + Node
* ci: use interop master

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Lucas Molas <schomatis@gmail.com>
2021-11-29 19:58:05 +01:00
Adin Schmahmann
acede6f73c Examples no longer need go mod replace (#8516)
* chore: bump examples to use v0.10.0
* feat: build examples against released packages instead of using replace directives to refer to the parent repo
* ci: run examples against the latest (unreleased) version of go-ipfs
2021-10-26 11:31:50 -04:00
Marcin Rataj
8b7432d6e8 chore: go-ipfs-files v0.0.9 (#8488)
Closes #8445
Closes #8406
2021-10-05 23:53:52 +02:00
Adin Schmahmann
85e30b9b36 fuse: load unixfs adls as their dagpb substrates 2021-09-27 17:50:44 -04:00
Marten Seemann
2589e1f65e enable the legacy mDNS implementation 2021-09-27 17:50:00 -04:00
Adin Schmahmann
5471092d85 chore: update go-path 2021-09-27 15:50:23 -04:00
Marten Seemann
4969ed2b17 chore: update go-libp2p to v0.15.0 2021-09-27 11:12:42 -04:00
Daniel Martí
d6127b062c make json, cbor, and git codecs error on empty input 2021-09-23 13:01:50 -04:00
Jesse Bouwman
cb189c7b78 go mod tidy ipfs library example
The code example for using IPFS as a library doesn't run unless indirect dependencies are updated:

```
$ go version
go version go1.17 linux/amd64
$ uname -a
Linux home 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
$ go run main.go
go: github.com/ipfs/go-ipfs@v0.9.1 requires
	github.com/ipfs/go-bitswap@v0.4.0: missing go.sum entry; to add it:
	go mod download github.com/ipfs/go-bitswap
go: github.com/ipfs/go-ipfs@v0.9.1 requires
	github.com/ipfs/go-bitswap@v0.4.0: missing go.sum entry; to add it:
	go mod download github.com/ipfs/go-bitswap
```

Remedied by:

```
$ go mod tidy
$ go run main.go
-- Getting an IPFS node running --
Spawning node on a temporary repo
    ...
```

Also, require go version 1.16, otherwise, example can fail under go
1.15 with errors like:

```
go build github.com/lucas-clemente/quic-go/internal/qtls:
    build constraints exclude all Go files in
    /home/jbouwman/go/pkg/mod/github.com/lucas-clemente/quic-go@v0.23.0/internal/qtls
```
2021-08-30 09:00:39 -07:00
Petar Maymounkov
c9cc09f6f7 Cosmetic fixups in examples (#8325)
* test the examples in CI
* combine the two examples into a single one
2021-08-27 11:55:26 -04:00
lasiar
d00e9656ac refactor(as-a-library): change comment with default path repo 2021-08-03 08:46:16 -07:00
lasiar
da0afea33b refactor(as-a-library): remove unused context
createTempRepo doesn't use context
2021-08-03 08:46:16 -07:00
lasiar
67fdd6e876 refactor(as-a-library): remove redundant alias
libp2p doesn't need alias
2021-08-03 08:46:16 -07:00
lasiar
4a9dace814 refactor(as-a-library): wrap error
wrap error handling from connectToPeers in a closure
2021-08-03 08:46:16 -07:00
lasiar
d6f442bb86 refactor(as-a-library): replace deprecated functions and structures 2021-08-03 08:46:16 -07:00
lasiar
c5b0f15003 fix(as-a-library): go mod tidy 2021-08-03 08:46:15 -07:00