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

XRDDEV-2798 SS addons refactoring and deb packaging #2496

Open
wants to merge 19 commits into
base: edc-poc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import ee.ria.xroad.common.cert.CertChainFactory;
import ee.ria.xroad.common.conf.globalconf.GlobalConfProvider;
import ee.ria.xroad.common.conf.serverconf.ServerConfProvider;
import ee.ria.xroad.common.messagelog.MessageLogDbContextHolder;
import ee.ria.xroad.common.db.DatabaseCtxV2;
import ee.ria.xroad.common.opmonitoring.OpMonitoringData;
import ee.ria.xroad.common.util.RequestWrapper;
import ee.ria.xroad.common.util.ResponseWrapper;
Expand All @@ -56,9 +56,10 @@ public class AsicContainerHandler extends AbstractClientProxyHandler {
* Constructor
*/
public AsicContainerHandler(GlobalConfProvider globalConfProvider, KeyConfProvider keyConfProvider,
ServerConfProvider serverConfProvider, CertChainFactory certChainFactory, HttpClient client) {
ServerConfProvider serverConfProvider, CertChainFactory certChainFactory, HttpClient client,
DatabaseCtxV2 messagelogDatabaseCtx) {
super(globalConfProvider, keyConfProvider, serverConfProvider, certChainFactory, client, false);
this.logRecordManager = new LogRecordManager(MessageLogDbContextHolder.instance());
this.logRecordManager = new LogRecordManager(messagelogDatabaseCtx);
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/addons/metaservice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ tasks.register('runMetaserviceTest', JavaExec) {
'-Dxroad.proxy.client-connector-so-linger=-1',
'-Dxroad.proxy.client-httpclient-so-linger=-1',
'-Dxroad.proxy.server-connector-so-linger=-1',
'-Dxroad.proxy.serverServiceHandlers=ee.ria.xroad.proxy.serverproxy.MetadataServiceHandlerImpl',
'-Dxroad.proxy.clientHandlers=ee.ria.xroad.proxy.clientproxy.MetadataHandler',
'-Dxroad.proxy.addon.metaservices.enabled=true',
'-Dxroad.proxy.grpc-tls-enabled=false',
'-Dtest.queries.dir=src/test/queries'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
import static ee.ria.xroad.proxy.util.MetadataRequests.LIST_METHODS;

@Slf4j
class MetadataServiceHandlerImpl extends AbstractServiceHandler {
public class MetadataServiceHandlerImpl extends AbstractServiceHandler {

static final JAXBContext JAXB_CTX = initJaxbCtx();
static final ObjectFactory OBJECT_FACTORY = new ObjectFactory();
Expand All @@ -115,7 +115,7 @@ class MetadataServiceHandlerImpl extends AbstractServiceHandler {

private static final SAXTransformerFactory TRANSFORMER_FACTORY = createSaxTransformerFactory();

protected MetadataServiceHandlerImpl(ServerConfProvider serverConfProvider, GlobalConfProvider globalConfProvider) {
public MetadataServiceHandlerImpl(ServerConfProvider serverConfProvider, GlobalConfProvider globalConfProvider) {
super(serverConfProvider, globalConfProvider);
wsdlHttpClientCreator = new HttpClientCreator(serverConfProvider);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class OpMonitoringServiceHandlerImpl extends AbstractServiceHandler {

private HttpSender sender;

protected OpMonitoringServiceHandlerImpl(ServerConfProvider serverConfProvider, GlobalConfProvider globalConfProvider) {
public OpMonitoringServiceHandlerImpl(ServerConfProvider serverConfProvider, GlobalConfProvider globalConfProvider) {
super(serverConfProvider, globalConfProvider);
}

Expand Down
30 changes: 15 additions & 15 deletions src/addons/proxymonitor/metaservice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java'
alias(libs.plugins.shadow)
// alias(libs.plugins.shadow)
}

project.ext.schemaTargetDir = layout.buildDirectory.dir("generated-sources").get().asFile
Expand Down Expand Up @@ -39,21 +39,21 @@ tasks.register('createDirs') {
}
}

jar {
enabled = false
}
//jar {
// enabled = true
//}

shadowJar {
archiveClassifier = ''
exclude('**/module-info.class')
dependencies {
include(project(':addons:proxymonitor-common'))
include(project(':monitor-common'))
}
mergeServiceFiles()
}
//shadowJar {
// archiveClassifier = ''
// exclude('**/module-info.class')
// dependencies {
// include(project(':addons:proxymonitor-common'))
// include(project(':monitor-common'))
// }
// mergeServiceFiles()
//}

build.dependsOn shadowJar
//build.dependsOn shadowJar

compileJava.dependsOn processResources

Expand All @@ -74,7 +74,7 @@ tasks.register('runProxymonitorMetaserviceTest', JavaExec) {
'-Dxroad.proxy.client-connector-so-linger=-1',
'-Dxroad.proxy.client-httpclient-so-linger=-1',
'-Dxroad.proxy.server-connector-so-linger=-1',
'-Dxroad.proxy.serverServiceHandlers=ee.ria.xroad.proxy.serverproxy.ProxyMonitorServiceHandlerImpl',
'-Dxroad.proxy.addon.proxymonitor.enabled=true',
'-Dxroad.proxy.grpc-tls-enabled=false',
'-Dtest.queries.dir=src/test/queries'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class ProxyMonitorServiceHandlerImpl extends AbstractServiceHandler {

private SoapMessageEncoder responseEncoder;

protected ProxyMonitorServiceHandlerImpl(ServerConfProvider serverConfProvider, GlobalConfProvider globalConfProvider) {
public ProxyMonitorServiceHandlerImpl(ServerConfProvider serverConfProvider, GlobalConfProvider globalConfProvider) {
super(serverConfProvider, globalConfProvider);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,6 @@ public enum AllowedFederationMode {

// Proxy UI ---------------------------------------------------------------

/**
* Property name of the WSDL validator command.
*/
public static final String WSDL_VALIDATOR_COMMAND =
PREFIX + "proxy-ui-api.wsdl-validator-command";

/**
* Property name of the signature digest algorithm ID used for generating authentication certificate
* registration request.
Expand Down Expand Up @@ -795,13 +789,6 @@ public static String getDeviceConfFile() {
getConfPath() + DefaultFilepaths.DEVICE_CONFIGURATION_FILE);
}

/**
* @return WSDL validator command string. Defaults to null.
*/
public static String getWsdlValidatorCommand() {
return SystemPropertySource.getPropertyResolver().getProperty(WSDL_VALIDATOR_COMMAND);
}

/**
* @return signature digest algorithm ID used for generating authentication certificate registration request,
* SHA-512 by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@Slf4j
@SuppressWarnings("checkstyle:MagicNumber")
public abstract class BaseTestSignerSetup {
private static final String PKCS11_WRAPPER_FILENAME = "libpkcs11wrapper.so";
private static final String PKCS11_WRAPPER_FILENAME = "libpkcs11-wrapper.so";

static {
//This is to set docker api version in testcontainers. By default it uses 1.32, which does not support platform setting.
Expand All @@ -56,13 +56,12 @@ public abstract class BaseTestSignerSetup {

public TestContainerConfigurator testContainerConfigurator(
TestableContainerProperties testableContainerProperties,
String signerPath, String hwTokenPath) {
String signerPath) {
return new TestContainerConfigurator() {
@NotNull
@Override
public ImageFromDockerfile imageDefinition() {
var appJarPath = Paths.get(signerPath);
var hwTokenJarPath = Paths.get(hwTokenPath);

log.info("Will use {} jar for container creation", appJarPath);

Expand All @@ -73,7 +72,6 @@ public ImageFromDockerfile imageDefinition() {
testableContainerProperties.getReuseBetweenRuns())
.withFileFromFile(".", filesToAdd)
.withFileFromPath("files/lib/%s".formatted(PKCS11_WRAPPER_FILENAME), getPkcsWrapperPath())
.withFileFromPath("files/lib/hwtoken.jar", hwTokenJarPath)
.withFileFromPath("files/app.jar", appJarPath);
}

Expand All @@ -96,7 +94,6 @@ private Path getPkcsWrapperPath() {
default -> throw new IllegalStateException("Unsupported arch: " + SystemUtils.OS_ARCH);
};
return Paths.get("../../libs/pkcs11wrapper/%s/%s".formatted(archDir, PKCS11_WRAPPER_FILENAME));

}
};
}
Expand All @@ -108,7 +105,7 @@ public TestContainerConfigurator.TestContainerInitListener testContainerInitList
@SuppressWarnings("squid:S2068")
public void beforeStart(@NotNull GenericContainer<?> genericContainer) {
var modulemanager = enableHwModule
? "-Dxroad.signer.moduleManagerImpl=ee.ria.xroad.signer.tokenmanager.module.HardwareModuleManagerImpl"
? "-Dxroad.signer.addon.hwtoken.enabled=true"
: "";

genericContainer
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions src/packages/src/xroad/common/addon/proxy/metaservices.conf

This file was deleted.

4 changes: 0 additions & 4 deletions src/packages/src/xroad/common/addon/proxy/opmonitoring.conf

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/packages/src/xroad/common/addon/signer/hwtoken.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
WSDLVALIDATOR_HOME=/usr/share/xroad/wsdlvalidator
WSDLVALIDATOR_HOME=/usr/share/xroad/wsdl-validator
exec java -Dee.ria.xroad.internalKeyStorePassword=internal -Dee.ria.xroad.internalKeyStore=/etc/xroad/ssl/internal.p12 -jar "$WSDLVALIDATOR_HOME/jlib/wsdlvalidator-1.0.jar" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ XROAD_LOG_LEVEL="DEBUG"

. /etc/xroad/services/global.conf

CLIENT_HANDLERS=""
SERVICE_HANDLERS=""

for addon in "${ADDON_PATH}"/proxy/*.conf
do
if [ -e "${addon}" ]; then
Expand All @@ -21,8 +18,6 @@ CP="/usr/share/xroad/jlib/proxy.jar"

XROAD_PROXY_PARAMS=" -Xms100m -Xmx512m -XX:MaxMetaspaceSize=135m \
-Djavax.net.ssl.sessionCacheSize=10000 \
-Dxroad.proxy.clientHandlers=${CLIENT_HANDLERS#?} \
-Dxroad.proxy.serverServiceHandlers=${SERVICE_HANDLERS#?} \
-Dxroad.proxy.serverRestServiceHandlers=${SERVICE_REST_HANDLERS#?} $XROAD_PROXY_PARAMS"
$XROAD_PROXY_PARAMS"

apply_local_conf XROAD_PROXY_PARAMS
6 changes: 3 additions & 3 deletions src/packages/src/xroad/redhat/SPECS/xroad-signer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ cp -p %{srcdir}/../../../signer-console/build/libs/signer-console-1.0.jar %{buil

#Copy arch specific libs
%ifarch x86_64
cp -p %{srcdir}/../../../libs/pkcs11wrapper/amd64/libpkcs11wrapper.so %{buildroot}/usr/share/xroad/lib/
cp -p %{srcdir}/../../../libs/pkcs11wrapper/amd64/libpkcs11-wrapper.so %{buildroot}/usr/share/xroad/lib/
cp -p %{srcdir}/../../../libs/passwordstore/amd64/libpasswordstore.so %{buildroot}/usr/share/xroad/lib/
%endif

%ifarch aarch64
cp -p %{srcdir}/../../../libs/pkcs11wrapper/arm64/libpkcs11wrapper.so %{buildroot}/usr/share/xroad/lib/
cp -p %{srcdir}/../../../libs/pkcs11wrapper/arm64/libpkcs11-wrapper.so %{buildroot}/usr/share/xroad/lib/
cp -p %{srcdir}/../../../libs/passwordstore/arm64/libpasswordstore.so %{buildroot}/usr/share/xroad/lib/
%endif

Expand Down Expand Up @@ -94,7 +94,7 @@ rm -rf %{buildroot}
/usr/share/xroad/jlib/signer.jar
/usr/share/xroad/bin/signer-console
/usr/share/xroad/jlib/signer-*.jar
/usr/share/xroad/lib/libpkcs11wrapper.so
/usr/share/xroad/lib/libpkcs11-wrapper.so
%attr(754,root,xroad) /usr/share/xroad/bin/xroad-signer
%attr(644,root,root) %{_unitdir}/xroad-signer.service

Expand Down
51 changes: 27 additions & 24 deletions src/packages/src/xroad/ubuntu/generic/control
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ Description: X-Road signer component
Package: xroad-securityserver
Conflicts: xroad-centralserver, uxp-addon-monitor (<=6.5)
Architecture: all
Depends: xroad-proxy (=${binary:Version}), xroad-addon-metaservices (=${binary:Version}), xroad-addon-messagelog (=${binary:Version}), xroad-addon-proxymonitor (=${binary:Version}), xroad-addon-wsdlvalidator (=${binary:Version}), xroad-proxy-ui-api (=${binary:Version}), xroad-ds-identity-hub (=${binary:Version}), xroad-ds-control-plane (=${binary:Version}), xroad-ds-data-plane (=${binary:Version})
Depends: xroad-proxy (=${binary:Version}), xroad-addon-messagelog (=${binary:Version}), xroad-monitor (=${binary:Version}), xroad-proxy-ui-api (=${binary:Version}), xroad-ds-identity-hub (=${binary:Version}), xroad-ds-control-plane (=${binary:Version}), xroad-ds-data-plane (=${binary:Version})
Description: X-Road security server
This is meta-package of X-Road security server.

Package: xroad-proxy
Conflicts: xroad-center, xroad-confproxy
Architecture: all
Depends: ${misc:Depends}, rsyslog, curl, systemd, xroad-confclient (=${binary:Version}), xroad-signer (=${binary:Version}), openjdk-21-jre-headless | java21-runtime-headless | java21-runtime
Depends: ${misc:Depends}, rsyslog, curl, systemd, xroad-confclient (=${binary:Version}), xroad-signer (=${binary:Version}), openjdk-21-jre-headless | java21-runtime-headless | java21-runtime, yq
Pre-depends: xroad-database-local (=${binary:Version}) | xroad-database-remote (=${binary:Version}), xroad-secret-store-local (=${binary:Version}) | xroad-secret-store-remote (=${binary:Version}), xroad-base (=${binary:Version})
Description: X-Road security server
X-Road security server programs and utilities
Expand All @@ -89,28 +89,31 @@ Architecture: amd64 arm64
# These following 2 package relationship changes were required to fix an issue caused by a file dependency diversion from xroad-signer to xroad-addon-hwtokens in 7.1.0
Replaces: xroad-signer (<< 7.1.0)
Breaks: xroad-signer (<< 7.1.0)
Depends: ${misc:Depends}, xroad-base (=${binary:Version}), xroad-confclient (=${binary:Version}), xroad-signer (=${binary:Version})
Description: X-Road AddOn: hwtokens
AddOn for hardware tokens
Depends: ${misc:Depends}, xroad-base (=${binary:Version}), xroad-confclient (=${binary:Version}), xroad-signer (=${binary:Version}), yq
Section: oldlibs
Description: transitional package
This is a transitional package. It can safely be removed.

Package: xroad-addon-messagelog
Architecture: all
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version})
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), yq
Conflicts: xroad-addon-legacy-securelog
Description: X-Road AddOn: messagelog
AddOn for secure message log

Package: xroad-addon-metaservices
Architecture: all
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version})
Description: X-Road AddOn: metaservices
AddOn for metaservice reponders
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), yq
Section: oldlibs
Description: transitional package
This is a transitional package. It can safely be removed.

Package: xroad-addon-proxymonitor
Architecture: all
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), xroad-monitor (=${binary:Version})
Description: X-Road AddOn: proxy monitoring metaservice
Addon for proxy monitoring
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), yq
Section: oldlibs
Description: transitional package
This is a transitional package. It can safely be removed.

Package: xroad-monitor
Architecture: all
Expand All @@ -120,48 +123,48 @@ Description: X-Road monitoring service

Package: xroad-addon-wsdlvalidator
Architecture: all
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version})
Description: X-Road AddOn: wsdlvalidator
AddOn for WSDL validator for the X-Road services
Depends: ${misc:Depends}, xroad-proxy-ui-api (=${binary:Version}), yq
Description: transitional package
This is a transitional package. It can safely be removed.

Package: xroad-addon-opmonitoring
Architecture: all
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), xroad-opmonitor (=${binary:Version})
Description: X-Road AddOn: operations monitoring service
AddOn for operations monitoring.
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), xroad-opmonitor (=${binary:Version}), yq
Description: transitional package
This is a transitional package. It can safely be removed.

Package: xroad-securityserver-fi
Conflicts: xroad-centralserver
Architecture: all
Depends: xroad-securityserver (=${binary:Version}), xroad-addon-opmonitoring (=${binary:Version})
Depends: xroad-securityserver (=${binary:Version}), xroad-opmonitor (=${binary:Version})
Description: X-Road security server with Finnish settings
This is meta-package of X-Road security server with Finnish settings.

Package: xroad-securityserver-is
Conflicts: xroad-centralserver
Architecture: all
Depends: xroad-securityserver (=${binary:Version}), xroad-addon-opmonitoring (=${binary:Version})
Depends: xroad-securityserver (=${binary:Version}), xroad-opmonitor (=${binary:Version})
Description: X-Road security server with Icelandic settings
This is meta-package of X-Road security server with Icelandic settings.

Package: xroad-securityserver-ee
Conflicts: xroad-centralserver
Architecture: all
Depends: xroad-securityserver (=${binary:Version}), xroad-addon-opmonitoring (=${binary:Version})
Depends: xroad-securityserver (=${binary:Version}), xroad-opmonitor (=${binary:Version})
Description: X-Road security server with Estonian settings
This is meta-package of X-Road security server with Estonian settings.

Package: xroad-securityserver-fo
Conflicts: xroad-centralserver
Architecture: all
Depends: xroad-securityserver (=${binary:Version}), xroad-addon-opmonitoring (=${binary:Version})
Depends: xroad-securityserver (=${binary:Version}), xroad-opmonitor (=${binary:Version})
Description: X-Road security server with the Faroe Islands' settings
This is meta-package of X-Road security server with the Faroe Islands' settings.

Package: xroad-opmonitor
Conflicts: xroad-center
Architecture: all
Depends: ${misc:Depends}, xroad-base (=${binary:Version}), xroad-confclient (=${binary:Version})
Depends: ${misc:Depends}, xroad-base (=${binary:Version}), xroad-confclient (=${binary:Version}), yq
Pre-depends: xroad-database-local (=${binary:Version}) | xroad-database-remote (=${binary:Version})
Description: X-Road operations monitoring daemon
X-Road operations monitoring daemon
Expand All @@ -177,7 +180,7 @@ Description: Automatic token pin code entry
Package: xroad-proxy-ui-api
Architecture: all
Pre-depends: xroad-base (=${binary:Version})
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version})
Depends: ${misc:Depends}, xroad-proxy (=${binary:Version}), yq
Replaces: xroad-nginx, xroad-jetty9
Breaks: xroad-nginx, xroad-jetty9
Description: X-Road proxy UI REST API
Expand Down
Loading
Loading