From 338d9ebc2dc4c98e85851f849571f56d3d4a6f83 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 30 Oct 2024 01:17:28 +0100 Subject: [PATCH 1/5] fix: include transport-ipfs-gateway-http from IPNI Since we don't have HTTP retrieval client in golang (boxo) yet, the default filter in boxo/routing/http/client does not include transport-ipfs-gateway-http yet, which means someguy as a proxy was filtering them out, making them unavailable to JS clients that DO have HTTP support (e.g. SW gateway at inbrowser.link). This overrides implicit filters with explicit ones that include transport-ipfs-gateway-http restoring those IPNI results from cid.contact. --- server.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 985d11d..3c937be 100644 --- a/server.go +++ b/server.go @@ -16,7 +16,7 @@ import ( "github.com/CAFxX/httpcompression" sddaemon "github.com/coreos/go-systemd/v22/daemon" "github.com/felixge/httpsnoop" - "github.com/ipfs/boxo/routing/http/client" + drclient "github.com/ipfs/boxo/routing/http/client" "github.com/ipfs/boxo/routing/http/server" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p" @@ -215,7 +215,15 @@ func getCombinedRouting(endpoints []string, dht routing.Routing) (router, error) var routers []router for _, endpoint := range endpoints { - drclient, err := client.New(endpoint, client.WithUserAgent(userAgent)) + drclient, err := drclient.New(endpoint, + drclient.WithUserAgent("someguy/"+buildVersion()), + drclient.WithProtocolFilter([]string{ + "unknown", // allow results without protocol list, allowing end user to do libp2p Identify probe to test them + "transport-bitswap", + "transport-ipfs-gateway-http", + }), + drclient.WithDisabledLocalFiltering(false), // force local filtering in case remote server does not support IPIP-484 + ) if err != nil { return nil, err } From 83d5b28627458179b405f440bcc6577debf0a64c Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 30 Oct 2024 01:37:12 +0100 Subject: [PATCH 2/5] chore: bugfix release v0.5.3 --- CHANGELOG.md | 6 ++++++ version.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6536ed6..fbfcf00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ The following emojis are used to highlight certain changes: ### Security +## [v0.5.3] + +### Fixed + +- default config: restore proxying `transport-ipfs-gateway-http` results from IPNI at `cid.contact` [#83](https://github.com/ipfs/someguy/pull/85) + ## [v0.5.2] ### Changed diff --git a/version.json b/version.json index cdebeab..ef97c9c 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "v0.5.2" + "version": "v0.5.3" } From 8d7d751009772f4b26278a6fc7ca3de2649cc02f Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 30 Oct 2024 01:41:48 +0100 Subject: [PATCH 3/5] chore: lint --- version.go | 1 - 1 file changed, 1 deletion(-) diff --git a/version.go b/version.go index c59c5a1..aaaec3e 100644 --- a/version.go +++ b/version.go @@ -13,7 +13,6 @@ var versionJSON []byte var name = "someguy" var version = buildVersion() -var userAgent = name + "/" + version func buildVersion() string { // Read version from embedded JSON file. From a2abe25feaf8f6f025f65fdb4e5d6e86a384f027 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 30 Oct 2024 16:00:21 +0100 Subject: [PATCH 4/5] fix: disable filtering in /routing/v1 client https://github.com/ipfs/someguy/pull/85#discussion_r1822451867 --- server.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server.go b/server.go index 3c937be..f7c955b 100644 --- a/server.go +++ b/server.go @@ -217,12 +217,9 @@ func getCombinedRouting(endpoints []string, dht routing.Routing) (router, error) for _, endpoint := range endpoints { drclient, err := drclient.New(endpoint, drclient.WithUserAgent("someguy/"+buildVersion()), - drclient.WithProtocolFilter([]string{ - "unknown", // allow results without protocol list, allowing end user to do libp2p Identify probe to test them - "transport-bitswap", - "transport-ipfs-gateway-http", - }), - drclient.WithDisabledLocalFiltering(false), // force local filtering in case remote server does not support IPIP-484 + // override default filters, we want all results from remote endpoint, then someguy's user can use IPIP-484 to narrow them down + drclient.WithProtocolFilter([]string{}), + drclient.WithDisabledLocalFiltering(true), ) if err != nil { return nil, err From 74eefc097a777cc9c1266d113a7aaf9fd0cefed6 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 30 Oct 2024 16:19:22 +0100 Subject: [PATCH 5/5] docs: update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbfcf00..f2201cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ The following emojis are used to highlight certain changes: ### Fixed -- default config: restore proxying `transport-ipfs-gateway-http` results from IPNI at `cid.contact` [#83](https://github.com/ipfs/someguy/pull/85) +- default config: restore proxying of all results from IPNI at `cid.contact` [#83](https://github.com/ipfs/someguy/pull/85) ## [v0.5.2]