little-bear-labs / ipfs-chromium

19 stars 1 forks source link

DNSLink fallback to gateway #115

Closed John-LittleBearLabs closed 1 week ago

John-LittleBearLabs commented 3 weeks ago

Has to be turned-off-able through preferences (it is), because of the security implications.

If the DNS TXT request/path fails for one reason or another, then request IPFS gateways resolve the name for you. There's actually a few reasons why this could be helpful:

  1. Your system's DNS setup (e.g. resolv.conf) isn't quite reproducible by Chromium so it gave up on reproducing it before it got to DNSClient. None of the other DNS providers inside Chromium support TXT requests.
  2. DNS in general where you are might be botched in some weird way. It pretty much has to be a weird way, because it can still reach the gateways.
  3. Coincidentally solves the ENS support ticket - one of the first tickets added by not-me. You can't fetch TXT records for a .eth domain through normal DNS, but many gateways do support such a resolver.
codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 50.34%. Comparing base (cf03085) to head (4d2d777).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## regscheme #115 +/- ## ============================================= + Coverage 50.31% 50.34% +0.03% ============================================= Files 477 477 Lines 16093 16145 +52 Branches 1750 1755 +5 ============================================= + Hits 8097 8129 +32 - Misses 7440 7459 +19 - Partials 556 557 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

John-LittleBearLabs commented 3 weeks ago

Ignore chromium_edits/ here. The most important changes are in gateway_request.cc , multi_gateway_requestor.cc , and dnslink_requestor.cc . Some stuff in Client and preferences.cc as well, but borderline trivial.