Ipfs-webui: webui on nas LAN

Created on 16 May 2019  路  5Comments  路  Source: ipfs/ipfs-webui

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

All 5 comments

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": []

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 :angry:

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/#/

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.

F me!!!! i found the issue
image

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

@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: https://github.com/ipfs-shipyard/ipfs-companion/issues/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).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

royforu picture royforu  路  4Comments

olizilla picture olizilla  路  5Comments

daviddias picture daviddias  路  3Comments

Luflosi picture Luflosi  路  3Comments

prettymuchbryce picture prettymuchbryce  路  5Comments