ipfs-webui
ipfs-webui copied to clipboard
Download Broken - Tries To Use IPFS gateway at 0.0.0.0:8080
Version information:
go-ipfs version: 0.8.0-ce693d7 Repo version: 11 System version: amd64/linux Golang version: go1.14.4
The above is from a container running docker tag ipfs/go-ipfs:v0.8.0, running on Ubuntu 20.04 LTS.
Description:
Browse to the admin web site (yourserver:5001), click on Files, click on the elipsis, and click Download. The download will fail.
If you use F12 in FireFox to open the networking tab and try again, you'll see a GET failure to 0.0.0.0:8080. Presumably, the web site is assuming that the IP address the gateway HTTP server is bound on is also an IP address it can use from the browser.
Since the IPFS gateway is running in a Docker container, it binds to 0.0.0.0, and does not know what the external IP address of its own IPFS gateway is. This would also apply if the IPFS gateway is behind a reverse proxy or NAT.
Suggested changes
- The web site should detect obvious incorrect information for the gateway (e.g. when it is 0.0.0.0) and alert the user. The web site already does this for detection of incorrect CORS configuration
- There should be an additional setting to specify the public address of its own gateway. If this setting already exists, the alert should describe how to configure it or refer the user to documentation on how to do it
A harsher option could be to require the new field to be populated when the gateway is bound to 0.0.0.0, but that wouldn't be backward compatible.
Thank you for reporting this – it is a bug in ipfs-webui – moving to the correct repo.
It reads Gateway address from go-ipfs config but does not seem to validate if it is reachable. The fix here is to test if local gateway can be used by making a request similar to one in https://github.com/ipfs/ipfs-webui/commit/ebda7644dbf1a4cf0712b31a5fa3a68ccf3aa470.
If someone wants to pick this up, this might be tackled together with https://github.com/ipfs/ipfs-webui/issues/1814#issuecomment-873000366
We need to reproduce this and make sure we have documented the steps for doing so. We will then probably need to clarify what sort of messaging to provide to users (prompt them to update gateway configured in settings?) given an invalid gateway URL from go-ifps
I would also be interested in that feature since it will allow browsing and using a deployed ipfs container on a local network. For now the webui works fine but all the download fail.
Using kubo in docker and there the gateway is 0.0.0.0 which is of course not reachable from the outside, but changing the gateway to the domain crashes kubo.
Can we make the gateway configurable in the frontend?