From f06d76a5aa3d7e00ef4616e020c63bd728d1cad4 Mon Sep 17 00:00:00 2001 From: Steven Hawkins Date: Wed, 23 Oct 2024 11:34:34 -0400 Subject: [PATCH] fix: adding more information about http-enabled (#33795) closes: #33605 Signed-off-by: Steve Hawkins --- .../src/main/java/org/keycloak/config/HttpOptions.java | 4 ++-- .../main/java/org/keycloak/quarkus/runtime/Messages.java | 5 ++--- .../java/org/keycloak/it/cli/dist/ManagementDistTest.java | 2 +- .../help/HelpCommandDistTest.testStartDevHelp.approved.txt | 6 ++++-- .../HelpCommandDistTest.testStartDevHelpAll.approved.txt | 6 ++++-- .../cli/help/HelpCommandDistTest.testStartHelp.approved.txt | 6 ++++-- .../help/HelpCommandDistTest.testStartHelpAll.approved.txt | 6 ++++-- .../HelpCommandDistTest.testStartOptimizedHelp.approved.txt | 6 ++++-- ...lpCommandDistTest.testStartOptimizedHelpAll.approved.txt | 6 ++++-- 9 files changed, 29 insertions(+), 18 deletions(-) diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java index ebc9989191..1d8c564606 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java @@ -10,13 +10,13 @@ public class HttpOptions { public static final Option HTTP_ENABLED = new OptionBuilder<>("http-enabled", Boolean.class) .category(OptionCategory.HTTP) - .description("Enables the HTTP listener.") + .description("Enables the HTTP listener. Enabled by default in development mode. Typically not enabled in production unless the server is fronted by a TLS termination proxy.") .defaultValue(Boolean.FALSE) .build(); public static final Option HTTP_HOST = new OptionBuilder<>("http-host", String.class) .category(OptionCategory.HTTP) - .description("The used HTTP Host.") + .description("The HTTP Host.") .defaultValue("0.0.0.0") .build(); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Messages.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Messages.java index 4fab40d036..e118aa08ff 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Messages.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Messages.java @@ -33,11 +33,10 @@ public final class Messages { } public static String httpsConfigurationNotSet() { - StringBuilder builder = new StringBuilder("Key material not provided to setup HTTPS. Please configure your keys/certificates"); + StringBuilder builder = new StringBuilder("Key material not provided to setup HTTPS. Please configure your keys/certificates, or if HTTPS access is not needed see the `http-enabled` option."); if (!org.keycloak.common.util.Environment.DEV_PROFILE_VALUE.equals(org.keycloak.common.util.Environment.getProfile())) { - builder.append(" or start the server in development mode"); + builder.append(" If you meant to start the server in development mode, see the `start-dev` command."); } - builder.append("."); return builder.toString(); } diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/ManagementDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/ManagementDistTest.java index d34e55e654..f8ec428506 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/ManagementDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/ManagementDistTest.java @@ -48,7 +48,7 @@ public class ManagementDistTest { void testManagementNoHttps(LaunchResult result) { CLIResult cliResult = (CLIResult) result; cliResult.assertNoMessage("Management interface listening on"); - cliResult.assertError("Key material not provided to setup HTTPS. Please configure your keys/certificates or start the server in development mode."); + cliResult.assertError("Key material not provided to setup HTTPS."); } @Test diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt index e8cfac27bf..6637885be5 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt @@ -159,8 +159,10 @@ Hostname v2: HTTP(S): --http-enabled - Enables the HTTP listener. Default: false. ---http-host The used HTTP Host. Default: 0.0.0.0. + Enables the HTTP listener. Enabled by default in development mode. Typically + not enabled in production unless the server is fronted by a TLS termination + proxy. Default: false. +--http-host The HTTP Host. Default: 0.0.0.0. --http-max-queued-requests Maximum number of queued HTTP requests. Use this to shed load in an overload situation. Excess requests will return a "503 Server not Available" response. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt index 0a3b45389e..8236288fec 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.approved.txt @@ -185,8 +185,10 @@ Hostname v2: HTTP(S): --http-enabled - Enables the HTTP listener. Default: false. ---http-host The used HTTP Host. Default: 0.0.0.0. + Enables the HTTP listener. Enabled by default in development mode. Typically + not enabled in production unless the server is fronted by a TLS termination + proxy. Default: false. +--http-host The HTTP Host. Default: 0.0.0.0. --http-max-queued-requests Maximum number of queued HTTP requests. Use this to shed load in an overload situation. Excess requests will return a "503 Server not Available" response. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt index 205446df9e..2113a6d1c2 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.approved.txt @@ -160,8 +160,10 @@ Hostname v2: HTTP(S): --http-enabled - Enables the HTTP listener. Default: false. ---http-host The used HTTP Host. Default: 0.0.0.0. + Enables the HTTP listener. Enabled by default in development mode. Typically + not enabled in production unless the server is fronted by a TLS termination + proxy. Default: false. +--http-host The HTTP Host. Default: 0.0.0.0. --http-max-queued-requests Maximum number of queued HTTP requests. Use this to shed load in an overload situation. Excess requests will return a "503 Server not Available" response. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt index e7fc914f06..97780a0092 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.approved.txt @@ -186,8 +186,10 @@ Hostname v2: HTTP(S): --http-enabled - Enables the HTTP listener. Default: false. ---http-host The used HTTP Host. Default: 0.0.0.0. + Enables the HTTP listener. Enabled by default in development mode. Typically + not enabled in production unless the server is fronted by a TLS termination + proxy. Default: false. +--http-host The HTTP Host. Default: 0.0.0.0. --http-max-queued-requests Maximum number of queued HTTP requests. Use this to shed load in an overload situation. Excess requests will return a "503 Server not Available" response. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt index e8e710d035..1e816d70dc 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelp.approved.txt @@ -145,8 +145,10 @@ Hostname v2: HTTP(S): --http-enabled - Enables the HTTP listener. Default: false. ---http-host The used HTTP Host. Default: 0.0.0.0. + Enables the HTTP listener. Enabled by default in development mode. Typically + not enabled in production unless the server is fronted by a TLS termination + proxy. Default: false. +--http-host The HTTP Host. Default: 0.0.0.0. --http-max-queued-requests Maximum number of queued HTTP requests. Use this to shed load in an overload situation. Excess requests will return a "503 Server not Available" response. diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt index 3032205680..71725da9e7 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartOptimizedHelpAll.approved.txt @@ -171,8 +171,10 @@ Hostname v2: HTTP(S): --http-enabled - Enables the HTTP listener. Default: false. ---http-host The used HTTP Host. Default: 0.0.0.0. + Enables the HTTP listener. Enabled by default in development mode. Typically + not enabled in production unless the server is fronted by a TLS termination + proxy. Default: false. +--http-host The HTTP Host. Default: 0.0.0.0. --http-max-queued-requests Maximum number of queued HTTP requests. Use this to shed load in an overload situation. Excess requests will return a "503 Server not Available" response.