Every IPFS Node provides :5001/webui endpoint on the API port. It redirects to the latest 'blessed' CID that can be loaded from :5001/ipfs/{cid}. For security reasons only hardcoded CIDs can be loaded from API port.
Right now IPFS Companion ships with hardcoded version of Web UI, and that version can be bigger than the one at :5001/webui.
Companion can't load it from API port as it is not on the whitelist, so it loads it from the Gateway instead. That comes at a price of having two separate Origins and falling under CORS limitations. We don't want people to add CORS headers, as it would allow allow any website loaded from Gateway port to execute arbitrary requests on API port. Instead, we remove CORS check on webui path by supressing Origin header in requests made from :8080/ipfs/{blessed_webui_cid} (Gateway) to :5001 (API).
That way we keep CORS check from anything else on Gateway port.
Why we did this? It made it possible for us to iterate and ship new Web UI without waiting for new go-ipfs release (which took multiple months at the time).
We are now in maintenance mode where regular go-ipfs releases are expected and webui itself is much more stable now.
It is time to:
/webui provided by go-ipfs (or js-ipfs) as the new default in Companion:5001/ipns/webui.ipfs.io (requires ipns path to be added to API port whitelist in GO and JS)cc @olizilla (https://github.com/ipfs-shipyard/ipfs-webui/issues/1038#issuecomment-494000620)
PR to go-ipfs to allow /ipns/webui.ipfs.io is go! https://github.com/ipfs/go-ipfs/pull/6530
/webui: https://github.com/ipfs-shipyard/ipfs-companion/pull/737:5001/ipns/webui.ipfs.io: https://github.com/ipfs-shipyard/ipfs-companion/pull/738Should IPFS Desktop do the same too?
Actually we can't. Many IPFS Desktop settings depend on the Web UI settings page. So, if the Web UI is only available when the daemon is on, then we can't access the settings. Unless we move Desktop specific options to the menubar itself as we're planning initially. It's basically a bunch of checkboxes.
Update:
http://127.0.0.:5001/webui/ (API port) when #853 ships, all hacks related to "blessing" webui on gateway port will be removedwebui.ipfs.io.ipns.localhost:8080 is tracked in https://github.com/ipfs-shipyard/ipfs-companion/issues/860
Most helpful comment
PR to go-ipfs to allow /ipns/webui.ipfs.io is go! https://github.com/ipfs/go-ipfs/pull/6530