-
Notifications
You must be signed in to change notification settings - Fork 875
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
wip: proxy IPFS API instead of disabling web security #738
Conversation
License: MIT Signed-off-by: Henrique Dias <[email protected]>
Here I'm using a Web UI version that accepts
@olizilla could we release a new version of redux-bundle with this PR: ipfs-inactive/ipfs-redux-bundle#20 ? |
Fast work @hacdias. I'm seeing issues trying to upload large files (>180MB), they crash the webui window. |
Using the webui in Firefox 63 and Chrome 70, I can upload large files without issue. Perhaps Electron ships with an older version of chromium that has issues with that? Thinking out loud (totally up for discussion on this) perhaps the best solution is the simplest one? what if the desktop menubar opens the webui in the users default browser, via http://127.0.0.1:5001/webui The Web UI would be pulled from IPFS on first usage and be available offline after that. Desktop would be helping the user by showing that IPFS is running from the taskbar, and the menu bar would mean they dont have to remember the awkward http://127.0.0.1:5001/webui/ url. but otheriwse there is no magic, and the users expectation of the webui would be that of a website, as we'd be showing it in their browser. |
of note, if we use http://127.0.0.1:5001/webui we don't need a postmsg-proxy and we don't need to set CORS headers. It means the user needs to fetch the webui on first run, which is a downside, but we could fix that by shipping with a tar of the actual ipfs blocks for webui, pinned at the version of the ipfs impl that we ship with, and just |
I also wanna call out that I'm super impressed @hacdias that you got all the changes to make it work via postmsg proxy done so quickly. This still may be the right solution, but I just want to check that we're not missing a simpler one. |
Awesome work @hacdias! It is a neat proof the proxy works fine in electron apps as well! We should update README at ipfs-postmsg-proxy with MVP code snippet for electron – mind PRing?
(cc ipfs/ipfs-webui#858) this feels like a regression around stream-http, ipfs-companion fixed it in ipfs-inactive/js-ipfs-http-client#868.
This sounds cool, offline use case would still work, we avoid proxying and actually use IPFS here as an added benefit :) I'm more than okay with this, but to avoid playing with raw blocks (is block format the same for js-ipfs and go-ipfs? did it change in the past?) we could alternatively have regular Note that there is a benefit of "native feel" when Web UI is opened in Electron window, so we may decide to continue doing that. |
@olizilla it seems that the latest stable release of Electron used Chromium 66.0.3359.181 which seems a far behind 70. Although I can't confirm that's the source of the issue. It's probably what @lidel said. @olizilla @lidel I can see only two issues with using the Web UI from the daemon:
On the other hand:
I enjoy it either way. It's not something that I think that changes the user experience a lot. If we use the user default's browser there might be more compatibility issues but I doubt anyone is using an obsolete browser. It might be even more updated than Electron's Chromium version. |
Just as as something I remembered now: if we use user default browser how will we inject IPFS Desktop settings into Web UI? |
What if we open Web UI from This way:
|
@olizilla I see the version is hardcoded into I think @lidel idea of using |
So the situation is
A proposal
That way we can release newer versions webui without waiting for a go-ipfs release, and avoid making changes to the ipfs cors config. It seems preferable to take on a tiny risk of someone hacking their copy of Desktop to use it as a general purpose web-browser, than leaving a possible CORS hack open in a config file that may live on beyond the lifetime of the desktop app. Questions
|
As @lidel pointed out, it might not be related to the proxy but to ipfs/ipfs-webui#858.
I think it would be nicer to fetch it via IPFS. We could fetch it on the first run before starting up menubar.
If y'all agree I can do that for now in a separate PR so we can merge this one later while the big file issue isn't resolved. |
The webui supports large file uploads via the http api. The update to the module formerly known as js-ipfs-api mentioned in ipfs/ipfs-webui#858 landed in webui 2 months ago. It may be related to the same issue, but we need to investigate.
@hacdias please go ahead! |
Closing this PR since we decided to disable |
Update: we decided to remove the CORS headers and disable web security for now until we solve the issue of uploading big files with this PR (#740).
Using
ipfs-postmsg-proxy
it is possible to avoid needing the CORS headers #728.I needed to block
ipfsd-ctl
to version 0.40 because 0.40.1 uses the newest IPFS HTTP Client which is not backwards compatible with the.files
API. Otherwise we would have got errors. We should updateipfs-redux-bundle
and Web UI. It will be mostly find and replace. Will open a PR soon.TODO:
ipfs-redux-bundle
detects Desktop and shows it as the provider feat: add ipfs-desktop support ipfs-inactive/ipfs-redux-bundle#20ipfs-redux-bundle
gets a new versionupdate Web UI to use the newest HTTP Client(can be done in another PR)remove the 'lock' on(blocked by the above)ipfsd-ctl
Closes #728.