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

Explore page: stop sending requests to remote HTTP servers #2266

Closed
Tracked by #10499
lidel opened this issue Sep 17, 2024 · 6 comments · Fixed by #2268
Closed
Tracked by #10499

Explore page: stop sending requests to remote HTTP servers #2266

lidel opened this issue Sep 17, 2024 · 6 comments · Fixed by #2268
Assignees
Labels
area/screen/explore Issues related to IPLS Explorer screen effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked

Comments

@lidel
Copy link
Member

lidel commented Sep 17, 2024

this is remaining part of regression initially identified in #2250

Bug

Explore page triggers block and delegated routing request to remote HTTP servers, including ones outside of control of IPFS project.

2024-09-17_14-32

This is bad because it does not leverage local gateway, wastes bandwidth, and leaks IPs and CIDs to third party servers, which is extra bad in private cluster contexts.

Expected behavior

Only the local Kubo RPC and Gateway should be used when IPLD Explorer is used in ipfs-webui.

  • There should not be any delegated /routing/v1 calls (local gateway will take care of routing, no need for doing it in JS over the internet)
  • The block requests ?format=raw should only go to localhost gateway (like we do for file previews)
@lidel lidel added kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up need/triage Needs initial labeling and prioritization labels Sep 17, 2024
@lidel
Copy link
Member Author

lidel commented Sep 17, 2024

@SgtPooki found this after testing latest main branch with #2250 merged, preferably we would fix this and then tag a release to close the privacy leak for private swarm users.

(fine to pick it up after you are back from JS week, we just want to include it in Kubo 0.31 ipfs/kubo#10499)

@SgtPooki
Copy link
Member

@lidel explorer components should only be calling remote gateways if it's enabled: https://github.com/ipfs/ipld-explorer-components/blob/cad6b454ec83940dea86ee1bfb20c415ce9efd18/src/lib/init-helia.ts#L20-L40

I think we can just add a localStorage.setItem('explore.ipld.gatewayEnabled', false) in ipfs-webui to disable this behavior for webui

@SgtPooki SgtPooki added status/ready Ready to be worked good first issue Good issue for new contributors exp/beginner Can be confidently tackled by newcomers effort/hours Estimated to take one or several hours area/screen/explore Issues related to IPLS Explorer screen and removed need/triage Needs initial labeling and prioritization labels Sep 18, 2024
@lidel
Copy link
Member Author

lidel commented Sep 18, 2024

@SgtPooki tried that, but then nothing works, just infinite spinner (for blocks that were not cached).

feels like there needs to be another setting which only uses specific gateway (webui would pass localhost one) and does not use delegated routing?

@SgtPooki
Copy link
Member

@lidel if you set the following localStorage config, does it fetch from the local gateway??

localStorage.setItem('kuboGateway', JSON.stringify({ port: '8080', trustlessBlockBrokerConfig: { init: { allowLocal: true, allowInsecure: true }}}))

@lidel
Copy link
Member Author

lidel commented Sep 23, 2024

@SgtPooki yep, seems to do the trick, but it works only if page is reloaded to apply new helia setting (so i guess we need to set this before helia init):

2024-09-23_22-22

2024-09-23_22-22_1

@SgtPooki
Copy link
Member

SgtPooki commented Sep 23, 2024

great thanks. I wanted to make sure it worked for you. That means we won't need ipld-explorer-component changes, just default localStorage changes for folks. PR incoming

@SgtPooki SgtPooki linked a pull request Sep 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/screen/explore Issues related to IPLS Explorer screen effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants