Don't convert the host name specified with --api=/dns4/<domain>/ into an IP address (thus making life easy for reverse proxy) #10232
Labels
effort/hours
Estimated to take one or several hours
help wanted
Seeking public contribution on this issue
kind/enhancement
A net-new feature or improvement to an existing feature
P2
Medium: Good to have, but can wait until someone steps up
topic/rpc-api
Issues related to Kubo RPC API at /api/v0
Checklist
Description
In kubo/cmd/ipfs/main.go, the multiaddr specified using the --api is resolved:
apiAddr, err = resolveAddr(req.Context, apiAddr)
Unfortunately this erases information about the host name. Almost anyone trying to run kubo behind a reverse proxy will hate this, since it means the HTTP requests go out with the IP address rather than the host name in the header, thus breaking any hostname based rules in the reverse proxy. This caused a couple of days of head-scratching on my part, since API calls handcrafted via CURL worked just fine for me, but I couldn't persuade the kubo cli to work.
Removing this line fixed that problem for me (OK, there are other problems related to https support, but at least the CLI works over http).
Is there any reason we actually need resolve the hostname here rather than letting the executor do it? Or is it just a check? (in which case simply ignoring the address returned by resolve would be perfect)
The text was updated successfully, but these errors were encountered: