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

WebUI can't connect to running IPFS Desktop node using http://webui.ipfs.io.ipns.localhost:8080/#/welcome #1880

Closed
momack2 opened this issue Jan 2, 2022 · 3 comments · Fixed by ipfs/ipfs-desktop#1956
Assignees
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up

Comments

@momack2
Copy link
Contributor

momack2 commented Jan 2, 2022

Describe the bug
when visiting http://webui.ipfs.io with a local IPFS Desktop node running, I get an error that it could not connect to the IPFS API -- however loading the webUI from http://127.0.0.1:5001/ipfs/bafybeihcyruaeza7uyjd6ugicbcrqumejf6uf353e5etdkhotqffwtguva/#/ works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Run local IPFS desktop node
  2. Go to http://webui.ipfs.io
  3. See error
  4. Go to http://127.0.0.1:5001/ipfs/bafybeihcyruaeza7uyjd6ugicbcrqumejf6uf353e5etdkhotqffwtguva/#/ or click "status" in IPFS Desktop menu - see correctly behaving node

Expected behavior
http://webui.ipfs.io should correctly connect to the IPFS node API

Screenshots
image

Desktop (please complete the following information):

  • OS: mac
  • Browser chrome
  • Version 96.0.4664.93 (Official Build) (x86_64)
@momack2 momack2 added the need/triage Needs initial labeling and prioritization label Jan 2, 2022
@hacdias
Copy link
Member

hacdias commented Jan 3, 2022

Hey @momack2! Quick question: did it work before and nothing changed? Perhaps a new installation/computer/user/IPFS repo. I can reproduce your error, but running the commands on step 2) fixes it.

Note: the Web UI at 127.0.0.1:5001 will work because it is in the same domain as the API. The version in https://webui.ipfs.io requires the correct CORS headers to be set.

@lidel I'm aware some things regarding CORS and IPFS changed lately (cc ipfs/ipfs-desktop#1899 (comment)). Can you take a look?

Idea: add an option in IPFS Desktop's menu to execute the commands in step 2). Some users may be uncomfortable with using a CLI and that would provide an alternative. What do you think?

@momack2
Copy link
Contributor Author

momack2 commented Jan 4, 2022

Gotcha - that was my hypothesis, but because I'm not actually running an IPFS node from the terminal (I'm running it via IPFS Desktop) I don't have a clear place to run those commands (I'm not sure where my ipfs directory is, or how to get at my running IPFS daemon inside Desktop). Maybe that is some documentation we can add to this error message, or to the settings page to help resolve for new users?

@lidel
Copy link
Member

lidel commented Jan 11, 2022

Agree with @momack2 suggestion that the CLI step should not be necessary for Desktop users, especially given adding ipfs CLI to PATH does not work reliably across all operating systems and distributions.

@hacdias it is better if this is automatic. IPFS Desktop should be safelisting webui.ipfs.io) in IPFS Desktop by default.

TODO here is

  • change default API.HTTPHeaders['Access-Control-Allow-Origin'] array to include https://webui.ipfs.io and http://webui.ipfs.io.ipns.localhost:8080
  • migrate existing users: add above entries if missing (they may be missing Access-Control-Allow-Origin entierely)
  • detect when Gateway port is different from 8080 and update CORS localhost entry before starting the daemon
    • caveat: Addresses.Gateway can be a string or array of strings – we need to detect both cases and in case of an array pick the 127.0.0.1 one

I'm aware some things regarding CORS and IPFS changed lately (cc ipfs/ipfs-desktop#1899 (comment)). Can you take a look?

CORS handling changed only in Electron context (we no longer need to manually tweak Origin). Here we talk about loading http://webui.ipfs.io in regular browser while IPFS Desktop daemon is running, so it is not impacted.

@lidel lidel removed their assignment Jan 11, 2022
@lidel lidel added effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up help wanted Seeking public contribution on this issue and removed need/triage Needs initial labeling and prioritization labels Jan 11, 2022
@lidel lidel added this to Weekly Candidates in Maintenance Priorities - JS Jan 11, 2022
@hacdias hacdias moved this from Weekly Candidates to In Progress in Maintenance Priorities - JS Jan 28, 2022
Maintenance Priorities - JS automation moved this from In Progress to Done Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants