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

Change DNSLink url resolution to <gateway>/ipns/<dnslink-domain> #20567

Closed
spylogsster opened this issue Jan 19, 2022 · 4 comments · Fixed by brave/brave-core#12088
Closed

Change DNSLink url resolution to <gateway>/ipns/<dnslink-domain> #20567

spylogsster opened this issue Jan 19, 2022 · 4 comments · Fixed by brave/brave-core#12088

Comments

@spylogsster
Copy link

spylogsster commented Jan 19, 2022

Check when both redirect options are enabled in Brave – https://docs.ipfs.io/?foo=bar redirects to https://bafybeifpyppkishqjofl6ahn6ky7udxuo5gn7s7fuzegrncfkm2ltevac4.ipfs.dweb.link/ instead of https://docs-ipfs-io.ipns.dweb.link/?foo=bar – Automatically redirect to IPFS pages via DNSLink when possible" should have precedence over "Redirect IPFS resources to the configured IPFS gateway", but it looks like it is the other way

Update: Currently we take value from DNSLink header and resolve it to urls like /ipfs/{cid}/path → ipfs://{cid}/path. Brave should not resolve DNSlink in address bar – it is losing human-readable name and it is replacing permanent address with CID of a snapshot in time – not what users want.

Brave should only check if a valid DNSLink is present, and redirect to /ipns/

@markg85
Copy link

markg85 commented Jan 19, 2022

That looks weird to me.
Shouldn't:
https://docs.ipfs.io/?foo=bar
redirect to:
https://bafybeifpyppkishqjofl6ahn6ky7udxuo5gn7s7fuzegrncfkm2ltevac4.ipfs.dweb.link/?foo=bar
as opposed to what you said:
https://bafybeifpyppkishqjofl6ahn6ky7udxuo5gn7s7fuzegrncfkm2ltevac4.ipfs.dweb.link/

I do agree that it should not redirect to https://docs-ipfs-io.ipns.dweb.link/?foo=bar

But imho the query parameters should always be preserved.
Note that in the issue i made under #18367 (and fixed by brave/brave-core#10694) that my very example url's are backed by DNSLink. So if the pull request fixes exactly my reported issue then it does what i'm stating above with the redirects (aka, it redirects to https://bafybeifpyppkishqjofl6ahn6ky7udxuo5gn7s7fuzegrncfkm2ltevac4.ipfs.dweb.link/?foo=bar). But i'm not able to test a brave build to confirm this.

Anyhow, we have some assumptions here so if you could provide some clarity on your case?

@lidel
Copy link

lidel commented Jan 19, 2022

@markg85 the bug discussed here was detected in the version of Brave before fix from brave/brave-core#10694, which is why the bug report uses URL without params.

You are correct, query parameters should always be preserved.
We expect redirect from https://docs.ipfs.io/?foo=bar to end up at https://docs-ipfs-io.ipns.dweb.link/?foo=bar

Could be related to #20320

@spylogsster
Copy link
Author

as discussed in slack with @lidel:

Brave should not resolve DNSlink in address bar – it is losing human-readable name and it is replacing permanent address with CID of a snapshot in time – not what users want.
- if someone bookmarks or shares the resolved address, they won't see future updates of the website
- /ipns/ is for mutable pointers, and user agent like Brave should keep them in GUI, inless user requests CID of the snapshot frozen in time
Brave should only check if a valid DNSLink is present, and redirect to <gateway>/ipns/<dnslink-domain>
- in case above, it should redirect to https://dweb.link/ipns/docs.ipfs.io (it is up to Gateway to verify CID, and redirect to URL-safe subdomain.

@spylogsster spylogsster changed the title DNSLInk should have precedence over configured IPFS gateway Change DNSLink url resolution to <gateway>/ipns/<dnslink-domain> Jan 31, 2022
@spylogsster spylogsster added this to the 1.37.x - Nightly milestone Feb 3, 2022
@stephendonner
Copy link

stephendonner commented Feb 4, 2022

Verified PASSED using

Brave 1.37.23 Chromium: 98.0.4758.87 (Official Build) nightly (64-bit)
Revision e4cd00f135fb4d8edc64c8aa6ecbe7cc79ebb3b2-refs/branch-heads/4758@{#1002}
OS Windows 10 Version 21H2 (Build 19044.1466)

Steps:

  1. fresh profile
  2. loaded http://docs.ipfs.io
  3. loaded brave://settings/ipfs
  4. set Method to resolve IPFS resources to Gateway
  5. toggled both Redirect IPFS resources to the configured IPFS gateway and Automatically redirect to IPFS pages via DNSLink when possible to ON
  6. reloaded the tab with https://docs.ipfs.io in the URL bar
  7. waited for the redirect

Confirmed I was redirected to https://docs-ipfs-io.ipns.dweb.link/.

example example example
20567-1 20567-2 20567-3

Verified PASSED using

Brave 1.37.91 Chromium: 99.0.4844.51 (Official Build) beta (x86_64)
Revision d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844@{#875}
OS macOS Version 12.3 (Build 21E230)

Steps:

  1. fresh profile
  2. loaded http://docs.ipfs.io
  3. loaded brave://settings/ipfs
  4. set Method to resolve IPFS resources to Gateway
  5. toggled both Redirect IPFS resources to the configured IPFS gateway and Automatically redirect to IPFS pages via DNSLink when possible to ON
  6. reloaded the tab with https://docs.ipfs.io in the URL bar
  7. waited for the redirect

Confirmed I was redirected to https://docs-ipfs-io.ipns.dweb.link/.

example example example
Screen Shot 2022-03-14 at 6 15 36 PM Screen Shot 2022-03-14 at 6 15 31 PM Screen Shot 2022-03-14 at 6 16 15 PM

Verification passed on

Brave 1.37.101 Chromium: 99.0.4844.83 (Official Build) beta (64-bit)
Revision b11086e62d7c1a44b0942ac5568d22a425c7ae35-refs/branch-heads/4844_74@{#5}
OS Ubuntu 20 LTS

Steps:

  1. fresh profile
  2. loaded http://docs.ipfs.io
  3. loaded brave://settings/ipfs
  4. set Method to resolve IPFS resources to Gateway
  5. toggled both Redirect IPFS resources to the configured IPFS gateway and Automatically redirect to IPFS pages via DNSLink when possible to ON
  6. reloaded the tab with https://docs.ipfs.io in the URL bar
  7. waited for the redirect

Confirmed I was redirected to https://docs-ipfs-io.ipns.dweb.link/.

image
image
image

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