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

4317 Commits

Author SHA1 Message Date
2ab3f58c99 fix(config): wire up Provider.Enabled flag (#10804)
* fix(config): explicit Provider.Enabled flag

Adds missing config option described in
https://github.com/ipfs/kubo/issues/10803

* refactor: remove Experimental.StrategicProviding

removing experiment, replaced with Provider.Enabled

* test(cli): routing [re]provide

updated and added tests for manually triggering provide and reprovide
and making them respect global configuration flag to avoid
inconsistent behaviors

* docs: improve DelegatedRouters

* refactor: default DefaultProviderWorkerCount=16

- simplified default for both
- 16 is safer for non-accelerated DHT client
- acceletated DHT performs better without limit anyway - updated docs
2025-05-15 19:19:18 +02:00
7c844bacea feat(fuse): Expose MFS as FUSE mount point (#10781)
* Add MFS command line options, extend existing mount functions for MFS, set defaults.

* Directory listing and file stat.

* Add a read-only MFS view.

* Add mkdir and interface checks.

* Add remove and rename functionality.

* Implement all required write interfaces.

* Adjust mount  functions for other architechtures.

* Merge branch 'master' into feat/10710-mfs-fuse-mount

* Write a basic read/write test.

* Write more basic tests, add a mutex to the file object, fix modtime.

* Add a concurrency test, remove mutexes from file and directory structures.

* Refactor naming(mfdir -> mfsdir) and add documentation.

* Add CID retrieval through ipfs_cid xattr.

* Add docs, add xattr listing, fix bugs for mv and stat, refactor.

* Add MFS command line options, extend existing mount functions for MFS, set defaults.

* docs phrasing

* docs: Mounts.MFS

* docs: warn about lazy-loaded DAGs

* test: TEST_FUSE=1 ./t0030-mount.sh -v

---------

Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
Co-authored-by: guillaumemichel <guillaume@michel.id>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-05-06 21:55:53 +02:00
b5d73695ba feat: opt-in http retrieval client (#10772)
* Feat: http retrieval as experimental feature

This introduces the http-retrieval capability as an experimental feature.

It can be enabled in the configuration `Experimental.HTTPRetrieval.Enabled = true`.

Documentation and changelog to be added later.

* refactor: HTTPRetrieval.Enabled as Flag

* docs(config): HTTPRetrieval section

* refactor: reusable MockHTTPContentRouter

* feat: HTTPRetrieval.TLSInsecureSkipVerify

allows self-signed certificates in tests

* feat(config): HTTPRetrieval.MaxBlockSize

* test: end-to-end HTTPRetrieval.Enabled

this spawns two http services on localhost:
1. HTTP router that returns HTTP provider when /routing/v1/providers/cid  i queried
2. HTTP provider that returns a block when /ipfs/cid is queried
3. Configures Kubo to use (1) instead of cid.contact

this seems to work (running test with DEBUG=true shows (1) was queried
for the test CID and returned multiaddr of (2), but Kubo never requested
test CID block from (2) – needs investigation

* fix: enable /routing/v1/peers for non-cid.contact

we artificially limited every delegated routing endpoint because of
cid.contact being limited to one endpoint

* feat: Routing.DelegatedRouters

make it easy to override the hardcoded implicit HTTP routeur URL
without having to set the entire custom Router.Routers and
Router.Methods

(http_retrieval_client_test.go still needs to be fixed in future commit)

* test: flag remaining work

* docs: review feedback

* refactor: providerQueryMgr with bitswapNetworks

this fixes two regressions:

(1) introduced in https://github.com/ipfs/kubo/issues/10717
    where we only used bitswapLib2p query manager
    (this is why E2E did not act on http provider)

(2) introduced in https://github.com/ipfs/kubo/pull/10765
    where it was not possible to set binary peerID in IgnoreProviders
    (we changed to []string)

* refactor: Bitswap.Libp2pEnabled

replaces Bitswap.Enabled with Bitswap.Libp2pEnabled
adds tests that confirm it is possible to disable libp2p bitswap fully
and only keep http in client mode

also, removes the need for passing empty blockstore in client-only mode

* docs: changelog

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-05-06 19:06:40 +02:00
IGP
e8ff2d59de feat(config): ability to disable Bitswap fully or just server (#10782)
* feat: add Bitswap configuration and related tests
* fix: update Bitswap function to use 'provide' parameter for server enablement
* docs: update changelog for Bitswap functionality changes
* fix: update Bitswap server enablement logic and improve related tests
* fix: rename BitswapConfig to Bitswap and update references
* docs: config and changelog
* fix: `ipfs cat` panic when `Bitswap.Enabled=false`

Fixes panic described in:
https://github.com/ipfs/kubo/pull/10782#discussion_r2069116219

---------

Co-authored-by: gystemd <gystemd@gmail.com>
Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com>
Co-authored-by: Giulio Piva <giulio.piva@dedicated.world>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-04-30 22:23:51 +02:00
a5997375db feat: Provider.WorkerCount and stats reprovide (#10779)
* adjust ipfs stats provide
* update boxo dep
* bump boxo
* fixing tests
* docs/chore: mark stat reprovide as experimental
* docs: Provider.Strategy

explicitly document it is not used - without this legacy users will have
it in their config and be very confused

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-04-30 15:32:03 +02:00
05565083df Upgrade to Boxo v0.30.0 (#10794)
* Upgrade to Boxo v0.30.0
2025-04-30 06:07:09 -07:00
6b55e64918 feat(config): ipfs add and Import options for controling UnixFS DAG Width (#10774)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-04-15 22:56:38 +02:00
fe3106f9a6 feat(config): expose ProviderSearchMaxResults (#10773)
Replacing hardcoded integer with named default and expose
config option for adjusting it, like we do in Rainbow
https://github.com/ipfs/kubo/pull/10765/files#r2025455848
2025-04-09 21:17:19 +02:00
ee7fef251c feat: ipfs-webui v4.7.0 (#10780)
https://github.com/ipfs/ipfs-webui/releases/tag/v4.7.0
2025-04-09 20:58:32 +02:00
996bcf30a6 feat: partial DAG provides with Reprovider.Strategy=mfs|pinned+mfs (#10754)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-04-09 18:28:29 +02:00
8b54407df1 Merge pull request #10765 from ipfs/ignore-providers
Support WithIgnoreProviders() in provider query manager
2025-04-01 10:03:08 +02:00
1d9e3d6c4f fix: reprovides warning (#10761) 2025-03-25 16:48:10 +01:00
ecca2eba8e Support WithIgnoreProviders() in provider query manager
Adds `Routing.IgnoreProviders`.

This requires initializing a custom providerQueryManager and using it instead
of the default created internally in Bitswap. Since the default is created
with some internal default configuration options (MaxProviders), this hardcodes it.
2025-03-24 16:25:54 +01:00
b2efaa992f feat: ipfs-webui v4.6 (#10756)
https://github.com/ipfs/ipfs-webui/releases/tag/v4.6.0
2025-03-14 18:08:19 +01:00
095cc0d731 Nonfunctional (#10753)
* fix typos
* fix func name in docstring
* use t.TempDir instead of os.MkdirTemp
* fix typo
* unique option names
2025-03-11 14:04:16 -07:00
ba22102a64 provider: buffer pin providers.
Fixes #10596.

The reproviding process can take long. Currently, each CID to be provided is
obtained by making a query to the pinner and reading one by one as the CIDs
get provided.

While this query is ongoing, the pinner holds a Read mutex on the pinset.

If a pin-add-request arrives, a goroutine will start waiting for a Write mutex
on the pinset. From that point, no new Read mutexes can be taken until the writer
can proceed and finishes.

However, no one can proceed because the read mutex is still held while the
reproviding is ongoing.

The fix is mostly in Boxo, where we add a "buffered" provider which reads the
cids onto memory so that they can be provided at its own pace without making
everyone wait.

The consequence is we will need more RAM memory. Rule of thumb is 1GiB extra per 20M cids to be reprovided.
2025-03-07 08:43:18 +01:00
e221e941c7 fix(mfs): basic UnixFS sanity checks in files cp (#10701)
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
2025-03-05 20:40:33 +01:00
8077dbea61 use go-datastore without go-process (#10736)
* use go-datastore without go-process
* update go-ds-xxx dependencies
* update go-libp2p-kad-dht
* bitswap api changes
* Do not use multiple multi-error packages, pick one
* update boxo
* update expected metrics
2025-03-04 18:52:26 -08:00
652d94b2b1 feat: ipfs-webui v4.5.0 (#10735)
https://github.com/ipfs/ipfs-webui/releases/tag/v4.5.0
2025-02-25 23:31:10 +01:00
d6a5bc0b68 feat(AutoTLS): enabled by default with 1h RegistrationDelay (#10724)
Enables AutoTLS by default, but delays registration by 1h
if user did not explicitly set `AutoTLS.Enabled` to `true`
2025-02-25 22:25:58 +01:00
26bb4ca276 Upgrade to Boxo v0.28.0 (#10725)
* Upgrade to Boxo v0.28.0
2025-02-24 16:54:14 -08:00
40a7a388a4 fix: switch away from IPFS_LOG_LEVEL (#10694) 2025-02-14 18:25:31 +00:00
d137d7a4ad Remove unused TimeParts struct (#10708) 2025-02-11 14:35:19 -08:00
e77a484aa8 fix(rpc): restore and reprecate bitswap reprovide (#10699)
https://github.com/ipfs/kubo/pull/10677 removed command without properly
deprecating it first, this restores it and marks as deprecated

we can remove it after at least 1 release with deprecation being
announced
2025-02-10 16:12:53 +01:00
b35555978d feat: Better self-service commands for DHT providing (#10677)
* Add lastRun, NextRun, move reprovide cmd to routing.
* acceleratedDHT logic
* changelog
* depend on latest boxo

---------

Co-authored-by: guillaumemichel <guillaume@michel.id>
Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
2025-01-31 16:33:11 +01:00
5d143a25c1 fix: config help (#10686) 2025-01-30 21:01:37 +01:00
9adab295e0 feat: Add CI for Spell Checking (#10637)
* Create spellcheck.yml
* Create .codespell-ignore
---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
2025-01-30 17:50:51 +01:00
256a739e3b fix(autotls): renewal and AutoTLS.ShortAddrs (#10669)
* fix(autotls): renewal and AutoTLS.ShortAddrs

updates to p2p-forge/client with fix from
https://github.com/ipshipyard/p2p-forge/pull/42

we also add AutoTLS.ShortAddrs flag and enable it by default
to benefit from shorter addrs discusses in
https://github.com/ipshipyard/p2p-forge/pull/40

* test: fix flaky NewRandPort

reducing chance of bind: address already in use
2025-01-22 17:26:15 +01:00
332a9484eb Upgrade to Boxo v0.27.0 (#10665)
* Upgrade to Boxo v0.27.0
2025-01-21 13:27:50 -08:00
104b661134 update dependencies (#10664) 2025-01-21 13:00:32 -08:00
7383e1ecbb chore: fix typos and comment formatting (#10653)
* fix typos and comment formatting
2025-01-06 18:17:39 -08:00
a4d13e3f6b Add example of setting array to config command help
Closes #10645
2025-01-02 10:55:19 -10:00
9425421114 collection of typo fixes (#10647) 2024-12-29 21:27:41 -08:00
9282f08188 fix: ipfs-webui v4.4.2 (#10635)
https://github.com/ipfs/ipfs-webui/releases/tag/v4.4.2
2024-12-20 19:24:21 +01:00
397c346ae0 feat(libp2p): shared TCP listeners and AutoTLS.AutoWSS (#10565)
* feat(libp2p): enable shared TCP listeners

* docs: switch mentions of /ws to /tcp/4001

* feat: AutoTLS.AutoWSS

This adds AutoTLS.AutoWSS flag that is set to true by default.

It will check if Addresses.Swarm contain explicit /ws listener,
and if not found, it will append one per every /tcp listener

This way existing TCP ports are reused without any extra configuration,
but we don't break user's who have custom / explicit /ws listener
already.

I also moved logger around, to include Addresses.Swarm inspection
results in `autotls` logger.

* chore: go-libp2p v0.38.1

https://github.com/libp2p/go-libp2p/releases/tag/v0.38.0
https://github.com/libp2p/go-libp2p/releases/tag/v0.38.1

* docs: AutoTLS.AutoWSS and go-libp2p v0.38.x

* chore: p2p-forge/client v0.2.0

https://github.com/ipshipyard/p2p-forge/releases/tag/v0.2.0

* fix: disable libp2p.ShareTCPListener() in PNET

* chore(ci): timeout sharness after 15m

average successful run is  <9 minutes, no need to wait for 20
https://github.com/ipfs/kubo/actions/workflows/sharness.yml?query=is%3Asuccess

---------

Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-12-20 18:41:25 +01:00
519ae27dce feat: expose BlockKeyCacheSize and enable WriteThrough datastore options (#10614)
* feat: expose BlockKeyCacheSize and enable WriteThrough when bloom filter disabled
* import/config: add BatchMaxSize and BatchMaxNodes
* config: make BlockKeyCacheSize an OptionalInteger
* config: add and wire datastore.WriteThrough option
* config: omitempty on BlockKeyCacheSize
* changelog: rewrite entry about new options for the datastore
* config: add docs for BatchMaxNodes and BatchMaxSize
* config: make WriteThrough an optional Flag
* changelog: improve description of new datastore/import options
* refactor: DefaultWriteThrough as bool
* chore: boxo v0.26.0
* docs: config and changelog fixes
2024-12-19 23:12:05 +00:00
ecb25581c6 cmd/files: flush parent folders (#10630)
* cmd/files: flush parent folders

This is a mitigation to increased MFS memory usage in the course of many writes operations.

The underlying issue is the unbounded growth of the mfs directory cache in
boxo. In the latest boxo version, this cache can be cleared by calling Flush()
on the folder. In order to trigger that, we call Flush() on the parent folder
of the file/folder where the write-operations are happening.

To flushing the parent folder allows it to grow unbounded. Then, any read
operation to that folder or parents (i.e. stat), will trigger a sync-operation to match
the cache to the underlying unixfs structure (and obtain the correct node-cid).

This sync operation must visit every item in the cache. When the cache has grown too much,
and the underlying unixfs-folder has switched into a HAMT, the operation can take minutes.

Thus, we should clear the cache often and the Flush flag is a good indicator
that we can let it go. Users can always run with --flush=false and flush at
regular intervals during their MFS writes if they want to extract some performance.

Fixes #8694, #10588.

* cmd/files: docs and changelog for --flush changes
2024-12-19 14:07:17 -08:00
7c49860061 Upgrade to Boxo v0.26.0 (#10631)
* Upgrade to Boxo v0.26.0
* Update docs/changelogs/v0.33.md
2024-12-19 13:54:02 -08:00
642e58ef3b chore: use errors.New to replace fmt.Errorf with no parameters (#10617) 2024-12-10 13:50:35 -08:00
433444b609 fix(cmds/add): disallow --wrap with --to-files (#10612)
Close #10611
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-12-03 21:49:18 +01:00
224d6a3ba4 refactor(cmds): do not return errors embedded in result type (#10527)
incl. https://github.com/ipfs/boxo/pull/738
2024-12-03 20:15:33 +01:00
53e793afdd fix: ipfs-webui v4.4.1 (#10608)
https://github.com/ipfs/ipfs-webui/releases/tag/v4.4.1
2024-12-03 20:11:34 +01:00
778a418952 refactor(rcmgr): use default libp2p rcmgr metrics (#9947)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-11-27 20:50:43 +01:00
37c5060742 Update to boxo with refactored providerQueryManager. (#10595) 2024-11-26 03:34:06 -08:00
d1f654148f fix: increase provider sample size (#10589) 2024-11-25 09:03:42 -08:00
3a1b8eed0f refactor: update to boxo without goprocess (#10567)
* chore: update to boxo without goprocess
* Use boxo fix for registering metrics
* chore: switch to boxo main with PR 723

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-11-19 18:04:22 +01:00
b87d512b31 feat: ipfs-webui v4.4.0 (#10574)
https://github.com/ipfs/ipfs-webui/releases/tag/v4.4.0
(cherry picked from commit 5d2f5369c7947da423febb86ece29ed595bf6d9d)
2024-11-07 22:13:29 +01:00
e18fdf28d2 chore: label implicit loggers
this should help with debugging
https://github.com/ipshipyard/p2p-forge/issues/8
on boxes with debug log level
(and hide noise from normal users)
2024-11-07 20:53:05 +01:00
84345afcde fix(autotls): store certificates at the location from the repo path (#10566)
* fix(autotls): store certificates at the location from the repo path
* docs(autotls): cert storale and other caveats

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
(cherry picked from commit 1ca0ae0af696ad379a654ebadbb3a7c347702d14)
2024-10-30 23:24:20 +01:00
3134fd246e feat(AutoTLS): opt-in WSS certs from p2p-forge at libp2p.direct (#10521)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-10-29 22:37:33 +01:00