Commit Graph

301 Commits

Author SHA1 Message Date
Gus Eggert
e550d9e476
ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
Antonio Navarro Perez
0e0136100e fix: Set default Methods value to nil 2022-09-27 18:51:04 +02:00
Jorropo
baccaef1b5
Merge pull request #9293 from Jorropo/webtransport
feat: add webtransport as an optin transport
2022-09-23 20:09:33 +02:00
Jorropo
8baec10146 feat: add webtransport as an optin transport 2022-09-23 19:50:55 +02:00
Antonio Navarro Perez
d1b9e41fc2
feat: Delegated routing with custom configuration. (#9274)
New multi-router configuration system based on https://hackmd.io/G1KRDEX5T3qyfoBMkIrBew#Methods

- Added a new routing type: "custom"
- Added specific struct types for different Routers (instead of map[string]interface{})
- Added `Duration` config type, to make easier time string parsing
- Added config documentation.
- Use the latest go-delegated-routing library version with GET support.
- Added changelog notes for this feature.

It:
- closes #9157
- closes #9079
- closes #9186
2022-09-22 15:47:45 +02:00
eth-limo
8e2bf82f97
docs: fix broken ENS DoH example (#9281) 2022-09-21 00:37:47 +02:00
Jorropo
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
Jorropo
82fbb84384 fmt: applies go1.19 fmt 2022-09-08 18:34:06 +02:00
Marcin Rataj
c9693edbc5 chore: remove Gateway.PathPrefixes
Closes #7702
2022-08-30 15:38:04 +02:00
Marco Munizaga
2b2efc662b Add allowlist config option 2022-08-15 14:12:21 -07:00
Marten Seemann
c3589a1728 WIP rcmgr auto limit scaling 2022-08-15 14:12:18 -07:00
Antonio Navarro Perez
92c4dc61a8
feat(routing): Delegated Routing (#8997)
* Delegated Routing.

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

* Requested changes.

* Init using op string

* Separate possible ContentRouters for TopicDiscovery.

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

* Set dht default routing type

* Add tests and remove uneeded code

* Add documentation.

* docs: Routing.Routers

* Requested changes.

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

* Add some documentation on new fx functions.

* Add changelog entry and integration tests

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

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

* test(sharness): delegated routing via reframe URL

* Add more tests for delegated routing.

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

* refactor: Routing.Routers: Parameters.Endpoint

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

* Try to improve CHANGELOG entry.

* chore: update reframe spec link

* Update go-delegated-routing dependency

* Fix config error test

* use new changelog format

* Remove port conflict

* go mod tidy

* ProviderManyWrapper to ProviderMany

* Update docs/changelogs/v0.14.md

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

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2022-07-07 17:10:25 -04:00
Marcin Rataj
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
Marcin Rataj
61f0710100
fix: remove mdns_legacy & Discovery.MDNS.Interval
* fix: remove mdns_legacy

We've been running both implementations for a long, long time.
It is time to remove legacy version and lower the number of LAN packets
IPFS node produces.

See https://github.com/ipfs/go-ipfs/pull/9048#discussion_r906814717
for the Interval removal rational.
2022-06-27 04:17:40 +02:00
Gus Eggert
3d527753ff feat: enable Resource Manager by default 2022-05-04 14:08:37 -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
Gus Eggert
74aff245d2
feat: persist limits to Swarm.ResourceMgr.Limits (#8901)
* feat: persist limit changes to config

This changes the "ipfs swarm limit" command so that when limit changes
are applied via the command line, they are persisted to the repo
config, so that they remain in effect when the daemon restarts.

Any existing limit.json can be dropped into the IPFS config easily
using something like:

cat ~/.ipfs/config | jq ".Swarm.ResourceMgr.Limits = $(cat limit.json)" | sponge ~/.ipfs/config

This also upgrades to Resource Manager v0.3.0, which exports the config
schema so that we don't have to maintain our own copy of it.

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-28 15:27:16 +02:00
Lucas Molas
6817fd4744 feat(cmds): allow to set the configuration file path 2022-04-22 13:03:28 -03: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
Dimitris Apostolou
6c6a55056d Fix typos 2022-03-18 00:58:36 +01:00
Laurent Senta
8d549f03f3 fix: rewrite dependencies over the go-ipfs-config package 2022-03-04 09:45:16 +01:00
Marcin Rataj
74e6436814 go-ipfs-config: docs: updated flatfs/badger profile helptext (#167)
This is copy-paste from https://github.com/ipfs/go-ipfs/pull/8662
to ensure consistency.
2022-01-28 23:39:10 +01:00
Thibault Meunier
9a0bd0fa7a go-ipfs-config: feat: add DNS.MaxCacheTTL for DNS-over-HTTPS resolvers (#161) 2022-01-20 20:04:53 +01:00
Jorropo
a6008f0e36 go-ipfs-config: feat: add Addresses.AppendAnnounce (#135) 2021-11-23 19:09:58 +01:00
Marten Seemann
ded27a5473 go-ipfs-config: feat: omitempty Swarm.EnableRelayHop for circuit v1 migration (#157)
* re-add the Swarm.EnableRelayHop option
* make Swarm.EnableRelayHop omitempty

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-23 18:45:11 +01:00
Marcin Rataj
d50960f9e3 go-ipfs-config: chore: omitempty Experimental.ShardingEnabled (#158)
We switch to autosharding setup in
https://github.com/ipfs/go-ipfs/pull/8527
2021-11-23 18:44:35 +01:00
Marcin Rataj
5ca8226610 go-ipfs-config: chore: update comment to match struct 2021-11-18 01:35:49 +01:00
Marten Seemann
7fe155c287 go-ipfs-config: feat: add a flag to enable the hole punching service (#155)
* add a flag to enable the hole punching service
* chore: omitempty EnableHolePunching

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-16 11:55:46 +01:00
Marcin Rataj
aefce5a6cd go-ipfs-config: refactor: AutoRelay → RelayClient
https://github.com/ipfs/go-ipfs-config/pull/154#discussion_r749324695
2021-11-15 15:45:55 +01:00
Marten Seemann
bf3a2ca8de go-ipfs-config: set Swarm.EnableAutoRelay to omitempty
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-15 17:34:58 +04:00
Marten Seemann
dcf17eb24a go-ipfs-config: improve AutoRelay configuration, add config option for static relays 2021-11-14 16:58:03 +04:00
Marten Seemann
d2268793dc go-ipfs-config: feat: Swarm.RelayService (circuit v2) (#146)
* remove the EnableRelayHop option in the SwarmConfig

* add an option to disable the limited relay

* make the relay service resources configurable

* refactor: use custom types

This enables us to swap defaults in go-ipfs without touching the config
file generated during `ipfs init`

https://github.com/ipfs/go-ipfs-config/pull/146#discussion_r734728162
https://github.com/ipfs/go-ipfs-config/pull/146#discussion_r734728019

* use OptionalDuration in RelayService configuration

* fix: *OptionalInteger with omitempty

This removes null values from the config

* fix: Flag does not need to be a pointer

* refactor: flatten RelayService limits

this simplifies consumer code and removes nil footgun

* docs: clarify different relay types

* feat: flag for ForceReachability mode in libp2p (#150)

adds Internal.Libp2pForceReachability
needed for sharness tests in ipfs/go-ipfs#8522

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

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-13 03:07:14 -08:00
Marten Seemann
ba9d9f609c go-ipfs-config: fix: String method on the OptionalString (#153)
* fix: String method on the OptionalString
* test(OptionalString): empty string is preserved

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-29 17:21:53 +02:00
Adin Schmahmann
cdaa222b22 go-ipfs-config: feat: OptionalString type and UnixFSShardingSizeThreshold (#149)
* feat: add OptionalString type
* test: fix OptionalInteger test
* add Internal.UnixFSShardingSizeThreshold as optional string
* test: OptionalString null unmarshal with default
* fix: omitempty UnixFSShardingSizeThreshold

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-28 22:55:08 +02:00
jwh
9eaf572b28 go-ipfs-config: feat: pubsub and ipns pubsub flags (#145)
* enable pubsub and namesys pubsub to be enable via config
* rename Ipns key, switch type to Flag
* omit the fields if empty
2021-10-27 21:50:10 +02:00
Marten Seemann
2cf170d5fa go-ipfs-config: feat: add an OptionalDuration type (#148)
* feat: make it possible to define optional durations
* test: empty/default optional durations
does not crash if user restores default value and sets it to empty string ""

* refactor: use null in JSON
* refactor(duration): use JSON null as the default

Rationale:
https://github.com/ipfs/go-ipfs-config/pull/148#discussion_r736975879

* refactor: Duration → OptionalDuration

This makes it possible to use OptionalDuration with `json:",omitempty"`
so the null is not serialized to JSON, and get working WithDefault as well.

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-27 18:23:35 +02:00
Petar Maymounkov
44291176e6 go-ipfs-config: feat: add Internal and Internal.Bitswap config options 2021-08-18 08:14:25 -04:00
Adin Schmahmann
ac81804c8c go-ipfs-config: feat: add an OptionalInteger type 2021-08-18 08:14:25 -04:00
Adin Schmahmann
7c1029c515 go-ipfs-config: fix: make sure the Priority type properly implements the JSON marshal/unmarshal interfaces 2021-08-18 08:14:25 -04:00
Steven Allen
c692e73f3f go-ipfs-config: fix: remove deprecated calls
And rename imports.
2021-07-22 15:54:33 -07:00
web3-bot
8f09fa547f go-ipfs-config: run gofmt -s 2021-05-17 17:00:43 +00:00
Michael Burns
e7bb833760 go-ipfs-config: [LINT] error strings should not end with punctuation or a newline (ST1005) 2021-05-14 14:31:24 -07:00
Adin Schmahmann
22d2b6b8b8 go-ipfs-config: add option for Accelerated DHT Client experiment 2021-05-12 15:13:47 -04:00
Steven Allen
f7b64b3d95 go-ipfs-config: Merge pull request #128 from ipfs/feat/migration-config
Add config for downloading repo migrations
2021-05-03 10:50:38 -07:00
gammazero
4b778ce326 go-ipfs-config: Removed Peers from migration config 2021-05-03 09:08:16 -07:00
gammazero
dbb5fa78a5 go-ipfs-config: Fix comment 2021-04-20 00:29:38 -07:00
gammazero
ec1659d79a go-ipfs-config: Init migration config with empty values 2021-04-19 23:41:54 -07:00
Adin Schmahmann
98052e9025 go-ipfs-config: Merge pull request #121 from RubenKelevra/patch-1
remove duplicate entries in defaultServerFilters
2021-04-19 08:53:04 -07:00
gammazero
5e6df6f54a go-ipfs-config: unit test for migration config 2021-04-17 18:19:05 -07:00
gammazero
67456e2e64 go-ipfs-config: Add config for downloading repo migrations 2021-04-16 17:35:34 -07:00