From 0da25870d741f7f7727508e086a0946410cef623 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 17 Dec 2025 08:44:06 -0800 Subject: [PATCH 1/6] LPD-73846 Add clamav compose recipe files --- compose-recipes/clamav/liferay.clamav.yaml | 7 +++++++ compose-recipes/clamav/service.clamav.yaml | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 compose-recipes/clamav/liferay.clamav.yaml create mode 100644 compose-recipes/clamav/service.clamav.yaml diff --git a/compose-recipes/clamav/liferay.clamav.yaml b/compose-recipes/clamav/liferay.clamav.yaml new file mode 100644 index 0000000..614097d --- /dev/null +++ b/compose-recipes/clamav/liferay.clamav.yaml @@ -0,0 +1,7 @@ +services: + liferay: + depends_on: + clamav: + condition: service_healthy + environment: + - LIFERAY_DL_PERIOD_STORE_PERIOD_ANTIVIRUS_PERIOD_ENABLED=true \ No newline at end of file diff --git a/compose-recipes/clamav/service.clamav.yaml b/compose-recipes/clamav/service.clamav.yaml new file mode 100644 index 0000000..f40ab4b --- /dev/null +++ b/compose-recipes/clamav/service.clamav.yaml @@ -0,0 +1,11 @@ +services: + clamav: + container_name: ${NAMESPACE}-clamav + healthcheck: + interval: 30s + timeout: 10s + test: echo 'PING' | nc -w 5 localhost 3310 + retries: 5 + image: clamav/clamav:1.0.9 + ports: + - 3310:3310 \ No newline at end of file From 9964d88de7a576816cca7a91ea5235035e2bb90a Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 17 Dec 2025 09:21:10 -0800 Subject: [PATCH 2/6] LPD-73846 Add configuration for ClamAV service --- .../com/liferay/docker/workspace/environments/Config.groovy | 3 +++ gradle.properties | 1 + 2 files changed, 4 insertions(+) diff --git a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy index dcfc856..83f2c7c 100644 --- a/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy +++ b/buildSrc/src/main/groovy/com/liferay/docker/workspace/environments/Config.groovy @@ -183,6 +183,8 @@ class Config { this.useClustering = this.useLiferay && this.clusterNodes > 0 + this.useClamAV = this.services.contains("clamav") + if (this.services.contains("db2")) { this.databaseType = "db2" this.useDatabase = true @@ -321,6 +323,7 @@ class Config { public String namespace = null public String product = null public List services = new ArrayList() + public boolean useClamAV = false public boolean useClustering = false public boolean useDatabase = false public boolean useDatabaseDB2 = false diff --git a/gradle.properties b/gradle.properties index 8981469..95b1ffc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -40,6 +40,7 @@ lr.docker.environment.compose.files= # Enable each service or "service" that you would like to include in your # environment. If the value is "true" or "1", the service is enabled. Any other # value (or a blank value) is ignored and disables the service. +lr.docker.environment.service.enabled[clamav]=false lr.docker.environment.service.enabled[db2]=false lr.docker.environment.service.enabled[elasticsearch]=false lr.docker.environment.service.enabled[liferay]=true From 428499c960d51916d837a82d0a78d151fc51ed17 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 17 Dec 2025 09:22:00 -0800 Subject: [PATCH 3/6] LPD-73846 Add osgi config file for ClamAV --- ...nal.configuration.ClamdAntivirusScannerConfiguration.config | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 configs/common/osgi/configs/com.liferay.antivirus.clamd.scanner.internal.configuration.ClamdAntivirusScannerConfiguration.config diff --git a/configs/common/osgi/configs/com.liferay.antivirus.clamd.scanner.internal.configuration.ClamdAntivirusScannerConfiguration.config b/configs/common/osgi/configs/com.liferay.antivirus.clamd.scanner.internal.configuration.ClamdAntivirusScannerConfiguration.config new file mode 100644 index 0000000..84aa991 --- /dev/null +++ b/configs/common/osgi/configs/com.liferay.antivirus.clamd.scanner.internal.configuration.ClamdAntivirusScannerConfiguration.config @@ -0,0 +1,3 @@ +hostname="clamav" +port=I"3310" +timeout=I"120000" From 8703058ad3a0e9a39d058af50d97aade5046a0dd Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 17 Dec 2025 10:30:35 -0800 Subject: [PATCH 4/6] LPD-73846 Define and use host port from env file --- compose-recipes/clamav/service.clamav.yaml | 4 ++-- ports.env | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compose-recipes/clamav/service.clamav.yaml b/compose-recipes/clamav/service.clamav.yaml index f40ab4b..2b75121 100644 --- a/compose-recipes/clamav/service.clamav.yaml +++ b/compose-recipes/clamav/service.clamav.yaml @@ -4,8 +4,8 @@ services: healthcheck: interval: 30s timeout: 10s - test: echo 'PING' | nc -w 5 localhost 3310 + test: echo 'PING' | nc -w 5 localhost ${CLAMAV_PORT} retries: 5 image: clamav/clamav:1.0.9 ports: - - 3310:3310 \ No newline at end of file + - ${CLAMAV_PORT}:3310 \ No newline at end of file diff --git a/ports.env b/ports.env index bd015f9..a0198a7 100644 --- a/ports.env +++ b/ports.env @@ -3,6 +3,8 @@ LIFERAY_GOGO_SHELL_PORT=11311-11319 LIFERAY_DEBUG_PORT=8000-8009 LIFERAY_YOURKIT_PORT=10001-10010 +CLAMAV_PORT=3310 + DATABASE_PORT=54321-54330 ELASTICSEARCH_HTTP_PORT=9200-9209 From f77e7f71134298c47dacce3decd65ce6aa99ac7a Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 17 Dec 2025 10:38:29 -0800 Subject: [PATCH 5/6] LPD-73846 Make version configurable --- compose-recipes/clamav/service.clamav.yaml | 2 +- versions.env | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compose-recipes/clamav/service.clamav.yaml b/compose-recipes/clamav/service.clamav.yaml index 2b75121..841e33f 100644 --- a/compose-recipes/clamav/service.clamav.yaml +++ b/compose-recipes/clamav/service.clamav.yaml @@ -6,6 +6,6 @@ services: timeout: 10s test: echo 'PING' | nc -w 5 localhost ${CLAMAV_PORT} retries: 5 - image: clamav/clamav:1.0.9 + image: clamav/clamav:${CLAMAV_VERSION} ports: - ${CLAMAV_PORT}:3310 \ No newline at end of file diff --git a/versions.env b/versions.env index 644ac0c..45abffb 100644 --- a/versions.env +++ b/versions.env @@ -1,3 +1,4 @@ +CLAMAV_VERSION=1.0.9 DB2_VERSION=11.5.9.0 MARIADB_VERSION=10.6.22-jammy MYSQL_VERSION=8.4.5-oracle From 1ae21a9a679c65030ad35c57e2b84a45bd3e9145 Mon Sep 17 00:00:00 2001 From: Anthony Chu Date: Wed, 17 Dec 2025 10:41:18 -0800 Subject: [PATCH 6/6] LPD-73846 SF --- compose-recipes/clamav/service.clamav.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose-recipes/clamav/service.clamav.yaml b/compose-recipes/clamav/service.clamav.yaml index 841e33f..0a902d4 100644 --- a/compose-recipes/clamav/service.clamav.yaml +++ b/compose-recipes/clamav/service.clamav.yaml @@ -3,9 +3,9 @@ services: container_name: ${NAMESPACE}-clamav healthcheck: interval: 30s - timeout: 10s - test: echo 'PING' | nc -w 5 localhost ${CLAMAV_PORT} retries: 5 + test: echo 'PING' | nc -w 5 localhost ${CLAMAV_PORT} + timeout: 10s image: clamav/clamav:${CLAMAV_VERSION} ports: - ${CLAMAV_PORT}:3310 \ No newline at end of file