-
Notifications
You must be signed in to change notification settings - Fork 6
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
Lowkey Vault Docker does not support dynamic host ports #1319
Comments
Hi @Xor-el , The very hacky workaround which exists is to find a free port and configure Lowkey Vault to use that port. I will take a look during the weekend and see how I can make this work in a convenient way with the random port assigned by Testcontainers. Thank you again! |
@nagyesta Thanks for looking into this. very much appreciated. |
- Adds new configuration option to allow relaxed matching of vault URI ports - Updates tests - Deprecates Testcontainers method setting a fixed host port - Enhances Testcontainers module to always use the relaxed matching feature - Adds more verification steps to Testcontainers tests - Updates documentation Updates #1319 Signed-off-by: Esta Nagy <nagyesta@gmail.com>
- Adds new configuration option to allow relaxed matching of vault URI ports - Updates tests - Deprecates Testcontainers method setting a fixed host port - Enhances Testcontainers module to always use the relaxed matching feature - Adds more verification steps to Testcontainers tests - Updates documentation Updates #1319 {minor} Signed-off-by: Esta Nagy <nagyesta@gmail.com>
- Adds new configuration option to allow relaxed matching of vault URI ports - Updates tests - Deprecates Testcontainers method setting a fixed host port - Enhances Testcontainers module to always use the relaxed matching feature - Adds more verification steps to Testcontainers tests - Updates documentation Updates #1319 {minor} Signed-off-by: Esta Nagy <nagyesta@gmail.com>
Hi @Xor-el , Please feel free to reach out on this ticket in case it is still not working! |
Hello @nagyesta , thanks for the fix. |
so this seems to have broken vault aliases. |
Thanks @Xor-el! Sure, I will, just waiting for Renovate to raise the PR when the artifact becomes usable. |
so here is how to reproduce this set any of the below as the env
or
then run
Lowkey Vault then crashes with an exception. |
Thanks @Xor-el ! I am sorry to hear this! I will take a look tonight and see what is causing this. |
This is complete in the meantime. |
@nagyesta here is a screenshot of the exception |
- Adds better URI validation to filter out invalid host names - Updates tests - Updates documentation Updates #1319 {patch} Signed-off-by: Esta Nagy <nagyesta@gmail.com>
- Adds better URI validation to filter out invalid host names - Updates tests - Updates documentation Updates #1319 {patch} Signed-off-by: Esta Nagy <nagyesta@gmail.com>
I have found the root cause @Xor-el ! The Java URI parser implementation, which is required for the dynamic ports to work, is not able to find the "host" part of the Based on this, I have only made it slightly nicer to produce a more informative log. Hopefully this will help the users find the issues in the input parameters:
This small fix will be available in |
Hello @nagyesta thanks for the explanation, well understood. |
Okay, thank you for your understanding! |
Describe the bug
I encountered a blocker while working on this issue. According to the .NET TestContainers best practices, it is recommended to avoid static host port bindings for containers. Instead, the guidelines suggest using randomly assigned host ports via
_builder.WithPortBinding(ushort, true)
and retrieving the mapped port using_container.GetMappedPublicPort(ushort)
.However, it seems that Lowkey Vault Docker does not support the use of random host ports. Instead, it requires the host, container, and server ports to match, which conflicts with the best practices outlined by .NET TestContainers.
To reproduce
Steps to reproduce the behavior:
Clone this repo and build
run this docker command, note that the host port is different from the container port.
docker run --rm --name lowkey -d -p 8550:8443 nagyesta/lowkey-vault:2.6.15
run the demo built in Step 1
Expected behavior
Dynamic host ports should be supported as it is not guaranteed that a port would always be available on the host.
Actual behavior
When I run the demo
A minimal project that can be used to reproduce the issue
LowKeyVaultDockerDemo
Environment
Additional context
Using a static port for the host might not always be possible as that port might be unavailable on the host.
The text was updated successfully, but these errors were encountered: