-
Notifications
You must be signed in to change notification settings - Fork 492
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
fix: local and public gateway links when cannot preview #1834
Conversation
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
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.
Looks good, but we should remove hardcoded ipfs.io and enable users to use gateways of their choosing.
- rename "with ipfs.io" to "public gateway"
- hide "local gateway" if it is same as public one
- make public gateway customizable
- add "Public Gateway" section to "Settings" screen (you can reuse "API" section for look and feel)
- it should read value from
window.localStorage.get('ipfsPublicGateway')
and if missing fallback to showing https://dweb.link - replace
ipfs.io
hardcoded in the app with value fromwindow.localStorage
(with fallback to https://dweb.link)
If Public Gateway === Available Gateway (local)OtherwisePublic Gateway SettingIf bad http urlIf emptyDefault: https://dweb.link |
Updated @lidel |
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.
Looks sweet!
I'm excited for this one – we will leverage the window.localStorage
trick in brave and ipfs-companion, to ensure webui uses gateway user set in respective GUI 😻
Needs review
- Confirm with native speaker that labels look ok
- (cc @autonome mind quickly eyeballing changes in https://github.com/ipfs/ipfs-webui/pull/1834/files →
public/locales/en/*
? preview in screenshots in comment above)
- (cc @autonome mind quickly eyeballing changes in https://github.com/ipfs/ipfs-webui/pull/1834/files →
Needs fixing:
- Opening non-unixfs DAG like http://localhost:3000/#/ipfs/baf4bcfg4ep767tjp5lxyanx5urpjjgx5q2volvy produces malformed message:
-
Share link
should use gateway set on Settings, instead of hardcodedipfs.io
:
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
cosmetic fix that adds reset button to public gateway section in Settings and disables buttons when they are no-op.
shareable links are better way to sonvey the practical meaning of this setting, other places are incidental
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.
Thank you!
Tweaked UI a bit so buttons are active only when they actually do something:
Merging + waiting with release till Friday for new labels to appear on Transifex.
FYSA filled follow-up issues:
- Settings: validate public gateway before saving it Settings: validate public gateway before saving it #1844
- Set ipfsPublicGateway and ipfsApi when opening webui Set ipfsPublicGateway and ipfsApi when opening webui ipfs-companion#1022
bah just saw this - the language and changes look good to me! |
Fixes #1767 by implementing the suggested solution: link to both local gateway and to ipfs.io.
Please note that
availableGatewayUrl
can be either the local gateway or ipfs.io and that is still used for all othertype
s.I could not reproduce #1767 since my computer always got the correct local gateway URL as the available gateway. To show both links, we hard code the ipfs.io link and fetch the actual
localGatewayUrl
from settings.This PR superseeds #1826.
License: MIT
Signed-off-by: Henrique Dias hacdias@gmail.com