-
Notifications
You must be signed in to change notification settings - Fork 494
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 incorrectly assumes "localhost" for the gateway #1872
Comments
@kallisti5 I agree that it may not be the expected result, but if it says localhost, because:
If you browse from a different machine, you'll see that only the public gateway will be visible. At least this is what I've been able to reproduce. I'm not sure if we're supposed to change this behaviour. Right now, Addresses.Gateway can provide multiple addresses and we pick the first one to test. However, we can also change it so we test all of them and prioritize them by the order they show up in the configuration. So if localhost is the first and is available, that will be the one that shows. We can also see if the origin is present in Addresses.Gateway, and if so we try that first. What do you think? /cc @lidel |
I'm leaning towards closing this issue, unless there is a bug or a feature request that solves UX problem. @kallisti5 afaik you experienced go-ipfs' security feature that aims at preventing people from exposing RPC API port as a Gateway one by mistake. Below some explainers. RPC API at
|
No gateway running on my localhost. I have a machine on my network serving as a gateway for all of my systems and hosting around 200 GiB of content. I feel like a lot of these issues are because the user stories are too rigid. A percentage of users much less than 100% will be running IPFS on an external machine.
Most home networks (the most compelling place to run IPFS nodes hosting data) are behind a NAT, thus most home users are going to have "one IPFS node" since it's easy to tunnel IPFS through their router to a single machine. Your user story assuming everyone running IPFS on their local machine doesn't scale to real world usage requirements. As for security, sure.. anything on my network can access the api server. It's a private network so that's fine. At the end of the day, users run into these mysterious issues, look at them as bugs, and move on from IPFS. I tried getting a bunch of techy users to mirror our repositories and ran into the same general complaints over and over. |
Correct. ipfs-webui won't work for every setup. ipfs-webui, as it is today, is limited by the current security model of go-ipfs RPC API and web browsers. It is not perfect, but makes webui work out of the box for Desktop users, and scales pretty well for server/remote nodes, as long you tie RPC API to localhost (eg. tunnel it over SSH, if you run it on a remote box). The "webui power user group opening webui via LAN IP" has never been the core audience of ipfs-webui, and doing it means you will hit some problems in browsers (unencrypted HTTP traffic to a LAN IP is not a Secure Context, while This could change/improve in the future if go-ipfs adds some access controls for the RPC API (ipfs/kubo#1532), and/or when we have proper protocol handlers for
Ah, this sounds like a bug! But i don't believe it is. If you have no Gateway on localhost, then the test ( I suspect it does not fail because you have IPFS companion enabled, and it redirects the request to the correct gateway. Mind testing again, but with IPFS Companion disabled? |
Correct. IPFS companion is indeed installed and is configured for my gateway server at 192.168.1.80:8080
Confirmed. The gateway changes from localhost to ipfs.io when companion is disabled. Ideally it would change to 192.168.1.80:8080 (my configured gateway in the companion), however ipfs.io would at least not be "broken" :-) |
@whizzzkid This issue seems to be related to ipfs-companion not respecting the configured local-gateway. Can you confirm? |
Just ran into the same issue. According to @lidel Note that the Address.Gateway docs specifically controls the address to bind the listening socket to. In my case I run Kubo in a Docker container, which has its own subnet, so I can only bind to 0.0.0.0. Webui tries to fetch It seems that the "public gateway" is not used as a fallback after all, or the error message is confusing and there's no workaround here. |
Hello all, I just ran into the issue also, but in a worse situation, I run kubo as a service (directly the ipfs executable, no Docker) on a server where 8080 is already used so I set my Gateway conf with the port 8484, but ipfs-webui still tries to make a connection to 127.0.0.1:8080 if I want to inspect a CID. 127.0.0.1 won't work as my browser isn't on the same machine, but 8080, I didn't find yet where it comes from. Edit: already seen here #1715 Edit bis: with more digging I saw that the explore page is implemented by ipld-explorer-components, and I think the address 127.0.0.1:8080 comes from here :
But I don't know how to fix things so that helia uses the gateway address we want instead of using the default one. |
Did you ever resolve. Having this issue myself. |
Hi, no sorry, I mounted an ipfs node as a "cool to have" thing, in a techy way, but I don't really need it so once I saw that it wasn't going to be easy to solve I didn't look any further. |
Describe the bug
The webui assumes "localhost" for the gateway, even though it was accessed on a non-localhost system.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
webui gateway host should default to the same host that the webui is accessed via.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: