Skip to content

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

Description

@softwareplumber

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upeffort/hoursEstimated to take one or several hourshelp wantedSeeking public contribution on this issuekind/enhancementA net-new feature or improvement to an existing featuretopic/rpc-apiIssues related to Kubo RPC API at /api/v0

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions