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

API.Address config value should be able to handle hostnames #2300

Closed
jsimnz opened this issue Feb 10, 2024 · 1 comment
Closed

API.Address config value should be able to handle hostnames #2300

jsimnz opened this issue Feb 10, 2024 · 1 comment
Labels
area/cli Related to the CLI binary bug Something isn't working priority/high

Comments

@jsimnz
Copy link
Member

jsimnz commented Feb 10, 2024

Describe the problem
API Address only accepts either localhost or an IP address, which makes sense when we use this address to bind to when running the HTTP server. However, we use the same config value for HTTP clients (ie: defradb client .... command) meaning when clients can only access defra nodes by IPs and not by hostnames.

This is problematic for a number of reasons, but most notably so when trying to communicate between docker containers (one running the HTTP server, and the other running a client command), since docker sets up inter container networking via hostnames.

So trying to run docker run -v $PWD:/etc/defradb ghcr.io/sourcenetwork/defradb:0.9.0 client p2p info --url host.docker.internal:9181 it fails with Error: failed to validate config: cannot provide port with domain name.

To Reproduce
client schema p2p info --url <hostname>:<port> where hostname isn't localhost or an IP Address

We either need to drop the URL validation for IP addresses, and just let the server error propagate when trying to "run" the server (which will fail if you cant bind to the specific hostname), or need to split client/server Address config value into two separate entries.

@jsimnz jsimnz added bug Something isn't working area/cli Related to the CLI binary priority/high labels Feb 10, 2024
@nasdf
Copy link
Member

nasdf commented Mar 6, 2024

Closed by #2310

@nasdf nasdf closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to the CLI binary bug Something isn't working priority/high
Projects
None yet
Development

No branches or pull requests

2 participants