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

CodeLens URL does not respect quarkus.http.root-path property #368

Closed
kaganem opened this issue Oct 28, 2020 · 4 comments · Fixed by eclipse/lsp4mp#174
Closed

CodeLens URL does not respect quarkus.http.root-path property #368

kaganem opened this issue Oct 28, 2020 · 4 comments · Fixed by eclipse/lsp4mp#174
Assignees
Milestone

Comments

@kaganem
Copy link

kaganem commented Oct 28, 2020

If we set quarkus.http.root-path to point at /some/special/place/in/your/heart, and try to fire up VS Code, lens will be generated with default host http://localhost:8080/{some-place-specified-with-@Path-annotaion}.

There was a pull request by @angelozerr which added support for port change - thanks, mate. @fbricon merged it on 27th of January. But... we have two more problems:

  • there is no option to work with host differing from localhost. That's a problem.
  • there is no option to work with https:// at all. Bad, but can be fixed via SSL termination or/and proxy.
@kaganem
Copy link
Author

kaganem commented Oct 28, 2020

As an alternative to properties support extension, it is also possible to add support for @ApplicationPath annotation (it is a part for MicroProfile anyway). Maybe it is a better idea.

@angelozerr
Copy link
Contributor

Sorry @clochardpagan I see your issue now.

I didn't know this property uarkus.http.root-path, we should indeed manage this case.

there is no option to work with host differing from localhost. That's a problem.

Indeed the check which is done to show/hide CodeLens is done here https://github.com/eclipse/lsp4mp/blob/ab86a54e2be98c20ada1664ce910a015779c6b4d/microprofile.jdt/org.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java#L99

It's very basic: check if we can connect a Socket to the localhost on a given port. The question is how to know the host (which config can we use)?

there is no option to work with https:// at all. Bad, but can be fixed via SSL termination or/and proxy.

Same question, how to generate URL with https (which config can we use?)

As an alternative to properties support extension, it is also possible to add support for @ApplicationPath annotation (it is a part for MicroProfile anyway). Maybe it is a better idea.

Indeed we should manage this annotation too.

@rgrunber rgrunber self-assigned this Nov 19, 2020
@angelozerr angelozerr added this to the v0.0.9 milestone Nov 20, 2020
@angelozerr angelozerr modified the milestones: v0.0.9, v0.10.0 Mar 15, 2021
@angelozerr angelozerr modified the milestones: v0.10.0, v0.11.0 Mar 31, 2021
@datho7561 datho7561 modified the milestones: v0.10.1, v0.11.0 Jul 14, 2021
@rgrunber rgrunber assigned AlexXuChen and unassigned rgrunber Aug 31, 2021
@rgrunber
Copy link
Member

As a minor quibble, if you auto-complete the quarkus.http.root-path, it auto-inserts the default value, /. However, if you specify some value that doesn't start with /, you'll get the following error at runtime :

[error]: Build step io.quarkus.vertx.http.deployment.devmode.console.DevConsoleProcessor#setupDeploymentSideHandling threw an exception: java.lang.IllegalArgumentException: Path must start with /

Might be nice to add an easy validation if it isn't too much effort, as the error stacktrace can make it difficult to get to the exact root cause.

@angelozerr
Copy link
Contributor

  • there is no option to work with host differing from localhost. That's a problem.

@clochardpagan could you give us how to you can configure the host in quarkus application please?

  • there is no option to work with https:// at all. Bad, but can be fixed via SSL termination or/and proxy.

@clochardpagan how do you enable SSL? Do you use quarkus ssl property https://quarkus.io/guides/http-reference#providing-a-certificate-and-key-file ? If it that it means that we could generate https when we find in the application.properties a quarkus ssl property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants