| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs: drop expired pgp key from security notes (#11422) The key expired in 2018 and the pgp.mit.edu lookup it pointed at returns 503, so anyone following it hits a dead end twice. No successor key is published for security@ipfs.io on any keyserver, so the notes point at the repository security policy instead. Seeding the init docs changes their directory CID, so the constants the tests assert against move with it. | 1 个月前 | |
fix t0024 on osx License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com> | 8 年前 | |
core/commands!: remove deprecated object APIs (#10375) | 2 年前 | |
fix printing out of binary escaped data for test License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com> | 9 年前 | |
docs: use specs.ipfs.tech links for merged IPIPs (#11228) - point to canonical URLs instead of github PR links - only updated active docs and v0.40 changelog - left old changelogs and unmerged IPIPs as-is | 6 个月前 | |
feat: relay v2 discovery (go-libp2p v0.19.0) (#8868) * update go-libp2p to v0.19.0 * chore: go-namesys v0.5.0 * refactor(config): cleanup relay handling * docs(config): document updated defaults * fix(tests): panic during sharness * fix: t0160-resolve.sh See https://github.com/ipfs/go-namesys/pull/32 * fix: t0182-circuit-relay.sh * test: transport encryption Old tests were no longer working because go-libp2p 0.19 removed the undocumented 'ls' pseudoprotocol. This replaces these tests with handshake attempt (name is echoed back on OK or 'na' is returned when protocol is not available) for tls and noise variants + adds explicit test that safeguards us against enabling plaintext by default by a mistake. * fix: ./t0182-circuit-relay.sh test is flaky, for now we just restart the testbed when we get NO_RESERVATION error * refactor: AutoRelayFeeder with exp. backoff It starts at feeding peers ever 15s, then backs off each time until it is done once an hour Should be acceptable until we have smarter mechanism in go-lib2p 0.20 * feat(AutoRelay): prioritize Peering.Peers This ensures we feed trusted Peering.Peers in addition to any peers discovered over DHT. * docs(CHANGELOG): document breaking changes Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Gus Eggert <gus@gus.dev> | 4 年前 | |
feat(gateway): _redirects file support (#8890) https://github.com/ipfs/kubo/pull/8890 https://github.com/ipfs/specs/pull/290 | 3 年前 | |
test: deterministic ipns fixtures during sharness gateway tests (#9667) | 3 年前 | |
Revert "chore: add hamt directory sharding test" This reverts commit d23702bbf8513094ca445bea52742d952e80a8dc. | 3 年前 | |
chore: restore exec perms for t0116-gateway-cache.sh and fixtures (#10085) | 3 年前 | |
chore(deps): align deps with ipfs/boxo#1152 (#11313) * chore(deps): align deps with ipfs/boxo#1152 Bumps boxo to the head of ipfs/boxo#1152 and lands the kubo-only direct deps from this week's dependabot batch in one go so go.mod stays consistent. Direct: - boxo: v0.39.0 to ipfs/boxo#1152 head - libp2p-pubsub: 0.15.0 to 0.16.0 - fsnotify: 1.9.0 to 1.10.0 - go-fuse/v2: 2.9.1-pre to 2.10.1 - otelhttp: 0.67.0 to 0.68.0 - otel, otel/sdk, otel/sdk/metric, otel/trace: 1.42.0 to 1.43.0 - otel/exporters/prometheus: 0.56.0 to 0.65.0 - contrib/propagators/autoprop: 0.46.1 to 0.68.0 Pulled in via boxo: zap 1.28.0, go-unixfsnode 1.10.4. Skipped: cheggaaa/pb v1 to v2 (incompatible API; v2 drops pb.U_BYTES and pb.New64(...).SetUnits, breaking the progress bar usage in core/commands/{cat,add,get,dag/export}.go). Supersedes #11306, #11307, #11308, #11309, #11311, #11312. * fix(metrics): drop otel_scope_info, expose scope as labels The otel prometheus exporter v0.59.0 stopped emitting the standalone otel_scope_info metric. Scope identity is now carried by otel_scope_name, otel_scope_version, and otel_scope_schema_url labels on every metric, added in v0.58.0. The bump to v0.65.0 in this branch crosses that boundary, so the t0119 baseline failed. Update the sharness baseline, docs/metrics.md, and add a v0.42 changelog highlight so operators scraping otel_scope_info know to switch their dashboards to the per-metric labels. * chore(deps): bump boxo to main (incl. ipfs/boxo#1152) boxo@main now includes ipfs/boxo#1152, replacing the temporary PR-pinned revision used in 681a4b9cf. | 4 个月前 | |
chore: update url | 1 年前 | |
Fix t0275-cid-security.sh: rename bad block file This sharness test provides 2 datastore blocks directly. One of them (corresponding to an "insecure block") is not a CIDv0 therefore it needs to be migrated and stored with its raw-multihash ID. The (raw) CID of the block used in the test remains the same. The other block needs no changes. | 4 年前 | |
Integrate go-dag-jose plugin (#8569) * feat(dag-jose): integrate `go-dag-jose` plugin * test(dag-jose): sharness test for dag-jose plugin Co-authored-by: Eric Myhre <hash@exultant.us> | 4 年前 | |
refactor: rename to kubo | 4 年前 | |
git: add git plugin tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 9 年前 | |
fix: add versions | 3 年前 | |
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> | 4 年前 | |
chore: upgrade libipfs for routing HTTP API schema changes (#9477) | 3 年前 | |
test: port CircleCI to GH Actions and improve sharness reporting (#9355) Closes https://github.com/ipfs/kubo/issues/8991 Part of https://github.com/ipfs/kubo/issues/8804 | 3 年前 | |
fix: require gmake IPFS doesn't build correctly under non-GNU make implementations. | 7 年前 | |
fix: switch away from IPFS_LOG_LEVEL (#10694) | 1 年前 | |
feat(ci): reusable spellcheck from unified CI (#10873) * ci: use spellcheck from unified CI * chore: fix spelling --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 1 年前 | |
Simplify grep in test to pass on MacOS | 6 年前 | |
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> | 1 年前 | |
repo/fsrepo/migrations: verified HTTP migrations (#10324) | 2 年前 | |
feat: Add command line completion for fish | 3 年前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
fix(cmd): exit 1 on error (#10903) * Fix command stream result handling Do not close the stream prematurely in a deferred function. Also, avoid possible shadowing errors. Closes #9007 * test(cli): test/cli/cid_test.go includes regression tests for https://github.com/ipfs/kubo/issues/9007 and better coverage than the old test/sharness/t0290-cid.sh (identified bug in basemoji) * fix: base256emoji in cid bases --prefix changed the character display logic from ASCII range check to unicode.IsPrint() to properly handle Unicode characters including emojis. * docs: changelog --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 1 年前 | |
fix(defaultServerFilters): strip loopback and non-public (#11286) * docs(server): document defaultServerFilters with RFC references Rework the `server` profile, `Addresses.NoAnnounce`, and `Swarm.AddrFilters` docs to make the default filter list scrutable, and annotate each entry in `defaultServerFilters` with its RFC origin. - profile.go: per-entry RFC inline comments on defaultServerFilters; godoc points at IANA special-purpose registries and cautions that changes here affect every server-profile user. - config.md NoAnnounce/AddrFilters: active-voice rewrites; cross-link publish-side and dial-side filters; consolidated tip pointing to the server profile section. - config.md server profile: IPv4 and IPv6 prefix tables with RFC references (multiaddr ipcidr notation); scenarios table for overriding specific entries; prose section for optional entries (IPv4 loopback, IPv6 outside 2000::/3) with trade-offs, motivated by loopback and unallocated IPv6 leaking into DHT announces since go-libp2p v0.47. * feat(server): strip loopback and non-public IPv6 from announces v0.40 switched libp2p to enumerate all interface addresses, which started leaking loopback, unallocated IPv6 space (e.g. 1e::/16), and other non-globally-reachable addresses into DHT and identify records of public IPFS nodes including bootstrap peers. adds three entries to defaultServerFilters applied to both Swarm.AddrFilters and Addresses.NoAnnounce: - /ip4/127.0.0.0/ipcidr/8: IPv4 loopback (RFC 1122) - /ip6/::1/ipcidr/128: IPv6 loopback (kept for documentation; subset of ::/3) - /ip6/::/ipcidr/3: everything outside global unicast 2000::/3 docs/config.md: overhaul server-profile section with per-entry RFC references, override guidance for Yggdrasil/NAT64/co-located loopback, and notes on /ip6/::/ipcidr/3 blast radius. docs/changelogs/v0.42.md: highlight entry with upgrade instructions for operators who already applied server profile before v0.42. * docs(server): sort filters, correct ::/3 wording The /ip6/::/ipcidr/3 CIDR matches only the IANA-reserved 0000::/3 block. Prior wording "everything outside global unicast 2000::/3" implied wider coverage; other non-2000::/3 blocks are IANA-reserved or already covered by fc00::/7 and fe80::/10, so behavior is unchanged. Also sort new entries into their numeric positions within the IPv4 and IPv6 blocks in both profile.go and the config.md tables. * docs(v0.41): server profile filter highlight Move the server profile changelog entry from v0.42 to v0.41 since the fix ships in v0.41. Also rewrite to lead with the concrete filter list addition, link to the server profile docs section for full details and override guidance, and warn that applying the profile disables LAN and localhost peer discovery. | 5 个月前 | |
switch ipfs init default key | 5 年前 | |
propagate test_launch_ipfs_daemon_without_network name | 5 年前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
feat: pebbleds profile and plugin (#10530) * include pebble as built-in plugin Pebble provides a high-performance alternative to leveldb as the datastore, and will serve as a replacement for badger1. There are a number of tuning parameters available for tuning pebble's performance to your specific needs. Default values are used for any that are not configured or are set to the parameter's zero-value. Requires https://github.com/ipfs/go-ds-pebble/pull/39 Closes #10347 * docs: remove mention of ipfs-ds-convert. Rationale: https://github.com/ipfs/ipfs-ds-convert/issues/50 * docs: pebbleds profile * test: meaningful t0025-datastores.sh * Update config/init.go * Update docs/config.md * Do not hard-code zero values into pebble config | 1 年前 | |
fix(version): produce shorter user agent for tagged release builds when building from a version-tagged commit with a clean tree, omit the redundant git commit hash from the libp2p user agent string, saving bytes in HTTP requests and libp2p identify. `ipfs version --commit` still reports the full commit hash. before (tagged release): kubo/0.37.0/6898472 after (tagged release): kubo/0.37.0 non-tagged and dirty builds are unaffected. | 7 个月前 | |
Revert "feat: adds secp256k1 keypair type to key gen command, adds test cases" This reverts commit 67e1a173fcde1b7c4b09464184aea8ef86bedab2. | 3 年前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
feat: enable DHT Provide Sweep by default (#10955) Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com> | 10 个月前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
fix(sharness): use -Q option instead of pipe to tail cmd | 4 年前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
test: fix "invert" commands in sharness tests (#9652) * test: fix the grep in t0046 * test: fix grep -v in t0140 * test: Addresses.NoAnnounce overides AppendAnnounce * fix t0080-repo.sh * fix t0060.sh --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com> | 1 年前 | |
feat: Support storing UnixFS 1.5 Mode and ModTime (#10478) Co-authored-by: Marcin Rataj <lidel@lidel.org> | 2 年前 | |
fix: allow dag import of 1MiB chunks wrapped in dag-pb (#11185) IPIP-499's unixfs-v1-2025 profile uses 1MiB chunks. with --raw-leaves=false, protobuf wrapping pushes blocks slightly over 1MiB. the previous 1MiB SoftBlockLimit rejected these blocks on dag import. raise SoftBlockLimit to 2MiB to match the bitswap spec, which requires implementations to support blocks up to 2MiB. - raise SoftBlockLimit to 2MiB per the bitswap spec - update error messages and help text - bump boxo to main with ipfs/boxo#1101 (raised ChunkSizeLimit/BlockSizeLimit, 256-byte overhead budget) - update sharness tests for 2MiB boundary - add test/cli boundary tests for block put, dag put, dag import, ipfs add (raw and wrapped leaves), and bitswap exchange including regression tests for the libp2p message size hard limit | 7 个月前 | |
fix(rpc): validate UnixFS in `object patch` (#11248) * fix(object): validate UnixFS type in patch add-link Reject adding named links to non-directory nodes in `object patch add-link`, which previously produced invalid DAGs silently. - reject UnixFS File/Symlink/etc nodes (only Directory and HAMTShard support named links per the UnixFS spec) - reject non-UnixFS dag-pb nodes (no UnixFS metadata to validate) - add `--allow-non-unixfs` flag to bypass both checks - pass `allow-non-unixfs` in client/rpc when SkipUnixFSValidation is set - test all three node types: bare dag-pb, UnixFS File, UnixFS Directory - reproduce the exact data-loss scenario from #7190 Fixes: https://github.com/ipfs/kubo/issues/7190 * fix(object): reject HAMTShard in patch add-link dagutils.Editor operates at the dag-pb level and does not update HAMT bitfields, so mutating HAMTShard nodes produces corrupt DAGs. - reject HAMTShard in add-link (was incorrectly allowed) - update help text to note dag-pb limitations and suggest ipfs files - add HAMT test cases to sharness and API tests - expect full error strings in all validation tests - update changelog to cover all rejected node types * fix(object): validate UnixFS type in patch rm-link Same issue as add-link: dagutils.Editor operates at the dag-pb level and cannot update UnixFS metadata, so mutating non-Directory nodes produces corrupt DAGs. - add UnixFS validation to rm-link (Directory allowed, all else rejected) - add --allow-non-unixfs flag to rm-link command - add ObjectRmLinkSettings/ObjectRmLinkOption types - update ObjectAPI.RmLink interface to accept options - pass allow-non-unixfs in client/rpc - update rm-link help text to note dag-pb limitations - add rm-link validation tests for all four node types | 5 个月前 | |
fix(sharness): use -Q option instead of pipe to tail cmd | 4 年前 | |
fix: allow dag import of 1MiB chunks wrapped in dag-pb (#11185) IPIP-499's unixfs-v1-2025 profile uses 1MiB chunks. with --raw-leaves=false, protobuf wrapping pushes blocks slightly over 1MiB. the previous 1MiB SoftBlockLimit rejected these blocks on dag import. raise SoftBlockLimit to 2MiB to match the bitswap spec, which requires implementations to support blocks up to 2MiB. - raise SoftBlockLimit to 2MiB per the bitswap spec - update error messages and help text - bump boxo to main with ipfs/boxo#1101 (raised ChunkSizeLimit/BlockSizeLimit, 256-byte overhead budget) - update sharness tests for 2MiB boundary - add test/cli boundary tests for block put, dag put, dag import, ipfs add (raw and wrapped leaves), and bitswap exchange including regression tests for the libp2p message size hard limit | 7 个月前 | |
fix: allow dag import of 1MiB chunks wrapped in dag-pb (#11185) IPIP-499's unixfs-v1-2025 profile uses 1MiB chunks. with --raw-leaves=false, protobuf wrapping pushes blocks slightly over 1MiB. the previous 1MiB SoftBlockLimit rejected these blocks on dag import. raise SoftBlockLimit to 2MiB to match the bitswap spec, which requires implementations to support blocks up to 2MiB. - raise SoftBlockLimit to 2MiB per the bitswap spec - update error messages and help text - bump boxo to main with ipfs/boxo#1101 (raised ChunkSizeLimit/BlockSizeLimit, 256-byte overhead budget) - update sharness tests for 2MiB boundary - add test/cli boundary tests for block put, dag put, dag import, ipfs add (raw and wrapped leaves), and bitswap exchange including regression tests for the libp2p message size hard limit | 7 个月前 | |
remove dag put option shortcuts | 4 年前 | |
test: fix "invert" commands in sharness tests (#9652) * test: fix the grep in t0046 * test: fix grep -v in t0140 * test: Addresses.NoAnnounce overides AppendAnnounce * fix t0080-repo.sh * fix t0060.sh --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com> | 1 年前 | |
test: fix the socat tests after the ubuntu 24.04 upgrade (#10683) | 1 年前 | |
Fix typos and cleanup | 6 年前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
chore: fix undiallable api and gateway files Fixes #9232 | 4 年前 | |
test: fix flakes that force CI re-runs (#11413) * fix(routing): keep peers found before the timeout The DHT returns the closest peers it reached together with the context error when a lookup runs past its deadline. We dropped both, so any lookup slower than the routing server's per-request timeout came back as HTTP 500 with nothing in it, indistinguishable from a lookup that found no peers at all. Return what we have, and only error when the set is empty. * test: use local dht swarm for routing v1 test GetClosestPeers joined the public Amino DHT with real bootstrap peers, so the assertions depended on a CI runner reaching bootstrap.libp2p.io from a cold repo. When it could not, the test retried for five minutes and failed; ten such failures since v0.42.0, every one green on re-run. Bootstrap from the harness's in-process DHT peers instead, which the provider tests already use and this one predates. The window drops from five minutes to sixty seconds because there is no longer anything slow to wait for, and passing runs go from tens of seconds to under one. * test: stop handing out ports the kernel reuses NewRandPort binds port zero, notes the number, closes the socket and hands the number to the caller, which leaves a window for anything else on the machine to take it. The number also came from the ephemeral range, the same pool every outgoing connection draws from, and the CLI suite opens a lot of those. Both TestP2PForeground tunnel subtests died on "bind: address already in use" for a server the test binds itself. - NewTCPListener hands back the bound listener, closing that window for callers that listen in-process - ports for daemons we spawn now come from below the ephemeral range, so an outgoing connection cannot land on one * test: sync gc tests to the adder, not the clock TestAddGCLive asserted that gc had not started yet, but the only thing it waited for was the first file's output event. Between that event and the adder reaching the next file there is a gap, and the adder hands the pin lock to a waiting gc at exactly that boundary, so on a loaded runner gc really had started and the assertion was right to fail. Wrap the pipe so the test learns when the adder is inside the hanging file, and poll GCRequested instead of sleeping 100ms to know gc is queued. TestAddMultipleGCLive gets the same treatment for its two sleeps: too short there means gc never gets the lock and the test waits out its five second timeout instead. * test: move watched file in atomically os.WriteFile creates the file and fills it in two steps, and ipfswatch adds whatever is on disk when the create event wakes it. Catch it between the two and it adds an empty file, so the CID the test pulls out of the log reads back as nothing. Stage the file outside the watched directory and rename it in, which the watcher sees as one event for a file that is already complete. * test(sharness): poll the daemon request log The test backgrounded "ipfs log tail", slept 100ms and expected the daemon to be listing the request. The daemon only sees it once the client has started up and connected, which on a loaded runner takes longer than that, and then both the active and the inactive assertion fail together because the entry never appears at all. Poll for each state instead. The extra requests that polling makes push the daemon closer to the point where it drops finished entries from the log, so keep them with "diag cmds set-time" first. * test(sharness): drop stale peer count check The connect case opened by re-asserting that the previous case had left zero peers connected. Disconnecting is not permanent: the DHT keeps the other node in its routing table and re-dials it on any refresh, so that count is only true for as long as nothing else runs. What this case is named for, connecting with a bare /p2p/ address, is still covered by the connect itself and the peer count after it. * test(fuse): mount one node at a time Every parallel subtest does identical setup before mounting, so they all reach the mount together and around twenty setuid fusermount helpers open /dev/fuse inside the same instant. One occasionally comes back with a bare exit status 1. Take a lock for the mount call itself, which the subtests only hold for tens of milliseconds. Also report the failure instead of panicking: a panic failed all 37 tests in the package and left daemons behind, and the daemon's stderr, where fusermount says what actually went wrong, was captured and then thrown away. * test: compare cat output byte for byte The payload is 100 random bytes and the comparison ran through Trimmed(), which strips one trailing newline. Roughly one run in 256 ends in 0x0a and loses it. * test: wait for the fast-provide log line The daemon writes the line before it answers the RPC, but the test reads a buffer that a goroutine fills by copying the daemon's stderr, and that copy can still be behind when the command returns. Wait for the line rather than assuming it has landed. * test: allow for ipns republish mid-test A minute after the daemon starts, the republisher re-signs every key and publishes it again, giving the same value a new signature and expiry. The test captured one PUT body and compared it byte for byte with what routing returned, so a run slow enough to straddle that minute compared the first record against the second. Keep every record the mock is sent and require that routing's answer is one of them, which is what the assertion was reaching for. * fix(examples): turn off mdns in library example The example connects its two nodes by address, but left mDNS on, so local discovery could connect them first. A connection opened while a node is still being built is invisible to that node's bitswap, which only learns about connections made after it registers its notifier, and with no routing configured there is nothing to fall back on. The final fetch then waited forever and the test died on its two minute timeout with no clue why. Turning mDNS off makes the explicit dial the only way the two can meet, and keeps the example off the reader's LAN. Alongside that: - connectToPeers returns dial errors instead of logging and continuing into a fetch that cannot succeed - the example's own deadline now fits inside the test budget, so a stall names the step that hung - CommandContext so a hung child does not outlive the test * ci: make helia-interop job resilient Seven failures since v0.42.0 came from this job's setup rather than from any incompatibility. It installs whatever @helia/interop published last, and upstream shipped three packages in a row whose test config does not work from inside node_modules; a GitHub blip took out the rest. - find the compiled specs and pass them to aegir, instead of patching the config upstream ships into node_modules and grepping its text - pin node to a major: setup-node resolves an lts/ alias through a GitHub manifest with no retry and no fallback, and newer node rejects a flag aegir sets unconditionally - retry the registry lookup and fail loudly, since the old one-liner could not fail and left an empty cache key behind - install the exact version the cache key names, and only save the cache once the install is known good - drop the playwright apt packages, unused since this job stopped running browser targets | 1 个月前 | |
feat(config): AutoConf with "auto" placeholders (#10883) https://github.com/ipfs/kubo/pull/10883 https://github.com/ipshipyard/config.ipfs-mainnet.org/issues/3 --------- Co-authored-by: gammazero <gammazero@users.noreply.github.com> | 1 年前 | |
daemon: support unix domain sockets for the API/gateway All the work was client-side. Unix domain socket multiaddrs already worked server-side. fixes #4218 | 6 年前 | |
fix(config): protect and derive PeerID during JSON replace (#11344) * commands: derive peer ID on config replace Signed-off-by: morning-verlu <258725120+morning-verlu@users.noreply.github.com> * feat: validate Identity.PeerID against node key Setting Identity.PeerID to a value that disagrees with the node's private key produces a config the node refuses to start with. The config command now validates the field against the stored key, the same way config replace re-derives it. - reject a mismatched Identity.PeerID and point at `ipfs key rotate`; accept the node's own PeerID in any base58 or CIDv1 form and store the canonical base58 string - share the PeerID derivation between the set path and config replace - document the identity fields and `ipfs key rotate` in docs/config.md - cover the set-path guard and base36 normalization in test/cli - switch the t0070 sharness probe off Identity.PeerID, now validated --------- Signed-off-by: morning-verlu <258725120+morning-verlu@users.noreply.github.com> Co-authored-by: morning-verlu <258725120+morning-verlu@users.noreply.github.com> Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com> Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com> Co-authored-by: Marcin Rataj <lidel@lidel.org> | 3 个月前 | |
test: fix "invert" commands in sharness tests (#9652) * test: fix the grep in t0046 * test: fix grep -v in t0140 * test: Addresses.NoAnnounce overides AppendAnnounce * fix t0080-repo.sh * fix t0060.sh --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com> | 1 年前 | |
core/commands!: remove deprecated object APIs (#10375) | 2 年前 | |
Replace go-random with random-data from go-test package (#10731) * Replace go-random with random-data from go-test package | 1 年前 | |
Sharness: fix t0084-repo-read-rehash for raw multihashes Compare multihashes rather than CIDs. | 4 年前 | |
test: verifyWorkerRun and helptext (#11063) | 10 个月前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
core/commands!: remove deprecated object APIs (#10375) | 2 年前 | |
propagate test_launch_ipfs_daemon_without_network name | 5 年前 | |
Fix typos (#8548) | 4 年前 | |
feat!: dag import - don't pin roots by default (#9926) * feat!: dag import - don't pin roots by default Fixes: https://github.com/ipfs/kubo/issues/9765 * test(ipip-402): dag import this adds basic regression test that guards behavior around partial cars with or without pinning * docs(ipip-402): ipip and dag import changelog --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 3 年前 | |
fix: Ipfs-Uri gateway header (IPIP-548) (#11437) * feat: Ipfs-Uri gateway header (IPIP-548) Bump boxo to the IPIP-548 implementation (ipfs/boxo#1209): gateway responses carry a canonical percent-encoded Ipfs-Uri header and stop sending the deprecated X-Ipfs-Path, which cannot represent every UnixFS file name. - sharness: CORS expects Ipfs-Uri exposed, X-Ipfs-Path gone - gateway-conformance CI pinned to the IPIP-548 test suite (ipfs/gateway-conformance#301) until a release ships - reverse-proxy doc and v0.44 changelog updated Refs ipfs/specs#548 * feat: opt-in Gateway.DeprecatedXIpfsPath Expose boxo's opt-in for the legacy X-Ipfs-Path response header as a kubo config flag, default off. Unsafe: the legacy value cannot represent every UnixFS file name, so it must only be used to facilitate migration to Ipfs-Uri, and even when enabled the header is still skipped when the value would include non-ASCII byte sequences. Refs ipfs/specs#548 * ci: bump gateway-conformance pin * ci: gateway-conformance v0.14 * chore: boxo with IPIP-548 from boxo/main * docs: Ipfs-Uri changelog in v0.43.1 * docs: assemble v0.43.1 changelog Move the v0.44 highlights and dependency lines into a new v0.43.1 section, and add the missing entry for owner-only key exports (#11428). v0.44.md returns to an empty skeleton. * docs: note boxo v0.42.2 fixes in v0.43.1 | 30 天前 | |
feat(ci): reusable spellcheck from unified CI (#10873) * ci: use spellcheck from unified CI * chore: fix spelling --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 1 年前 | |
fix/gateway: escape directory redirect url (#10649) * fix/gateway: escape directory redirect URLs When a director gets redirected to a URL with a treailing slash, special chars in the directory name must be escaped in the redirect URL. This upgrades to a version of box that has that fix. Closes #10536 * Fix sharness test for new redirect URLs * Update to latest boxo * Use latest gateway-conformance | 1 年前 | |
chore: restore exec perms for t0116-gateway-cache.sh and fixtures (#10085) | 3 年前 | |
refactor: make datastore metrics opt-in (#10788) * datastore: metrics optional and off by default When ipfs is initialized, the datastore metrics wrapper is not configured by default as it previously was. To enable datastore metrics during initialization, specifying the appropriate `--profile` option. To enable datastore metrics tracking wrapper, initialize with datastore profile name + "-measure" suffix. For example: ``` ipfs init --profile flatfs-measure ``` Closes #10767 * fix sharness tests for new datastore dafaults * Add sharness test to check metrics added by flatfs-measure profile * Document updated metrics in changelog * update config doc with new profiles * docs(changelog): separate section * initialize non-measure pebbleds with FormatMajorVersion config * docs: fix typos, add docs link --------- Co-authored-by: gammazero <gammazero@users.noreply.github.com> Co-authored-by: Marcin Rataj <lidel@lidel.org> | 1 年前 | |
feat(config): AutoConf with "auto" placeholders (#10883) https://github.com/ipfs/kubo/pull/10883 https://github.com/ipshipyard/config.ipfs-mainnet.org/issues/3 --------- Co-authored-by: gammazero <gammazero@users.noreply.github.com> | 1 年前 | |
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> | 1 年前 | |
Replace go-random with random-data from go-test package (#10731) * Replace go-random with random-data from go-test package | 1 年前 | |
test: fix flakes that force CI re-runs (#11413) * fix(routing): keep peers found before the timeout The DHT returns the closest peers it reached together with the context error when a lookup runs past its deadline. We dropped both, so any lookup slower than the routing server's per-request timeout came back as HTTP 500 with nothing in it, indistinguishable from a lookup that found no peers at all. Return what we have, and only error when the set is empty. * test: use local dht swarm for routing v1 test GetClosestPeers joined the public Amino DHT with real bootstrap peers, so the assertions depended on a CI runner reaching bootstrap.libp2p.io from a cold repo. When it could not, the test retried for five minutes and failed; ten such failures since v0.42.0, every one green on re-run. Bootstrap from the harness's in-process DHT peers instead, which the provider tests already use and this one predates. The window drops from five minutes to sixty seconds because there is no longer anything slow to wait for, and passing runs go from tens of seconds to under one. * test: stop handing out ports the kernel reuses NewRandPort binds port zero, notes the number, closes the socket and hands the number to the caller, which leaves a window for anything else on the machine to take it. The number also came from the ephemeral range, the same pool every outgoing connection draws from, and the CLI suite opens a lot of those. Both TestP2PForeground tunnel subtests died on "bind: address already in use" for a server the test binds itself. - NewTCPListener hands back the bound listener, closing that window for callers that listen in-process - ports for daemons we spawn now come from below the ephemeral range, so an outgoing connection cannot land on one * test: sync gc tests to the adder, not the clock TestAddGCLive asserted that gc had not started yet, but the only thing it waited for was the first file's output event. Between that event and the adder reaching the next file there is a gap, and the adder hands the pin lock to a waiting gc at exactly that boundary, so on a loaded runner gc really had started and the assertion was right to fail. Wrap the pipe so the test learns when the adder is inside the hanging file, and poll GCRequested instead of sleeping 100ms to know gc is queued. TestAddMultipleGCLive gets the same treatment for its two sleeps: too short there means gc never gets the lock and the test waits out its five second timeout instead. * test: move watched file in atomically os.WriteFile creates the file and fills it in two steps, and ipfswatch adds whatever is on disk when the create event wakes it. Catch it between the two and it adds an empty file, so the CID the test pulls out of the log reads back as nothing. Stage the file outside the watched directory and rename it in, which the watcher sees as one event for a file that is already complete. * test(sharness): poll the daemon request log The test backgrounded "ipfs log tail", slept 100ms and expected the daemon to be listing the request. The daemon only sees it once the client has started up and connected, which on a loaded runner takes longer than that, and then both the active and the inactive assertion fail together because the entry never appears at all. Poll for each state instead. The extra requests that polling makes push the daemon closer to the point where it drops finished entries from the log, so keep them with "diag cmds set-time" first. * test(sharness): drop stale peer count check The connect case opened by re-asserting that the previous case had left zero peers connected. Disconnecting is not permanent: the DHT keeps the other node in its routing table and re-dials it on any refresh, so that count is only true for as long as nothing else runs. What this case is named for, connecting with a bare /p2p/ address, is still covered by the connect itself and the peer count after it. * test(fuse): mount one node at a time Every parallel subtest does identical setup before mounting, so they all reach the mount together and around twenty setuid fusermount helpers open /dev/fuse inside the same instant. One occasionally comes back with a bare exit status 1. Take a lock for the mount call itself, which the subtests only hold for tens of milliseconds. Also report the failure instead of panicking: a panic failed all 37 tests in the package and left daemons behind, and the daemon's stderr, where fusermount says what actually went wrong, was captured and then thrown away. * test: compare cat output byte for byte The payload is 100 random bytes and the comparison ran through Trimmed(), which strips one trailing newline. Roughly one run in 256 ends in 0x0a and loses it. * test: wait for the fast-provide log line The daemon writes the line before it answers the RPC, but the test reads a buffer that a goroutine fills by copying the daemon's stderr, and that copy can still be behind when the command returns. Wait for the line rather than assuming it has landed. * test: allow for ipns republish mid-test A minute after the daemon starts, the republisher re-signs every key and publishes it again, giving the same value a new signature and expiry. The test captured one PUT body and compared it byte for byte with what routing returned, so a run slow enough to straddle that minute compared the first record against the second. Keep every record the mock is sent and require that routing's answer is one of them, which is what the assertion was reaching for. * fix(examples): turn off mdns in library example The example connects its two nodes by address, but left mDNS on, so local discovery could connect them first. A connection opened while a node is still being built is invisible to that node's bitswap, which only learns about connections made after it registers its notifier, and with no routing configured there is nothing to fall back on. The final fetch then waited forever and the test died on its two minute timeout with no clue why. Turning mDNS off makes the explicit dial the only way the two can meet, and keeps the example off the reader's LAN. Alongside that: - connectToPeers returns dial errors instead of logging and continuing into a fetch that cannot succeed - the example's own deadline now fits inside the test budget, so a stall names the step that hung - CommandContext so a hung child does not outlive the test * ci: make helia-interop job resilient Seven failures since v0.42.0 came from this job's setup rather than from any incompatibility. It installs whatever @helia/interop published last, and upstream shipped three packages in a row whose test config does not work from inside node_modules; a GitHub blip took out the rest. - find the compiled specs and pass them to aegir, instead of patching the config upstream ships into node_modules and grepping its text - pin node to a major: setup-node resolves an lts/ alias through a GitHub manifest with no retry and no fallback, and newer node rejects a flag aegir sets unconditionally - retry the registry lookup and fail loudly, since the old one-liner could not fail and left an empty cache key behind - install the exact version the cache key names, and only save the cache once the install is known good - drop the playwright apt packages, unused since this job stopped running browser targets | 1 个月前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
chore: upgrade go-libp2p-kad-dht (#10378) * chore: upgrade go-libp2p-kad-dht * config: make LoopbackAddressesOnLanDHT a Flag * config: add DefaultLoopbackAddressesOnLanDHT * docs(config): Routing.LoopbackAddressesOnLanDHT --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 2 年前 | |
chore: bump to go-ipfs-cmds @ v0.11 | 2 年前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
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> | 4 年前 | |
refactor: namesys cleanup, gateway /ipns/ ttl (#10115) | 2 年前 | |
Revert "feat: adds secp256k1 keypair type to key gen command, adds test cases" This reverts commit 67e1a173fcde1b7c4b09464184aea8ef86bedab2. | 3 年前 | |
sharness: switch p2p dnsaddr that was supposed to have only a single address in it to use a specific example | 5 年前 | |
feat(config): AutoConf with "auto" placeholders (#10883) https://github.com/ipfs/kubo/pull/10883 https://github.com/ipshipyard/config.ipfs-mainnet.org/issues/3 --------- Co-authored-by: gammazero <gammazero@users.noreply.github.com> | 1 年前 | |
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> | 1 年前 | |
feat: enabling pubsub and ipns-pubsub via config flags (#8510) * Allow pubsub and namesys-pubsub to be enabled via config Signed-off-by: Joe Holden <jwh@zorins.us> Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com> | 4 年前 | |
chore: upgrade go-libp2p-kad-dht (#10378) * chore: upgrade go-libp2p-kad-dht * config: make LoopbackAddressesOnLanDHT a Flag * config: add DefaultLoopbackAddressesOnLanDHT * docs(config): Routing.LoopbackAddressesOnLanDHT --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 2 年前 | |
feat: add autonat config options 1. Enable AutoNATService on _all_ nodes by default. If it's an issue, we can disable it in RC3 but this will give us the best testing results. 2. Expose options to configure AutoNAT rate limiting. | 6 年前 | |
chore: update boxo, go-libp2p, and internalize mplex (#10095) | 3 年前 | |
fix: replace quic to quic-v1 for webtransport sharness | 3 年前 | |
chore: update go-libp2p to v0.24.1 | 3 年前 | |
Update to boxo with refactored providerQueryManager. (#10595) | 1 年前 | |
chore: upgrade OpenTelemetry dependencies (#9736) | 3 年前 | |
Replace go-random with random-data from go-test package (#10731) * Replace go-random with random-data from go-test package | 1 年前 | |
fix(cli): preserve hostname specified with --api in http request headers (#10497) Preserve hostname specified with --api in http request headers - Replaces PR #10233 - Add test to check for hostname in HTTP header - Update docs/changelogs/v0.30.md | 2 年前 | |
fix: use %-encoded headers in most compatible way | 3 年前 | |
fix(test): stabilize flaky provider tests | 3 年前 | |
fix(mfs): respect Import config (#11273) * test(deps): quick test of boxo with ipfs/boxo#1125 * test(mfs): verify CidBuilder preservation across mutations and restarts * docs(changelog): highlight MFS CidBuilder fix * fix(mfs): apply Import.CidVersion and HashFunction to MFS root The MFS root loaded at daemon startup never received a CidBuilder from config, so it stayed CIDv0/sha2-256 even with non-default Import settings. Pass the configured CidBuilder to mfs.NewRoot(). - add Import.UnixFSCidBuilder() helper for building cid.Prefix - pass WithCidBuilder to mfs.NewRoot in core/node/core.go - deduplicate getPrefixNew/getPrefix in files.go - strengthen regression test to check CID version and root dir * fix: restore explicit Flush, use upstream boxo - restore explicit Flush: false in addNode and addDir Mkdir calls that was dropped during the MkdirOpts refactor - use %q for hash function error message in getPrefix - switch from boxo fork replace to upstream boxo@98dabcc * fix(config): always build explicit CidBuilder from defaults UnixFSCidBuilder used to return nil when CidVersion and HashFunction matched compile-time defaults, relying on boxo's internal CIDv0/sha2-256 fallback. This will break when DefaultCidVersion changes to 1, because boxo will keep using CIDv0 regardless. - remove early-return short-circuit in UnixFSCidBuilder - add unit tests for explicit and default CidBuilder construction Refs: https://github.com/ipfs/kubo/issues/4143 * fix(files): reject chcid on MFS root path The MFS root CID format is now always set from Import.CidVersion and Import.HashFunction at startup, so chcid on "/" was silently overridden on every subsequent command or daemon restart. - chcid now requires a path argument and rejects "/" - help text and changelog explain how to change root CID format - sharness tests use Import config + daemon restarts instead of chcid / - added test for chcid on subdirectories with blake2b-256 * chore(deps): update boxo to latest main Picks up ipfs/boxo#1131: fix concurrent flush/close panic in MFS file descriptors (FUSE race condition). * fix(test): sharness daemon pairing and stale shard hash - add restart_daemon helper to avoid tripping t0015 meta-test that counts literal test_kill/test_launch pairs in each file - update cidv1 SHARD_HASH to match current boxo HAMT output --------- Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com> | 5 个月前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 | |
core/commands!: remove deprecated object APIs (#10375) | 2 年前 | |
feat(config): `ipfs add` and `Import` options for controling UnixFS DAG Width (#10774) Co-authored-by: Marcin Rataj <lidel@lidel.org> | 1 年前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
fix: update go-test module (#11390) - Use new `go-test/random` API - no global seed values - reuse generator where appropriate - Fix tests to match new random data generation - update expected deterministic values - fix t0040-add-and-cat.sh - fix t0043-add-w.sh - fix t0045-ls.sh - fix t0087-repo-robust-gc.sh - fix t0270-filestore.sh - fix t0271-filestore-utils.sh - fix t0272-urlstore.sh - Migrate from `/math/rand' to `/math/rand/v2` - random seeds are now `[32]byte` and not `uint64` - use `StringToSeed` or `Uint64ToSeed` to create random seeds for deterministic output | 2 个月前 | |
fix: enforce identity CID size limits (#10949) * fix: enforce identity CID size limits - validate --inline-limit against verifcid.MaxDigestSize - add error when --hash=identity exceeds size limit - add tests for identity CID overflow scenarios - update help text to show maximum inline limit This prevents creation of unbounded identity CIDs by enforcing the 128-byte limit defined in https://github.com/ipfs/boxo/pull/1018 Fixes #6011 IPIP: https://github.com/ipfs/specs/pull/512 | 1 年前 | |
Replace go-random with random-data from go-test package (#10731) * Replace go-random with random-data from go-test package | 1 年前 | |
feat: relay v2 discovery (go-libp2p v0.19.0) (#8868) * update go-libp2p to v0.19.0 * chore: go-namesys v0.5.0 * refactor(config): cleanup relay handling * docs(config): document updated defaults * fix(tests): panic during sharness * fix: t0160-resolve.sh See https://github.com/ipfs/go-namesys/pull/32 * fix: t0182-circuit-relay.sh * test: transport encryption Old tests were no longer working because go-libp2p 0.19 removed the undocumented 'ls' pseudoprotocol. This replaces these tests with handshake attempt (name is echoed back on OK or 'na' is returned when protocol is not available) for tls and noise variants + adds explicit test that safeguards us against enabling plaintext by default by a mistake. * fix: ./t0182-circuit-relay.sh test is flaky, for now we just restart the testbed when we get NO_RESERVATION error * refactor: AutoRelayFeeder with exp. backoff It starts at feeding peers ever 15s, then backs off each time until it is done once an hour Should be acceptable until we have smarter mechanism in go-lib2p 0.20 * feat(AutoRelay): prioritize Peering.Peers This ensures we feed trusted Peering.Peers in addition to any peers discovered over DHT. * docs(CHANGELOG): document breaking changes Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Gus Eggert <gus@gus.dev> | 4 年前 | |
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. | 4 年前 | |
change names of ipfs dag put flags to make changes clearer | 4 年前 | |
ci: preload peerlog plugin, disable by default This preloads the peerlog plugin in the ipfs binary, but keeps it disabled by default. To enabled it, set Enabled=true in its config. The motivation is to simplify building and deploying gateways, and for them to use binaries that are more similar to release bins. | 4 年前 | |
feat: nice errors when failing to load plugins partially fixes #7305 | 6 年前 | |
fix(cmd): exit 1 on error (#10903) * Fix command stream result handling Do not close the stream prematurely in a deferred function. Also, avoid possible shadowing errors. Closes #9007 * test(cli): test/cli/cid_test.go includes regression tests for https://github.com/ipfs/kubo/issues/9007 and better coverage than the old test/sharness/t0290-cid.sh (identified bug in basemoji) * fix: base256emoji in cid bases --prefix changed the character display logic from ASCII range check to unicode.IsPrint() to properly handle Unicode characters including emojis. * docs: changelog --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> | 1 年前 | |
chore: update go-multibase 🚀 This add supports for base256emoji. | 4 年前 | |
ci: add stylecheck to golangci-lint (#9334) | 3 年前 | |
fix: multibase in pubsub http rpc (#8183) * multibase encoding on pubsub * emit multibase for json clients * refactor(pubsub): base64url for all URL args This makes it easier to reason about. Also added better helptext to each command explaining how the binary data is encoded on the wire, and how to process it in userland. * refactor: remove ndpayload and lenpayload Those output formats are undocumented and seem to be only used in tests. This change removes their implementation and replaces it with error message to use JSON instead. I also refactored tests to test the --enc=json response format instead of imaginary one, making tests more useful as they also act as regression tests for HTTP RPC. * test(pubsub): go-ipfs-api Testing against compatible version from https://github.com/ipfs/go-ipfs-api/pull/255 * refactor: safeTextListEncoder Making it clear what it does and why * refactor(pubsub): unify peerids This ensures `ipfs pubsub sub` returns the same peerids in the `From` field as `ipfs pubsub peers`. libp2p already uses base encoding, no need to double wrap or use custom multibase. * test(pubsub): go-ipfs-http-client * refactor(pubsub): make pub command read from a file We want to send payload in the body as multipart so users can use existing tools like curl for publishing arbitrary bytes to a topic. StringArg was created for "one message per line" use case, and if data has `\n` or `\r\n` byte sequences, it will cause payload to be split. It is not possible to undo this, because mentioned sequences are lost, so we are not able to tell if it was `\n` or `\r\n` We already avoid this problem in `block put` and `dht put` by reading payload via FileArg which does not mangle binary data and send it as-is. It feel like `pubsub pub` should be using it in the first place anyway, so this commit replaces StringArg with FileArg. This also closes https://github.com/ipfs/go-ipfs/issues/8454 and makes rpc in go-ipfs easier to code against. * test(pubsub): publishing with line breaks Making sure we don't see regressions in the future. Ref. https://github.com/ipfs/go-ipfs/issues/7939 * chore: disable pubsub interop for now See https://github.com/ipfs/interop/commit/344f692d8cdc68fabe424814214dfb43c716edac * test: t0322-pubsub-http-rpc.sh - Adds HTTP RPC regression test that ensures topic is encoded as URL-safe multibase. - Moves pubsub tests to live in unique range ./t032x * fix(ci): js-ipfs with fixed pubsub wire format uses js-ipfs from https://github.com/ipfs/js-ipfs/pull/3922 until js-ipfs release can ship with dependency on go-ipfs 0.11.0-rc1 Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com> | 4 年前 | |
fix: multibase in pubsub http rpc (#8183) * multibase encoding on pubsub * emit multibase for json clients * refactor(pubsub): base64url for all URL args This makes it easier to reason about. Also added better helptext to each command explaining how the binary data is encoded on the wire, and how to process it in userland. * refactor: remove ndpayload and lenpayload Those output formats are undocumented and seem to be only used in tests. This change removes their implementation and replaces it with error message to use JSON instead. I also refactored tests to test the --enc=json response format instead of imaginary one, making tests more useful as they also act as regression tests for HTTP RPC. * test(pubsub): go-ipfs-api Testing against compatible version from https://github.com/ipfs/go-ipfs-api/pull/255 * refactor: safeTextListEncoder Making it clear what it does and why * refactor(pubsub): unify peerids This ensures `ipfs pubsub sub` returns the same peerids in the `From` field as `ipfs pubsub peers`. libp2p already uses base encoding, no need to double wrap or use custom multibase. * test(pubsub): go-ipfs-http-client * refactor(pubsub): make pub command read from a file We want to send payload in the body as multipart so users can use existing tools like curl for publishing arbitrary bytes to a topic. StringArg was created for "one message per line" use case, and if data has `\n` or `\r\n` byte sequences, it will cause payload to be split. It is not possible to undo this, because mentioned sequences are lost, so we are not able to tell if it was `\n` or `\r\n` We already avoid this problem in `block put` and `dht put` by reading payload via FileArg which does not mangle binary data and send it as-is. It feel like `pubsub pub` should be using it in the first place anyway, so this commit replaces StringArg with FileArg. This also closes https://github.com/ipfs/go-ipfs/issues/8454 and makes rpc in go-ipfs easier to code against. * test(pubsub): publishing with line breaks Making sure we don't see regressions in the future. Ref. https://github.com/ipfs/go-ipfs/issues/7939 * chore: disable pubsub interop for now See https://github.com/ipfs/interop/commit/344f692d8cdc68fabe424814214dfb43c716edac * test: t0322-pubsub-http-rpc.sh - Adds HTTP RPC regression test that ensures topic is encoded as URL-safe multibase. - Moves pubsub tests to live in unique range ./t032x * fix(ci): js-ipfs with fixed pubsub wire format uses js-ipfs from https://github.com/ipfs/js-ipfs/pull/3922 until js-ipfs release can ship with dependency on go-ipfs 0.11.0-rc1 Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com> | 4 年前 | |
cmds/dag/import: pin roots by default (#9966) This is a partial revert of b685355ca8ceaaf55619ee3b8cffa612a4106569. Closes #9765 with compromise agreed in https://github.com/ipfs/kubo/issues/9765#issuecomment-1593117410 | 3 年前 | |
fix: allow ipfs-companion browser extension to access RPC API (#8690) * fix: add companion ids to allow origins - fixes #8689 - Adds the chrome-extension ids for ipfs-companion and ipfs-companion-beta to the allowed origins list, this allows us to accesss ipfs api from a manifest v3 extension. - added tests in t0401-api-browser-security.sh * fix: companion when custom CORS *-Origin is set Companion extension should be able to access RPC API even when custom Access-Control-Allow-Origin is set Co-authored-by: Marcin Rataj <lidel@lidel.org> | 4 年前 | |
Fix typos and cleanup | 6 年前 | |
Replace go-random with random-data from go-test package (#10731) * Replace go-random with random-data from go-test package | 1 年前 | |
chore: bump to boxo master | 3 年前 | |
feat: add blake3 support Support hashes from 20 <= x <= 128 bytes, but does not yet have any option to generate anything else than 32 bytes hashes. This will be forward compatible when we add such option. | 4 年前 | |
sharness: Fix tests License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> | 8 年前 |
ipfs whole tests using the sharness framework
Running all the tests
Just use make in this directory to run all the tests.
Run with TEST_VERBOSE=1 to get helpful verbose output.
TEST_VERBOSE=1 make
The usual ipfs env flags also apply:
# the output will make your eyes bleed
GOLOG_LOG_LEVEL=debug TEST_VERBOSE=1 make
To make the tests abort as soon as an error occurs, use the TEST_IMMEDIATE env variable:
# this will abort as soon the first error occurs
TEST_IMMEDIATE=1 make
Running just one test
You can run only one test script by launching it like a regular shell script:
$ ./t0010-basic-commands.sh
Debugging one test
You can use the -v option to make it verbose and the -i option to
make it stop as soon as one test fails.
For example:
$ ./t0010-basic-commands.sh -v -i
Sharness
When running sharness tests from main Makefile or when test_sharness_deps
target is run dependencies for sharness
will be downloaded from its GitHub repo and installed in a "lib/sharness"
directory.
Please do not change anything in the "lib/sharness" directory.
If you really need some changes in sharness, please fork it from its canonical repo and send pull requests there.
Writing Tests
Please have a look at existing tests and try to follow their example.
When possible and not too inefficient, that means most of the time,
an ipfs command should not be on the left side of a pipe, because if
the ipfs command fails (exit non zero), the pipe will mask this failure.
For example after false | true, echo $? prints 0 (despite false
failing).
It should be possible to put most of the code inside test_expect_success,
or sometimes test_expect_failure, blocks, and to chain all the commands
inside those blocks with &&, or || for diagnostic commands.
Diagnostics
Make your test case output helpful for when running sharness verbosely. This means cating certain files, or running diagnostic commands. For example:
test_expect_success ".ipfs/ has been created" '
test -d ".ipfs" &&
test -f ".ipfs/config" &&
test -d ".ipfs/datastore" &&
test -d ".ipfs/blocks" ||
test_fsh ls -al .ipfs
'
The || ... is a diagnostic run when the preceding command fails.
test_fsh is a shell function that echoes the args, runs the cmd,
and then also fails, making sure the test case fails. (wouldn't want
the diagnostic accidentally returning true and making it seem like
the test case succeeded!).
Testing commands on daemon or mounted
Use the provided functions in lib/test-lib.sh to run the daemon or mount:
To init, run daemon, and mount in one go:
test_launch_ipfs_daemon_and_mount
test_expect_success "'ipfs add --help' succeeds" '
ipfs add --help >actual
'
# other tests here...
# don't forget to kill the daemon!!
test_kill_ipfs_daemon
To init, run daemon, and then mount separately:
test_init_ipfs
# tests inited but not running here
test_launch_ipfs_daemon
# tests running but not mounted here
test_mount_ipfs
# tests mounted here
# don't forget to kill the daemon!!
test_kill_ipfs_daemon