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

Application thinks quarkus.http.host is set to 0.0.0.0 in dev mode but it's set to localhost #40463

Closed
tamaro-skaljic opened this issue May 5, 2024 · 2 comments · Fixed by #40467
Labels
area/devmode kind/bug Something isn't working
Milestone

Comments

@tamaro-skaljic
Copy link
Contributor

Describe the bug

The documentation states that the default of quarkus.http.host is 'localhost' in dev/test mode and 0.0.0.0 in prod mode.
image

However the dev ui configuration form editor states it's set to 0.0.0.0 (and has no default value)
image

Therefore the application start up message includes a url to 0.0.0.0.
image

Interestingly, the application itself is made available via http://localhost:8080/ as written in the documentation, but the start up message and the Dev UI say something else. (When I click on the URL, there is of course an ERR_ADDRESS_INVALID error)

Expected behavior

The Dev UI Configuration Form Editor and the start up message should display the right host (localhost in dev/test mode).

Actual behavior

The Dev UI Configuration Form Editor and the start up message display '0.0.0.0' as quarkus.http.host but the application is available at host 'localhost'.

How to Reproduce?

https://code.quarkus.io/d?e=rest&cn=code.quarkus.io
./mvnw clean compile quarkus:dev

Output of uname -a or ver

Linux DESKTOP-CUA0DQ3 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9) OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)

Quarkus version or git rev

3.10.0

Build tool (ie. output of mvnw --version or gradlew --version)

apache-maven-3.9.5

Additional information

No response

@tamaro-skaljic tamaro-skaljic added the kind/bug Something isn't working label May 5, 2024
@Eng-Fouad
Copy link
Contributor

Quarkus uses 0.0.0.0 for WSL in dev/test mode, as per #22956

Maybe the Javadoc of HttpConfiguration.host needs to be updated. @geoand WDYT?

/**
* The HTTP host
* <p>
* In dev/test mode this defaults to localhost, in prod mode this defaults to 0.0.0.0
* <p>
* Defaulting to 0.0.0.0 makes it easier to deploy Quarkus to container, however it
* is not suitable for dev/test mode as other people on the network can connect to your
* development machine.
*/
@ConfigItem
public String host;

@geoand
Copy link
Contributor

geoand commented May 6, 2024

Makes sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants