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

1174 Commits

Author SHA1 Message Date
Kay
2b7c20fc66 refactor: using error is instead of == (#10093) 2023-08-22 14:53:29 +00:00
1e5ce93659 fix: use %-encoded headers in most compatible way 2023-08-22 15:43:01 +02:00
5e9bad9804 fix: open /dev/null with read write permissions
The way we create the kubo binary for coverage is very hacky.
It uses the testing tool. In order to simulate a Kubo binary,
we need to supress all the output that would otherwise be printed
by 'go test'.

So far, we were setting os.Stdout and os.Stderr as a read-only
/dev/null file descriptor. This is causing issues with the new
versions of Go:

    error generating coverage report: write /dev/null: bad file descriptor
    exit status 2

Updating it to a Read-Write file descriptor solves the problem.
I did not try looking into what is causing this issue now. There have
been some updates to the 'go test' tool in Go 1.20 and it is likely
that some error is now being checked for that hasn't been checked
before. Writing to a read-only file descriptor always failed. But
the error was just supressed somehow.
2023-08-22 15:43:01 +02:00
2aa721b121 chore: bump to go 1.20
- Bumps golangci-lint to work for the new Go version
- Removes rand.Seed, which has been deprecated. It is seeded by default
  with a random value since Go 1.20.
- Replaces deprecated Fuse errors with syscall.Errno
2023-08-22 15:43:01 +02:00
Kay
f12b372af9 style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
e7294cbdff feat: warn users who are falling behind reprovides
Fixes: #9704
Fixes: #9702
Fixes: #9703
Fixes: #9419
2023-06-08 10:05:30 +02:00
e5b33924a7 fix: correct list of addresses for delegated routing (#9920) 2023-06-07 17:59:55 +02:00
4ca36c41b6 fix: use default HTTP routers when FullRT DHT client is used (#9841) 2023-05-01 15:29:34 -04:00
c6a59c9cc1 feat(tracing): use OTEL_PROPAGATORS as per OTel spec (#9801) 2023-04-06 16:36:15 +02:00
55587d8e41 feat!: make --empty-repo default (#9758)
Context:
https://github.com/ipfs/kubo/pull/9758#pullrequestreview-1366898875
2023-03-31 15:06:23 +02:00
a24cfb89a5 test: port remote pinning tests to Go (#9720)
This also means that rb-pinning-service-api is no longer required for
running remote pinning tests. This alone saves at least 3 minutes in
test runtime in CI because we don't need to checkout the repo, build
the Docker image, run it, etc.

Instead this implements a simple pinning service in Go that the test
runs in-process, with a callback that can be used to control the async
behavior of the pinning service (e.g. simulate work happening
asynchronously like transitioning from "queued" -> "pinning" ->
"pinned").

This also adds an environment variable to Kubo to control the MFS
remote pin polling interval, so that we don't have to wait 30 seconds
in the test for MFS changes to be repinned. This is purely for tests
so I don't think we should document this.

This entire test suite runs in around 2.5 sec on my laptop, compared to
the existing 3+ minutes in CI.
2023-03-30 07:46:35 -04:00
3ab1086f71 chore: migrate go-libipfs to boxo
Resolves #9677, #9676, #9675, #9736
2023-03-28 22:05:25 -04:00
1e3b6c9857 feat: add tracing to the commands client 2023-03-28 22:05:25 -04:00
88d431c812 feat: remove writable gateway (#9743)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-03-27 15:19:55 +02:00
1f5763f787 chore: deprecate the pubsub api
Fixes #9717
2023-03-15 04:42:02 +01:00
0d94bac30c feat: add "autoclient" routing type
This routing type is the same as "auto" but it creates the DHT in
"client" mode and hence does not start a DHT server.
2023-03-09 08:18:14 -05:00
714a968faa docs: bulk spelling edits (#9544)
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
Co-authored-by: Steve Loeppky <biglep@protocol.ai>
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-02-20 23:37:10 +01:00
14649aa8ba refactor: new go-libipfs/gateway API, deprecate Gateway.Writable (#9616) 2023-02-02 02:50:46 +01:00
255e64e49e chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
f54b2bcf60 fix: hint people to changing from RSA peer ids 2023-01-11 23:54:05 +01:00
931a9df8a6 stop using the deprecated go-libp2p-loggables package 2022-12-12 03:47:17 +01:00
70e604ff99 feat: Routing.Type=auto (DHT+IPNI) (#9475)
This changes the default routing to use both DHT and IPNI
at the same time. Closes #9454 Closes #9422

Full context:
https://github.com/ipfs/kubo/issues/9454
https://github.com/ipfs/kubo/issues/9422

Co-authored-by: Steve Loeppky <biglep@protocol.ai>
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Steve Loeppky <biglep@protocol.ai>
2022-12-08 23:20:24 +01:00
e550d9e476 ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
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
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
b8412efb80 Merge pull request #9244 from Jorropo/update/go-libp2p
bump go-libp2p v0.22.0 & go1.18&go1.19
2022-09-09 17:21:08 +02:00
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
0f3a1b3820 docs(cmds): daemon: update DHTClient description 2022-09-01 15:59:10 +02:00
c9693edbc5 chore: remove Gateway.PathPrefixes
Closes #7702
2022-08-30 15:38:04 +02:00
954c6cc52e chore: fix undiallable api and gateway files
Fixes #9232
2022-08-30 11:03:17 +02:00
27b046f98e Move register exporter to metrics file 2022-08-15 14:12:21 -07:00
837f6ee92b chore: switch to dist.ipfs.tech
Part of https://github.com/protocol/bifrost-infra/issues/2018
ensures the domain used for fetching migrations is not
impacted by ipfs.io being blocked at DNS level by some ISPs.
2022-08-12 23:42:17 +02:00
d419c0e95b feat: add $IPFS_PATH/gateway file
The file contains the gateway your node is hosting in the http://<host>:<port> RFC 3986 format.
Structurally it works exactly the same as the API file.
2022-08-08 13:50:26 +02:00
d30e71fa5a fix: kubo in daemon and cli stdout 2022-07-20 16:26:49 +02:00
92c4dc61a8 feat(routing): Delegated Routing (#8997)
* Delegated Routing.

Implementation of Reframe specs (https://github.com/ipfs/specs/blob/master/REFRAME.md) using go-delegated-routing library.

* Requested changes.

* Init using op string

* Separate possible ContentRouters for TopicDiscovery.

If we don't do this, we have a ciclic dependency creating TieredRouter.
Now we can create first all possible content routers, and after that,
create Routers.

* Set dht default routing type

* Add tests and remove uneeded code

* Add documentation.

* docs: Routing.Routers

* Requested changes.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>

* Add some documentation on new fx functions.

* Add changelog entry and integration tests

* test: sharness for 'dht' in 'routing' commands

Since 'routing' is currently the same as 'dht' (minus query command)
we need to test both, that way we won't have unnoticed divergence
in the default behavior.

* test(sharness): delegated routing via reframe URL

* Add more tests for delegated routing.

* If any put operation fails, the tiered router will fail.

* refactor: Routing.Routers: Parameters.Endpoint

As agreed  in https://github.com/ipfs/kubo/pull/8997#issuecomment-1175684716

* Try to improve CHANGELOG entry.

* chore: update reframe spec link

* Update go-delegated-routing dependency

* Fix config error test

* use new changelog format

* Remove port conflict

* go mod tidy

* ProviderManyWrapper to ProviderMany

* Update docs/changelogs/v0.14.md

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2022-07-07 17:10:25 -04:00
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
6602dd704e refactor: prealloc slices with known sizes (#8892)
Often those are small slices and that cuts down the number
of (small) allocations from 2~7 to 1. 
This is consistent too, always only gets 1.
2022-06-24 21:19:19 +01: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
53299e84e0 chore: mark fuse experimental (#8962)
It works only on some platforms, and does not work reliably.
This corrects our error of not setting expectations right.
2022-05-12 10:32:54 -07:00
7e488c1c16 Ensure that folder exists before moving ipfs binary.
On macOS Monterey there is no /usr/local/bin folder and we need to
create it.
2022-05-06 15:29:05 +02:00
1f37a1481b go fmt 2022-05-03 14:09:38 -04:00
6817fd4744 feat(cmds): allow to set the configuration file path 2022-04-22 13:03:28 -03:00
bb68a68525 feat: port collect-profiles.sh to 'ipfs diag profile' (#8786)
* feat: add block profiling to collect-profiles.sh

* feat: add more profiles to 'ipfs diag profile'

This adds mutex and block profiles, and brings the command up-to-par
with 'collect-profiles.sh', so that we can remove it.

Profiles are also now collected concurrently, which improves the
runtime from (profile_time * num_profiles) to just (profile_time).

Note that this has a backwards-incompatible change, removing
--cpu-profile-time in favor of the more general --profile-time, which
covers all sampling profiles.

* docs(cli): ipfs diag profile

* add CLI flag to select specific diag collectors

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-12 11:58:03 -04:00
e309682545 fix: unknown fetcher type error (#8830)
match RetryFetcher as HttpFetcher
2022-04-06 02:10:13 +02:00
f855bfe6ef feat: add basic gateway tracing (#8595)
* add deprecation warning when tracer plugins are loaded
* add response format attribute to span in gateway handler
* add note about tracing's experimental status in godoc
* add nil check for TTL when adding name span attrs
* add basic sharness test for integration with otel collector
* add nil check in UnixFSAPI.processLink
* test: sharness check all json objs for swarm span
* add env var docs to docs/environment-variables.md
* chore: pin the otel collector version
* add tracing spans per response type (#8841)
* docs: tracing with jaeger-ui

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-04 19:24:05 +02:00
d92887086f fix(core/commands): do not cache config (#8824) 2022-03-27 08:11:45 -04:00
e14f580ba7 Merge pull request #8638 from ipfs/schomatis/fix/core/node/unwrap-fx-error
fix(core/node): unwrap fx error in node construction
2022-03-16 19:45:51 -03:00
519863ecab fix(core/node): unwrap fx error in node construction 2022-03-16 19:32:31 -03:00
5e1b2248c5 feat: add full goroutine stack dump (#8790) 2022-03-16 09:42:22 -04:00
0487f03eae feat: add endpoint for enabling block profiling (#8469) 2022-03-11 14:32:59 -05:00