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

IPFS links use wrong gateway with companion installed #17757

Closed
MysticRyuujin opened this issue Aug 30, 2021 · 3 comments · Fixed by brave/brave-core#11795
Closed

IPFS links use wrong gateway with companion installed #17757

MysticRyuujin opened this issue Aug 30, 2021 · 3 comments · Fixed by brave/brave-core#11795

Comments

@MysticRyuujin
Copy link

MysticRyuujin commented Aug 30, 2021

Description

When trying to access an IPFS hash at IPFS://<hash> the browser attempts to connect to locahost:48084 even though nowhere in my configuration do have port 48084 configured.

I have the IPFS Companion installed, and I run a local IPFS node on the system, so it's configured for localhost:8080
Companion_Status

Brave is configured to use the IPFS Companion (and Method to resolve is set to Local node)
Brave_Settings

However, when I attempt to access a link for the first time using ipfs://<hash> it tries to hit localhost:48084 and after a VERY long time it eventually seems to return a 301 Moved Permanently then gets redirected to 8080 which then immediately returns another 301 Moved Permanently (this time to http://<hash>.ipfs.localhost:8080/ and the asset loads/works fine.
48084

I don't have port 48084 configured ANYWHERE either in Brave or in my IPFS companion, so I have no idea where this port is coming from and why it's not just using 8080 configured in the companion?

The hash I'm trying to load here is/was pinned to my local node.

Steps to Reproduce

  1. Run a local IPFS node
  2. Enable IPFS Companion, point everything at your local node
  3. Try to access an IPFS://<hash> directly via the address bar
  4. See above screenshots

Actual result:

See above screenshots also:
image

Expected result:

IPFS://<hash> link entered into the address bar should hit my correctly configured gateway - through the IPFS companion configuration...

Reproduces how often:

I can reproduce this with my current settings, trying to load ANY hash via IPFS://<hash> in the address bar.

Brave version (brave://version info)

Version 1.28.106 Chromium: 92.0.4515.159 (Official Build) (64-bit) - Linux Mint 20.2 (Uma)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? idk
  • Can you reproduce this issue with the nightly channel? idk

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? No
  • Does the issue resolve itself when disabling Brave Rewards? No
  • Is the issue reproducible on the latest version of Chrome? N/A

Miscellaneous Information:

@MysticRyuujin
Copy link
Author

This could be somewhat related to #16901

@lidel
Copy link

lidel commented Sep 20, 2021

Indeed, "Local node" is IPFS node provided by Brave itself, it exposes the gateway on port 48080 – confusing when you have ipfs-desktop installed and running on 8080.

In this specific case Companion does its best to pick the right port and iirc defaults to 48080 when available (prioritizing built-in node over custom external one).

Switching gateway port in Companion

@MysticRyuujin You can change which gateway port should be used by Companion in its Preferences (behind the ⚙️) – see detailed instructions in ipfs/ipfs-companion#1020 (comment)

2021-09-24_15-25
2021-09-24_15-28_1
2021-09-24_15-29
2021-09-24_15-28

Making Local node label more explicit

As for improving UX in Brave, we should make it clear that "Local node" means "IPFS node run and managed by Brave".
I would go with "Brave node" to be extra clear where the node lives.

@stephendonner
Copy link

Verified PASSED using

Brave 1.36.32 Chromium: 97.0.4692.71 (Official Build) nightly (64-bit)
Revision adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}
OS Windows 10 Version 20H2 (Build 19042.1415)

Steps:

  1. fresh profile
  2. launch Brave
  3. load ipns://en.wikipedia-on-ipfs.org
  4. click on Use a Brave local IPFS node
  5. go to Settings
  6. loaded brave://settings/ipfs
  7. confirmed the dropdown option is now renamed to Brave local IPFS node
example example
brave-local-ipfs-node-2 brave-local-ipfs-node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants