From b32b51375d802d469d3b8ca84b8904fefc7848e0 Mon Sep 17 00:00:00 2001 From: Eduardo Cerqueira Date: Sun, 21 Aug 2022 21:52:54 -0400 Subject: [PATCH 1/2] fix databases path databases path wasn't being created during initialtization or even during the first run by cvd config set. Current contents in /mnt/cvdupdate/databases directory... ls: /mnt/cvdupdate/databases: No such file or directory --- docker/README.md | 22 ++++++++++++++++++++++ docker/src/entrypoint.sh | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/docker/README.md b/docker/README.md index 798bca4..2c9037c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -49,3 +49,25 @@ Once you have the mirror running, you can visit to see w ```txt DatabaseMirror http://localhost:8080 ``` + +### Run (dev & troubleshooting) + +some helpful commands for developing and troubleshooting: + +```sh +# build image + +# run container and get into bash +docker run --name clamav --rm -it clamav-mirror bash + +# run status +sh entrypoint.sh status + +# check config file and paths +cat /mnt/cvdupdate/config.json +ls -laht /mnt/cvdupdate/{logs,databases} + +# run update and check files +sh entrypoint.sh update +ls -laht /mnt/cvdupdate/databases/*.cvd +``` diff --git a/docker/src/entrypoint.sh b/docker/src/entrypoint.sh index d8a904f..40f6783 100644 --- a/docker/src/entrypoint.sh +++ b/docker/src/entrypoint.sh @@ -10,6 +10,10 @@ check_config() { cvd config set --config $CVD_DIR/config.json --dbdir $CVD_DIR/databases --logdir $CVD_DIR/logs echo "CVD configuration created..." fi + if [ ! -e $CVD_DIR/databases ]; then + echo "creating $CVD_DIR/databases folder" + mkdir -p $CVD_DIR/databases + fi } show_config() { From 14a636d245ef43637e1a52aede16ebe5c5ed6fd4 Mon Sep 17 00:00:00 2001 From: Eduardo Cerqueira Date: Thu, 25 Aug 2022 11:51:58 -0400 Subject: [PATCH 2/2] adjusting user message, capitalizing begin of phrase --- docker/src/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/src/entrypoint.sh b/docker/src/entrypoint.sh index 40f6783..b5251ba 100644 --- a/docker/src/entrypoint.sh +++ b/docker/src/entrypoint.sh @@ -11,7 +11,7 @@ check_config() { echo "CVD configuration created..." fi if [ ! -e $CVD_DIR/databases ]; then - echo "creating $CVD_DIR/databases folder" + echo "Creating $CVD_DIR/databases folder" mkdir -p $CVD_DIR/databases fi }