Skip to content

Commit

Permalink
Fix CVE-2020-13956 vulnerability and batch for alfviral-antivirus
Browse files Browse the repository at this point in the history
fegorama committed Aug 18, 2021
1 parent f94dd68 commit 4c75b1f
Showing 4 changed files with 188 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,3 +7,4 @@
/bin
*.log*
.DS_Store

95 changes: 95 additions & 0 deletions alfviral-antivirus/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
@ECHO OFF

SET COMPOSE_FILE_PATH=%CD%\docker\docker-compose.yml

IF [%M2_HOME%]==[] (
SET MVN_EXEC=mvn
)

IF NOT [%M2_HOME%]==[] (
SET MVN_EXEC=%M2_HOME%\bin\mvn
)

IF [%1]==[] (
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}"
GOTO END
)

IF %1==build_start (
CALL :down
CALL :build
CALL :start
CALL :tail
GOTO END
)
IF %1==build_start_it_supported (
CALL :down
CALL :build
CALL :prepare_test
CALL :start
CALL :tail
GOTO END
)
IF %1==start (
CALL :start
CALL :tail
GOTO END
)
IF %1==stop (
CALL :down
GOTO END
)
IF %1==purge (
CALL:down
CALL:purge
GOTO END
)
IF %1==tail (
CALL :tail
GOTO END
)
IF %1==build_test (
CALL :down
CALL :build
CALL :prepare_test
CALL :start
CALL :test
CALL :tail_all
CALL :down
GOTO END
)
IF %1==test (
CALL :test
GOTO END
)
echo "Usage: %0 {build_start|start|stop|purge|tail|build_test|test}"
:END
EXIT /B %ERRORLEVEL%

:start
docker volume create openssh-keys-volume
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d
EXIT /B 0
:down
if exist "%COMPOSE_FILE_PATH%" (
docker-compose -f "%COMPOSE_FILE_PATH%" down
)
EXIT /B 0
:build
call %MVN_EXEC% clean package
EXIT /B 0
:tail
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
EXIT /B 0
:tail_all
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
EXIT /B 0
:prepare_test
call %MVN_EXEC% verify -DskipTests=true
EXIT /B 0
:test
call %MVN_EXEC% verify
EXIT /B 0
:purge
docker volume rm -f openssh-keys-volume
EXIT /B 0
88 changes: 88 additions & 0 deletions alfviral-antivirus/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/sh

export COMPOSE_FILE_PATH="${PWD}/docker/docker-compose.yml"

if [ -z "${M2_HOME}" ]; then
export MVN_EXEC="mvn"
else
export MVN_EXEC="${M2_HOME}/bin/mvn"
fi

start() {
docker volume create openssh-keys-volume
docker-compose -f "$COMPOSE_FILE_PATH" up --build -d
}

down() {
if [ -f "$COMPOSE_FILE_PATH" ]; then
docker-compose -f "$COMPOSE_FILE_PATH" down
fi
}

purge() {
docker volume rm -f openssh-keys-volume
}

build() {
$MVN_EXEC clean package
}

tail() {
docker-compose -f "$COMPOSE_FILE_PATH" logs -f
}

tail_all() {
docker-compose -f "$COMPOSE_FILE_PATH" logs --tail="all"
}

prepare_test() {
$MVN_EXEC verify -DskipTests=true
}

test() {
$MVN_EXEC verify
}

case "$1" in
build_start)
down
build
start
tail
;;
build_start_it_supported)
down
build
prepare_test
start
tail
;;
start)
start
tail
;;
stop)
down
;;
purge)
down
purge
;;
tail)
tail
;;
build_test)
down
build
prepare_test
start
test
tail_all
down
;;
test)
test
;;
*)
echo "Usage: $0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}"
esac
6 changes: 4 additions & 2 deletions alfviral-platform/pom.xml
Original file line number Diff line number Diff line change
@@ -62,11 +62,13 @@
<scope>test</scope>
</dependency>
-->
<dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>[4.5.13,)</version>
<scope>test</scope>
</dependency>
</dependency>

<!-- The main Alfresco Repo dependency for compiling Java code in src/main/java -->
<dependency>

0 comments on commit 4c75b1f

Please sign in to comment.