Go-ipfs on Kubernetes/Docker: Unable to download files via web UI

Hello everyone!

I have been using IPFS for a few weeks now and have become quite enthusiastic about it, becoming a bit of an advocate among my friends. I run IPFS Desktop as the node on my personal machines, as well as a constantly on node on my home Kubernetes cluster. It has become my preferred way to share content with others, from streaming videos to sharing pictures in discussion groups via link. I’ve become a very firm believer in the decentralized web.

I’ve generally been creating and solving my own problems, doing a lot of reading up on documentation. However, some aren’t terribly “google friendly”, which brings me here.

I have had an issue with using the download option in the files section of the web UI on any sort of containerized installation. IPFS Desktop works fine, but any node sitting on Kubernetes or Docker simply sits there when I tell it to download something. Bringing up the browser console gave me a useful lead. In IPFS Desktop, clicking on the download button makes a POST request to /ip4/127.0.0.1/tcp/5001 in order to request the download. This makes sense and the download works. In a containerized node, that same request goes to /ip4/0.0.0.0/tcp/5001, which of course fails.

I can only assume that the web ui is picking up the /ip4/0.0.0.0/tcp/5001 multiaddr from the node’s config, as that’s the only place I can find it mentioned. Other API calls seem to be going through just fine, going to the correct address.

I naively thought that I could just change the multiaddr in Addresses.API to the external address, but that failed because it couldn’t bind to that address. Makes sense of course. The problem is that the address it can bind to has no relevance to the network outside the container. For swarm, it has the Addresses.Announce section that can list externally available endpoints, but there doesn’t seem to be an equivalent for API.

It’s a bit strange that the download option uses the wrong multiaddr for the API, but the rest of them are fine. I may be missing something somewhere, like an option in the config or some rule about not allowing downloads over plain HTTP, but it’s proven to be very difficult to search. Trying to find something relevant using keywords like “IPFS”, “download” and “webui” tend to just give me a lot of links about how to get IPFS in the first place. It seems like this would be a common problem, but searching for “download” in the issues on the ipfs-webui github also didn’t produce anything relevant. Rather than posting a bug report there about something that may turn out to be trivial, I decided to start here in the hopes that someone may be able to point out something I missed.

Thanks in advance