-
Notifications
You must be signed in to change notification settings - Fork 324
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
Conversation
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
@@ -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", |
There was a problem hiding this comment.
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:
} | ||
// 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) { |
There was a problem hiding this comment.
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
This will be possible to implement in much more elegant way when subdomain gateway 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
: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