Skip to content
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

Don't convert the host name specified with --api=/dns4/<domain>/ into an IP address (thus making life easy for reverse proxy) #10232

Open
3 tasks done
softwareplumber opened this issue Nov 25, 2023 · 1 comment · May be fixed by #10233
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

Comments

@softwareplumber
Copy link

softwareplumber commented Nov 25, 2023

Checklist

  • My issue is specific & actionable.
  • I am not suggesting a protocol enhancement.
  • I have searched on the issue tracker for my issue.

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)

@softwareplumber softwareplumber added the kind/enhancement A net-new feature or improvement to an existing feature label Nov 25, 2023
@lidel lidel added help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up topic/rpc-api Issues related to Kubo RPC API at /api/v0 effort/hours Estimated to take one or several hours labels Nov 27, 2023
@softwareplumber
Copy link
Author

softwareplumber commented Nov 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants