From 8d0aa1a3a6a8024235e976fd674c9e679662189e Mon Sep 17 00:00:00 2001 From: "petteri.kivimaki" Date: Tue, 9 Jul 2024 09:59:45 +0300 Subject: [PATCH 1/2] Remove old signer port 5558 Refs: XRDDEV-2665 --- .../main/java/ee/ria/xroad/common/PortNumbers.java | 3 --- .../java/ee/ria/xroad/common/SystemProperties.java | 11 ----------- .../test/signer/container/BaseTestSignerSetup.java | 2 +- .../main/resources/signer-container-files/Dockerfile | 2 +- .../src/xroad/default-configuration/signer.ini | 3 --- .../java/ee/ria/xroad/signer/console/SignerCLI.java | 2 +- .../src/main/java/ee/ria/xroad/signer/SignerMain.java | 4 ++-- 7 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/common/common-core/src/main/java/ee/ria/xroad/common/PortNumbers.java b/src/common/common-core/src/main/java/ee/ria/xroad/common/PortNumbers.java index b8271e2d21..8fa9639815 100644 --- a/src/common/common-core/src/main/java/ee/ria/xroad/common/PortNumbers.java +++ b/src/common/common-core/src/main/java/ee/ria/xroad/common/PortNumbers.java @@ -49,9 +49,6 @@ public final class PortNumbers { /** Admin port for proxy. */ public static final int ADMIN_PORT = 5566; - /** Signer listens for HTTP queries. */ - public static final int SIGNER_PORT = 5558; - /** Signer Admin port. */ public static final int SIGNER_ADMIN_PORT = 5559; diff --git a/src/common/common-core/src/main/java/ee/ria/xroad/common/SystemProperties.java b/src/common/common-core/src/main/java/ee/ria/xroad/common/SystemProperties.java index f97a01a1bd..aa4a96d970 100644 --- a/src/common/common-core/src/main/java/ee/ria/xroad/common/SystemProperties.java +++ b/src/common/common-core/src/main/java/ee/ria/xroad/common/SystemProperties.java @@ -395,10 +395,6 @@ private SystemProperties() { public static final String DEVICE_CONFIGURATION_FILE = PREFIX + "signer.device-configuration-file"; - /** Property name of the Signer's port number. */ - public static final String SIGNER_PORT = - PREFIX + "signer.port"; - /** Property name of the Signer's admin port number. */ public static final String SIGNER_ADMIN_PORT = PREFIX + "signer.admin-port"; @@ -983,13 +979,6 @@ public static String getServerProxyListenAddress() { return System.getProperty(PROXY_SERVER_LISTEN_ADDRESS, DEFAULT_CONNECTOR_HOST); } - /** - * @return the HTTP port on which the signer listens for signing requests, '5558' by default. - */ - public static int getSignerPort() { - return Integer.parseInt(System.getProperty(SIGNER_PORT, Integer.toString(PortNumbers.SIGNER_PORT))); - } - /** * @return the port on which the signer admin listens for requests */ diff --git a/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java b/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java index f8ca0a09d5..4ce8b155f6 100644 --- a/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java +++ b/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java @@ -80,7 +80,7 @@ public Map environmentalVariables() { @NotNull @Override public List exposedPorts() { - return List.of(5558, 5560); + return List.of(5559, 5560); } }; } diff --git a/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile b/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile index 9a69b647f0..35df4026aa 100644 --- a/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile +++ b/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile @@ -26,4 +26,4 @@ COPY --chown=root:root files/hwtoken.jar /root/lib/hwtoken.jar COPY --chown=root:root etc /etc COPY --chown=root:root var /var -EXPOSE 5558 5559 5560 +EXPOSE 5559 5560 diff --git a/src/packages/src/xroad/default-configuration/signer.ini b/src/packages/src/xroad/default-configuration/signer.ini index 5e48422929..e0700419c7 100644 --- a/src/packages/src/xroad/default-configuration/signer.ini +++ b/src/packages/src/xroad/default-configuration/signer.ini @@ -11,9 +11,6 @@ key-configuration-file=/etc/xroad/signer/keyconf.xml ; Timeout in milliseconds of the signer client client-timeout=50000 -; Port number of Signer -port=5558 - ; Full class name of module instance provider ;module-instance-provider=com.foo.barImpl diff --git a/src/signer-console/src/main/java/ee/ria/xroad/signer/console/SignerCLI.java b/src/signer-console/src/main/java/ee/ria/xroad/signer/console/SignerCLI.java index e608f7b7c3..d9627f25fb 100644 --- a/src/signer-console/src/main/java/ee/ria/xroad/signer/console/SignerCLI.java +++ b/src/signer-console/src/main/java/ee/ria/xroad/signer/console/SignerCLI.java @@ -814,7 +814,7 @@ public static void main(String[] args) throws Exception { } private static void startCommandLoop() throws IOException { - String prompt = "signer@" + SystemProperties.getSignerPort(); + String prompt = "signer@" + SystemProperties.getGrpcSignerPort(); String description = "Enter '?list' to get list of available commands\n" + "Enter '?help ' to get command description\n" diff --git a/src/signer/src/main/java/ee/ria/xroad/signer/SignerMain.java b/src/signer/src/main/java/ee/ria/xroad/signer/SignerMain.java index a1abdcf0e4..a83581e557 100644 --- a/src/signer/src/main/java/ee/ria/xroad/signer/SignerMain.java +++ b/src/signer/src/main/java/ee/ria/xroad/signer/SignerMain.java @@ -78,8 +78,8 @@ public static void main(String[] args) { private static void startup() { long start = System.currentTimeMillis(); Version.outputVersionInfo(APP_NAME); - int signerPort = SystemProperties.getSignerPort(); - log.info("Starting Signer on port {}...", signerPort); + int grpcSignerPort = SystemProperties.getGrpcSignerPort(); + log.info("Starting Signer on port {}...", grpcSignerPort); springCtx = new AnnotationConfigApplicationContext(SignerConfig.class); springCtx.registerShutdownHook(); From 01ab5ca55dbe317b7090bd5fae93ad687007d773 Mon Sep 17 00:00:00 2001 From: "petteri.kivimaki" Date: Tue, 9 Jul 2024 10:53:35 +0300 Subject: [PATCH 2/2] fix: Revert port changes to signer integration test Refs: XRDDEV-2665 --- .../xroad/common/test/signer/container/BaseTestSignerSetup.java | 2 +- .../src/main/resources/signer-container-files/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java b/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java index 4ce8b155f6..f8ca0a09d5 100644 --- a/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java +++ b/src/common/common-int-test/src/main/java/org/niis/xroad/common/test/signer/container/BaseTestSignerSetup.java @@ -80,7 +80,7 @@ public Map environmentalVariables() { @NotNull @Override public List exposedPorts() { - return List.of(5559, 5560); + return List.of(5558, 5560); } }; } diff --git a/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile b/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile index 35df4026aa..9a69b647f0 100644 --- a/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile +++ b/src/common/common-int-test/src/main/resources/signer-container-files/Dockerfile @@ -26,4 +26,4 @@ COPY --chown=root:root files/hwtoken.jar /root/lib/hwtoken.jar COPY --chown=root:root etc /etc COPY --chown=root:root var /var -EXPOSE 5559 5560 +EXPOSE 5558 5559 5560