Commit Graph

3770 Commits

Author SHA1 Message Date
Gus Eggert
e550d9e476
ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
Antonio Navarro Perez
bffc012c6b Fix: swarm stats all command
`swarm stats all` requires that the ResourceManager instance
implements `rcmgr.ResourceManagerState`, and `loggingResourceManager`
was not implementing it, so the command was failing.

Also added a sharness test to check that the command is executing
correctly, because `jq -e` doesn't return an error if the json is nil.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-10-06 14:55:18 +02:00
Jorropo
773c246232 fix: ensure hasher is registered when using a hashing function
Fixes #9297
2022-09-26 10:05:26 +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
Winterhuman
1146f2dd81
Add <protocols> to ipfs id -h options (#9229) 2022-09-22 06:43:54 +00:00
Jorropo
fb22320c9a fix: error message for DefaultServiceLimits change 2022-09-21 23:16:03 +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
Lucas Molas
9e5d0aaaec
feat(cmds/add): --to-files option automates files cp (#8927)
* feat(cmds/add): --to-files option as files cp
* tests(to-files): ensure error handling is covered

this adds bunch of tests that guard UX around importing multiple files
into MFS, and the logic around trailing slash to indicate if the MFS
destination if a directory.

If the destination has a trailing slash, we ensure that the directory
exists and is a dir and not a file. this allows us to support
adding multipl files into MFS dir:

ipfs add file1.txt file2.txt --to-files /some/mfs/dir/

* docs: to-files helptext

Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-09-21 18:08:36 +02:00
Leo Balduf
826c79c95c core/node: add configuration options for Bitswap via fx
Fixes #9256
2022-09-18 11:42:17 +02:00
Russell Dempsey
87dc8de461 feat: ipfs-webui v2.18.1 2022-09-13 23:40:49 +02:00
Russell Dempsey
007295d34d
feat: ipfs-webui v2.18.0 (#9262)
https://github.com/ipfs/ipfs-webui/releases/tag/v2.18.0
2022-09-12 15:40:46 +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
82fbb84384 fmt: applies go1.19 fmt 2022-09-08 18:34:06 +02:00
Jorropo
df22205385 fix(gw): send 200 for empty files
Fixes #9238
2022-09-01 01:04:48 +02:00
Marcin Rataj
c9693edbc5 chore: remove Gateway.PathPrefixes
Closes #7702
2022-08-30 15:38:04 +02:00
Marcin Rataj
92baa6c039 docs(add): skip binary name in helptext
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
2022-08-17 03:30:35 +00:00
Marcin Rataj
0080a66639 docs(cli): clarify CID determinism in add command
Better 'ipfs add --help'  docs, based on feedback from
https://discuss.ipfs.io/t/ipfs-for-publishing-research-data-car-files/14748
2022-08-17 03:30:35 +00:00
Marcin Rataj
2ab89cfe36 docs(cli): clarify CAR format in dag export|import 2022-08-17 03:30:35 +00:00
Marcin Rataj
924ab0616b
Merge pull request #9070 from iand/feat-modular-gateway
feat: make corehttp a reusable component
2022-08-17 03:25:29 +02:00
Marco Munizaga
da54d5ce4b Check err for view.Register 2022-08-15 14:12:21 -07:00
Marco Munizaga
27b046f98e Move register exporter to metrics file 2022-08-15 14:12:21 -07:00
Marco Munizaga
7245e8dd11 Update checkImplicitDefaults 2022-08-15 14:12:21 -07:00
Marco Munizaga
30fb10a635 Update pinned defaults 2022-08-15 14:12:21 -07:00
Marco Munizaga
1ff4e48fd2 Fix err 2022-08-15 14:12:21 -07:00
Marco Munizaga
550663fb73 Fix lint 2022-08-15 14:12:21 -07:00
Marco Munizaga
62a9829caf Reintroduce connmgr hi watermark logic 2022-08-15 14:12:21 -07:00
Marco Munizaga
2b2efc662b Add allowlist config option 2022-08-15 14:12:21 -07:00
Marco Munizaga
679d3d21b9 Add obs to resource manager 2022-08-15 14:12:21 -07:00
Marten Seemann
c3589a1728 WIP rcmgr auto limit scaling 2022-08-15 14:12:18 -07:00
Lucas Molas
6eea94e8d0 chore(cmd): add shutdown to CLI help 2022-08-15 16:12:02 -03:00
Gus Eggert
795c2cf819
docs: add fx plugin documentation to plugins.md (#9191) 2022-08-13 08:08:52 -04:00
Marcin Rataj
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
Gus Eggert
310dca55dd feat: add fx options plugin
This adds a plugin interface that lets the plugin modify the fx
options that are passed to fx when the app is initialized. This means
plugins can inject their own implementations of IPFS interfaces. This
enables granular customization of go-ipfs behavior by plugins, such
as:

- Bitswap with custom filters (e.g. for CID blocking) Custom interface

- implementations such as Pinner or DAGService

- Dynamic configuration of libp2p ...

One downside of this is that we're exposing the entire dependency
graph, init hooks, initialization, etc. to users, so this comes with a
caveat that we reserve the right to make breaking changes to the graph
structure and initialization logic (although this historically happens
rarely). If these things are changed, we should mention them in
release notes and changelogs though, since they could impact users of
this plugin interface.

I'm not particularly fond of DI frameworks (and neither are some of
the folks work on/near go-ipfs), but it seems unlikely that somebody
will rewrite the dependency wiring and lifecycle hooks of go-ipfs, and
add dynamic extension points, so this seems like a palatable
compromise.

There are also problems that we should clean up in how model the
go-ipfs app in fx, such as:

- We make extensive use of nested fx.Options, which fx itself
discourages because it "limits the user's ability to customize their
application". It should be easy to flatten these out into a single
[]fx.Option slice.

- We pass around a list of opaque libp2p opts, which makes it hard to
customize after-the-fact...we should consider naming each of these
opts and providing them to fx as proper dependencies, so that they can
be explicitly overridden.

- We call fx.Invoke() in some places with anonymous functions. We
should instead only pass exported functions to fx.Invoke(), so that
they have exported names, which would make it easier to remove/augment
the invocations that happen when the app is initialized.

These aren't blocking issues, they just make it harder and more
brittle to customize go-ipfs with this plugin.
2022-08-12 17:04:29 -04:00
Seungbae Yu
cb280cbf16
docs: replace docs.ipfs.io with docs.ipfs.tech (#9158)
* docs: fix redirecting URL in README.md
* all: replace `docs.ipfs.io` with `docs.ipfs.tech`
* apply suggestions from code review

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-08-05 19:01:10 +03:00
Marcin Rataj
7992025254 fix(gw): 404 when a valid DAG is missing link 2022-07-23 00:16:31 +02:00
Marcin Rataj
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
Ian Davis
f8cdd96c2a
Clarify offlineApi argument 2022-07-21 15:14:52 +01:00
Ian Davis
2ece5556f0
Change AccessControlHeaders funtion to modify an existing set of headers 2022-07-21 15:09:09 +01:00
Ian Davis
f4d87419ce
feat: make corehttp a reusable component 2022-07-21 15:09:06 +01:00
Marcin Rataj
e832cc2c1d fix(gw): cache-control of index.html websites
This fixes a regression introduced in 0.13.0, where websites hosted via
index.html placed in UnixFS directory were always returned with
Cache-Control: public, max-age=29030400, immutable
even when loaded from mutable /ipns/ contentPath.
2022-07-21 02:02:21 +00:00
Marcin Rataj
d30e71fa5a fix: kubo in daemon and cli stdout 2022-07-20 16:26:49 +02:00
Marcin Rataj
a6687744c7 fix(gw): no backlink when listing root dir
Closes #9071
2022-07-18 23:35:44 +00:00
Antonio Navarro Perez
93847da2e7
fix: Add routing command to subcommands help list. 2022-07-08 17:51:03 +02:00
Jorropo
cbb9aeec49 chore: update go-multibase 🚀
This add supports for base256emoji.
2022-07-07 23:29:47 +02:00
Antonio Navarro Perez
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
Marcin Rataj
58aaee00f8 feat(gw): Cache-Control: only-if-cached
This implements the only-if-cached behavior documented in specs:
https://github.com/ipfs/specs/blob/main/http-gateways/PATH_GATEWAY.md#cache-control-request-header
https://github.com/ipfs/specs/blob/main/http-gateways/PATH_GATEWAY.md#only-if-cached-head-behavior
2022-07-07 08:49:26 +02:00
Russell Dempsey
fbd65e0c8d chore(deps): webui v2.15.1
https://github.com/ipfs/ipfs-webui/releases/tag/v2.15.1
2022-07-07 01:45:19 +02:00