Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no implicit filtering of proxied IPNI results #85

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
lidel marked this conversation as resolved.
Show resolved Hide resolved

## [v0.5.2]

### Changed
Expand Down
12 changes: 10 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what someguy is doing (i.e. serving as a proxy) why not let all protocol through rather than limiting them?

e.g. why shouldn't GraphSync peers, or those from some new protocol show up here without being explicitly added?

Given that programmatic clients that want to use the data for content routing directly (e.g. helia) will send their own filters to be layered on top pre-filtering the data doesn't seem necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point about no filtering being a better default for someguy and ecosystem.
Disabled filtering in a2abe25.

But I've filled #86 to add support for setting implicit filters for deployments that would benefit from reduced default response sizes.

drclient.WithDisabledLocalFiltering(false), // force local filtering in case remote server does not support IPIP-484
)
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v0.5.2"
"version": "v0.5.3"
}
Loading