Commit Graph

432 Commits

Author SHA1 Message Date
Gus Eggert
b1c051d250
feat: disable resource manager by default (#9003)
* feat: disable resource manager by default

We are disabling this by default for v0.13 as we work to improve the
UX around Resource Manager. It is still usable and can be enabled in
the IPFS config with "ipfs config --bool Swarm.ResourceMgr.Enabled true".

We intend to enable Resource Manager by default in a subsequent
release.

* docs(config): Swarm.ResourceMgr disabled by default

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-06-02 10:31:06 -04:00
Antonio Navarro Perez
e8f1ce07b3
fix(ci): make go-ipfs-as-a-library work without external peers (#8978)
* Do not connect to external nodes on ipfs as a lib example.

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

It closes #8956

* style: rename node vars

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

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-05-25 02:36:01 +02:00
siiky
a72753bade docs: fix abstractions typo 2022-05-14 02:54:00 +02:00
Marcin Rataj
53299e84e0
chore: mark fuse experimental (#8962)
It works only on some platforms, and does not work reliably.
This corrects our error of not setting expectations right.
2022-05-12 10:32:54 -07:00
Adin Schmahmann
6d2f790f76 chore: update example deps 2022-05-04 14:56:19 -04:00
Gus Eggert
0ab4367160 docs(tracing): update env var docs for new tracing env vars
This should have been updated as part of 967bd6932
2022-05-04 14:38:05 -04:00
Gus Eggert
3d527753ff feat: enable Resource Manager by default 2022-05-04 14:08:37 -04:00
Marcin Rataj
cab69276e9 docs: Swarm.ResourceMgr.Limits 2022-05-03 16:21:03 -04:00
Adin Schmahmann
7ad6447453 feat: enable hole-punching by default 2022-05-03 14:26:09 -04:00
Lucas Molas
25cc85fa93
feat(gateway): Gateway.FastDirIndexThreshold (#8853)
* fix(core/gateway): option to limit directory size listing

* feat(gw): HTMLDirListingLimit

This is alternative take on the way we limit the HTML listing output.
Instead of a hard cut-off, we list up to HTMLDirListingLimit.
When a directory has more items than HTMLDirListingLimit we show
additional header and footer informing user that only $HTMLDirListingLimit
items are listed. This is a better UX.

* fix: 0 disables Gateway.HTMLDirListingLimit

* refactor: Gateway.FastDirIndexThreshold

see explainer in docs/config.md

* refactor: prealoc slices

* docs: Gateway.FastDirIndexThreshold

* refactor: core/corehttp/gateway_handler.go

https://github.com/ipfs/go-ipfs/pull/8853#discussion_r851437088

* docs: apply suggestions from code review

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
2022-04-28 19:36:57 +02:00
SukkaW
4f7d4bcc05 docs: replace all git.io links with their actual URLs 2022-04-28 18:06:08 +02:00
Marten Seemann
232ccb4e55
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>
2022-04-28 17:13:15 +02:00
Adin Schmahmann
d59730f51e
Update Go version to 1.17 (#8815)
* remove building the pre-bundled plugins as shared objects in makefile

* chore: update go version to minimum of 1.17
2022-04-15 14:32:00 -04:00
Marten Seemann
514411bedb
feat: opt-in Swarm.ResourceMgr (go-libp2p v0.18) (#8680)
* update go-libp2p to v0.18.0

* initialize the resource manager

* add resource manager stats/limit commands

* load limit file when building resource manager

* log absent limit file

* write rcmgr to file when IPFS_DEBUG_RCMGR is set

* fix: mark swarm limit|stats as experimental

* feat(cfg): opt-in Swarm.ResourceMgr

This ensures we can safely test the resource manager without impacting
default behavior.

- Resource manager is disabled by default
    - Default for Swarm.ResourceMgr.Enabled is false for now
- Swarm.ResourceMgr.Limits allows user to tweak limits per specific
  scope in a way that is persisted across restarts
- 'ipfs swarm limit system' outputs human-readable json
- 'ipfs swarm limit system new-limits.json' sets new runtime limits
  (but does not change Swarm.ResourceMgr.Limits in the config)

Conventions to make libp2p devs life easier:
- 'IPFS_RCMGR=1 ipfs daemon' overrides the config and enables resource manager
- 'limit.json' overrides implicit defaults from libp2p (if present)

* docs(config): small tweaks

* fix: skip libp2p.ResourceManager if disabled

This ensures 'ipfs swarm limit|stats' work only when enabled.

* fix: use NullResourceManager when disabled

This reverts commit b19f7c9eca.
after clarification feedback from
https://github.com/ipfs/go-ipfs/pull/8680#discussion_r841680182

* style: rename IPFS_RCMGR to LIBP2P_RCMGR

preexisting libp2p toggles use LIBP2P_ prefix

* test: Swarm.ResourceMgr

* fix: location of opt-in limit.json and rcmgr.json.gz

Places these files inside of IPFS_PATH

* Update docs/config.md

* feat: expose rcmgr metrics when enabled (#8785)

* add metrics for the resource manager
* export protocol and service name in Prometheus metrics
* fix: expose rcmgr metrics only when enabled

Co-authored-by: Marcin Rataj <lidel@lidel.org>

* refactor: rcmgr_metrics.go

* refactor: rcmgr_defaults.go

This file defines implicit limit defaults used when Swarm.ResourceMgr.Enabled

We keep vendored copy to ensure go-ipfs is not impacted when go-libp2p
decides to change defaults in any of the future releases.

* refactor: adjustedDefaultLimits

Cleans up the way we initialize defaults and adds a fix for case
when connection manager runs with high limits.

It also hides `Swarm.ResourceMgr.Limits` until we have a better
understanding what syntax makes sense.

* chore: cleanup after a review

* fix: restore go-ipld-prime v0.14.2

* fix: restore go-ds-flatfs v0.5.1

Co-authored-by: Lucas Molas <schomatis@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-07 21:06:35 -04:00
Justin Johnson
7b2c7c7f16
docs(logging): environment variables (#8833)
- Document IPFS_LOGGING deprecation
  as alias to GOLOG_LOG_LEVEL and expand doc
  to include per-subsystem log levels.

- Document IPFS_LOGGING_FMT deprecation
  as alias to GOLOG_LOG_FMT.
2022-04-06 17:24:23 +02:00
Gus Eggert
f855bfe6ef
feat: add basic gateway tracing (#8595)
* add deprecation warning when tracer plugins are loaded
* add response format attribute to span in gateway handler
* add note about tracing's experimental status in godoc
* add nil check for TTL when adding name span attrs
* add basic sharness test for integration with otel collector
* add nil check in UnixFSAPI.processLink
* test: sharness check all json objs for swarm span
* add env var docs to docs/environment-variables.md
* chore: pin the otel collector version
* add tracing spans per response type (#8841)
* docs: tracing with jaeger-ui

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-04 19:24:05 +02:00
Marcin Rataj
d6de97b417
docs: gateway.md (#8825)
Adds link to relevant pages at docs.ipfs.io
2022-03-28 16:31:36 +02:00
Marcin Rataj
4cabdfefbf
feat(gateway): Block and CAR response formats (#8758)
* feat: serveRawBlock implements ?format=block
* feat: serveCar implements ?format=car
* feat(gw): ?format= or Accept HTTP header

- extracted file-like content type responses to separate .go files
- Accept HTTP header with support for application/vnd.ipld.* types

* fix: use .bin for raw block content-disposition

.raw may be handled by something, depending on OS, and .bin
seems to be universally "binary file" across all systems:
https://en.wikipedia.org/wiki/List_of_filename_extensions_(A%E2%80%93E)

* refactor: gateway_handler_unixfs.go

- Moved UnixFS response handling to gateway_handler_unixfs*.go files.
- Removed support for X-Ipfs-Gateway-Prefix (Closes #7702)

* refactor: prefix cleanup and readable paths

- removed dead code after X-Ipfs-Gateway-Prefix is gone
  (https://github.com/ipfs/go-ipfs/issues/7702)
- escaped special characters in content paths returned with http.Error
  making them both safer and easier to reason about (e.g. when invisible
  whitespace Unicode is used)
2022-03-17 17:15:24 +01:00
Gus Eggert
bc33ed4c35
Update PATCH_RELEASE_TEMPLATE.md 2022-03-16 17:50:46 -04:00
Adin Schmahmann
eafa1c7345
docs: note the default reprovider strategy as all (#8603) 2022-03-10 01:42:33 -08:00
Gus Eggert
10ff11b4ca
chore: add instructions for Chocolatey release 2022-03-01 10:35:19 -05:00
Adin Schmahmann
686993f6f2
docs: add Internal.UnixFSShardingSizeThreshold (#8723)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-02-18 23:37:55 +01:00
Manuel Alonso
edb32ac3d7
chore(gateway): debug logging for the http requests (#8518)
* chore(gateway): better logging for the http requests

* chore(gateway): removed defer and add more data to the final log

* chore(gateway): debug logging refactor

* chore(gateway): use debug w/o context when only msg

* doc: add cmd for log level

* chore: add more logs and address fedback

* chore(gateway): log subdomains and from=requestURI, refactor

* chore(gateway): fix debug redirect
2022-02-15 17:13:09 -05:00
Marcin Rataj
f9643a61d7
docs: optionalInteger|String|Duration (#8729) 2022-02-10 23:52:18 +01:00
Thibault Meunier
a93907a40f
feat: DNS.MaxCacheTTL for DNS-over-HTTPS resolvers (#8615)
* feat: Add MaxCacheTTL option for DNS-over-HTTPS resolvers
* Update libp2p/go-doh-resolver dependencies to support Options
* feat: Add `DNS.MaxCacheTTL` config documentation
* docs: DNS.MaxCacheTTL
* chore: go-ipfs-config@v0.19.0
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-02-10 22:26:14 +01:00
Shu Shen
012be8ae08 chore: bump to go-ipfs@0.11 in go-ipfs-as-a-library 2022-02-02 21:15:51 -08:00
Marcin Rataj
4ad316803e
docs: update badger section in config.md (#8662)
This should fix the issue of users thinking badger
is "no-brainer faster choice" and then running into problems.

Co-authored-by: Johnny <9611008+johnnymatthews@users.noreply.github.com>
2022-01-28 23:22:26 +01:00
chblodg
562365f4fc Adding PowerShell to Minimal Go Installation
Separated CMD and PowerShell to add additional support.
2022-01-14 11:35:11 -05:00
Somajit
7e4fcbb324 Fixed typos in docs/config.md 2022-01-14 11:32:00 -05:00
Gus Eggert
deb79a2587
chore: add release template snippet for fetching artifact tarball 2021-12-09 15:47:44 -05:00
Gus Eggert
007921b900 chore: add release steps for upgrading Go 2021-12-09 11:24:02 -05:00
Marten Seemann
48a6cac00b
feat: Swarm.EnableHolePunching flag (#8562)
* feat: use Swarm.EnableHolePunching flag within libp2p
* docs: Swarm.EnableHolePunching

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2021-11-30 11:18:51 -08:00
jwh
029d82c4ea
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>
2021-11-30 11:00:11 -08:00
Jorropo
c2953ab8f1
feat: Addresses.AppendAnnounce (#8177)
* feat: Addresses.AppendAnnounce

Closes #7791

* fix: deduplicate Swarm.Announce and AppendAnnounce

https://github.com/ipfs/go-ipfs/pull/8177#discussion_r759317772
https://github.com/ipfs/go-ipfs/pull/8177#discussion_r759320332

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-30 17:58:19 +01:00
Marcin Rataj
82c1bfa0e6 feat: hard deprecation of IPFS_REUSEPORT
Years passed and we still see it. Time to force users to switch to
LIBP2P_TCP_REUSEPORT.
2021-11-29 14:42:30 -05:00
Adin Schmahmann
52c177ced9
feat: go-libp2p 0.16, UnixFS autosharding and go-datastore with contexts (#8563)
* plumb through go-datastore context changes

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

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

* use configuration option for static relays

* chore: go-ipfs-config v0.18.0

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

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

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

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

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

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

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

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Lucas Molas <schomatis@gmail.com>
2021-11-29 19:58:05 +01:00
Steve Loeppky
ba2445ae72
Updating release template based off some 0.10 learnings (#8491)
* Updating release template based off some 0.10 learnings

This addresses the easy items in https://github.com/ipfs/go-ipfs/issues/8248

* Further updates based on 2021-10-07 discussion.

* Added OrbitDB to early testers.

* Fixing early tester username references.

* Being clear about how to contact early testers.
2021-11-23 14:32:22 -05:00
Dimitris Apostolou
0c2f9d5950
Fix typos (#8548) 2021-11-17 21:16:06 +01:00
Adin Schmahmann
acede6f73c
Examples no longer need go mod replace (#8516)
* chore: bump examples to use v0.10.0
* feat: build examples against released packages instead of using replace directives to refer to the parent repo
* ci: run examples against the latest (unreleased) version of go-ipfs
2021-10-26 11:31:50 -04:00
Marcin Rataj
8b7432d6e8
chore: go-ipfs-files v0.0.9 (#8488)
Closes #8445
Closes #8406
2021-10-05 23:53:52 +02:00
Gus Eggert
0a4e484b4f
Update RELEASE_ISSUE_TEMPLATE.md 2021-10-04 15:47:01 -04:00
Gus Eggert
eaf464c41b
Update RELEASE_ISSUE_TEMPLATE.md 2021-10-04 15:28:17 -04:00
Gus Eggert
e4a5513045
Update RELEASE_ISSUE_TEMPLATE.md 2021-10-01 17:04:10 -04:00
Gus Eggert
86dc88c126
Update RELEASE_ISSUE_TEMPLATE.md 2021-10-01 17:02:25 -04:00
Steve Loeppky
727df2ceaf
Updating chocolatey to reference go-ipfs 2021-10-01 08:12:47 -07:00
Adin Schmahmann
85e30b9b36 fuse: load unixfs adls as their dagpb substrates 2021-09-27 17:50:44 -04:00
Marten Seemann
2589e1f65e enable the legacy mDNS implementation 2021-09-27 17:50:00 -04:00
Adin Schmahmann
5471092d85 chore: update go-path 2021-09-27 15:50:23 -04:00
Marten Seemann
4969ed2b17 chore: update go-libp2p to v0.15.0 2021-09-27 11:12:42 -04:00
Daniel Martí
d6127b062c make json, cbor, and git codecs error on empty input 2021-09-23 13:01:50 -04:00