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

feat: opt-in for loading webui from dnslink #738

Closed
wants to merge 2 commits into from

Conversation

lidel
Copy link
Member

@lidel lidel commented Jul 18, 2019

Requires #737 to be merged first (changes specific to this PR are in c2daf92)
Can be merged before ipfs/kubo#6530 lands

This PR Adds an opt-in toggle (disabled by default) to Preferences which changes the URL of Web UI opened via Browser Action menu from {API}/webui to {API}/ipns/webui.ipfs.io:

2019-07-18--22-48-30

This enables user to load the latest webui via DNSLink.

Note that go-ipfs and js-ipfs do not whitelist /ipns/webui.ipfs.io on the API port yet (ipfs/kubo#6530), so there is a fallback in place that detects HTTP 404 and redirects user to {API}/webui.

Closes: #736

This changes the way "Open Web UI" menu option works.

Before: we kept CID of latest version and opened it from gateway port +
executed a lot of magic to ensure it can talk to api port in secure way.

After: we removed all the magic and just open the version provided on
api port.

Details: #736
Adds an opt-in toggle (disabled by default) to Preferences
which changes the URL of Web UI opened via Browser Action menu
from {API}/webui to {API}/ipns/webui.ipfs.io

This enables user to load the latest webui via DNSLink.

Note that go-ipfs and js-ipfs do not whitelist /ipns/webui.ipfs.io on
the API port yet, so there is a fallback in place that detects HTTP 404
and redirects user to {API}/webui.

Closes: #736
@lidel lidel requested a review from olizilla July 18, 2019 20:50
@@ -351,6 +351,14 @@
"message": "Turn plaintext /ipfs/ paths into clickable links",
"description": "An option description on the Preferences screen (option_linkify_description)"
},
"option_webuiFromDNSLink_title": {
"message": "Load the latest Web UI",
Copy link
Member Author

Choose a reason for hiding this comment

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

@olizilla would appreciate your thoughts on how to name and describe this feature.
My initial stab looks like this:

2019-07-18--22-48-30

}
// Recover from a broken DNSLink webui by redirecting back to CID one
// TODO: remove when both GO and JS ship support for /ipns/webui.ipfs.io on the API port
if (request.statusCode === 404 && request.url === state.webuiURLString && state.webuiFromDNSLink) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This means we can ship this feature before ipfs/kubo#6530 lands

@lidel
Copy link
Member Author

lidel commented Apr 3, 2020

This will be possible to implement in much more elegant way when subdomain gateway lands.
Details in #860 Closing this as it did not age well.

@lidel lidel closed this Apr 3, 2020
@lidel lidel deleted the feat/opt-in-latest-webui-from-dnslink branch April 3, 2020 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Web UI version from IPFS Node
1 participant