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 on nas LAN #1038

Closed
icf20 opened this issue May 16, 2019 · 5 comments
Closed

webui on nas LAN #1038

icf20 opened this issue May 16, 2019 · 5 comments

Comments

@icf20
Copy link

icf20 commented May 16, 2019

i installed ipfs on a nas for LAN using docker

when i try to access webui i get this

Is your IPFS daemon running?
Failed to connect to the API.

ipfs companion works tho

exactly what i need to do and get this working

@olizilla
Copy link
Member

This is likely a problem with the CORS configuration of your ipfs node. If you are accessing the webui via a local IP address on your LAN, then you need to add that origin to the allowed domains config.

$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["<ip address and port of remote api>"]'

To see that that is doing, you can open up the config file for your node in the IPFS_HOME/config file. You need to add your origin to the array in:

{
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Origin": []

@icf20
Copy link
Author

icf20 commented May 20, 2019

This is likely a problem with the CORS configuration of your ipfs node.

is the default config i dint change anything

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["my_pc_ip"

does nothing

edit: i blame this on the companion 😠

the companion "open web ui" open a tab like this http://local_ip:8080/ipfs/QmfQkD8pBSBCBxWEwFSu4XaDVSWK6bjnNuaWZjMyQbyDub/#/welcome

but it should open
http://local_ip:8080/ipns/webui.ipfs.io/#/

@olizilla
Copy link
Member

No need to blame companion just yet! It sounds like it is doing the right thing.

/ipns/webui.ipfs.io is an address for the bleeding edge dev version of the web UI. It gets updated whenever we merge code into master.

Companion is opening the stable release of Web UI, via an immutable ipfs address. It should open fine. The challenge is that you'd like it to talk to an API on a different machine on your LAN. Right now it's not easy to do that as you have to update the CORS config on your ipfs node to allow access via the LAN IP address for your nas.

@icf20
Copy link
Author

icf20 commented Jun 7, 2019

F me!!!! i found the issue
image

companion block this from working because not https removing the companion let me use the wengui perfectly

@lidel
Copy link
Member

lidel commented Jul 17, 2019

@icf20 thank you for raising the issue of poor UX when opening Web UI from LAN IP.

We plan to simplify the way Companion opens Web UI: ipfs/ipfs-companion#736
(this will make it work in LAN scenario without the need of setting CORS)


Not sure how useful it is, but some additional context:

is the default config i dint change anything

Default config assumes you are running and accessing Web UI via localhost interface.
Unless you set up HTTPS, the LAN IP is not considered a Secure Context and may require additional configuration. AFAIK go-ipfs has additional code that returns HTTP 403 unless you are sending request from localhost.

i found the issue

This is not related to Web UI issues. It means that if you have HTTPS website with images loaded from IPFS paths, IPFS Companion will redirect requests for those images to your node at LAN IP. If node in LAN does not have HTTPS, browsers will produce mixed content errors. It is a limitation of the web platform (Secure contexts).

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

No branches or pull requests

4 participants