From 0ff543d81296519cbdfd9f676335059908f3c9a5 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 18 Jan 2024 18:05:46 +0000 Subject: [PATCH 1/8] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a8de031..600f9d0 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Then add one of the below cron examples. To run the job every Sunday at midnight: ```cron -0 0 * * 0 /usr/bin/docker compose -f /root/clam/docker-compose.yml up -d --pull --force-recreate clamav +0 0 * * 0 /usr/bin/docker compose -f /root/clam/docker-compose.yml up -d --pull --force-recreate clam ``` ### Once Every Two Weeks @@ -55,7 +55,7 @@ To run the job every Sunday at midnight: Cron does not natively support a bi-weekly schedule directly. However, you can achieve this by specifying two days of the month, such as the 1st and 15th: ```cron -0 0 1,15 * * /usr/bin/docker compose -f /root/clam/docker-compose.yml up -d --pull --force-recreate clamav +0 0 1,15 * * /usr/bin/docker compose -f /root/clam/docker-compose.yml up -d --pull --force-recreate clam ``` ### Once a Month @@ -63,11 +63,11 @@ Cron does not natively support a bi-weekly schedule directly. However, you can a To run the job on the first day of every month at midnight: ```cron -0 0 1 * * /usr/bin/docker compose -f /root/clam/docker-compose.yml up -d --pull --force-recreate clamav +0 0 1 * * /usr/bin/docker compose -f /root/clam/docker-compose.yml up -d --pull --force-recreate clam ``` ### Notes: - Ensure that `/usr/bin/docker` is the correct path to your Docker binary. This path might vary depending on your system's configuration. - Replace `/root/clam` with the actual directory path where your `docker-compose.yml` file is located. -- These cron jobs will pull the latest image and recreate the `clamav` container according to the specified schedule. Ensure that this behavior aligns with your maintenance and update policies. +- These cron jobs will pull the latest image and recreate the `clam` container according to the specified schedule. Ensure that this behavior aligns with your maintenance and update policies. From e1a53b05274939a47b8c91238f043ccb5e5d58a6 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 18 Jan 2024 20:06:44 +0000 Subject: [PATCH 2/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 600f9d0..3668636 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ version: '3.8' services: clam: image: git.nixc.us/colin/clam:production + read_only: true volumes: - /:/scan - ./logs:/var/log/clamav From be0eed1f3959ffb4b5d42bda56c332fe4bf3aac1 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 18 Jan 2024 20:25:08 +0000 Subject: [PATCH 3/8] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3668636..08afc88 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,15 @@ then `nano /root/clam/docker-compose.yml` version: '3.8' services: - clam: + clamav: image: git.nixc.us/colin/clam:production read_only: true volumes: - /:/scan - ./logs:/var/log/clamav - ./quarantine:/quarantine + tmpfs: + - /tmp ``` Put this container in the crontab From 555d1cb76349dc9aa7fc2c734162ba5f2754ef24 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 18 Jan 2024 20:36:00 +0000 Subject: [PATCH 4/8] Update .woodpecker.yml --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 9df2fa5..d764841 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -93,7 +93,7 @@ steps: - echo "Building application for staging branch" - echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us - echo compose build - - docker compose -f docker-compose.production.yml build + - docker compose -f docker-compose.production.yml build --no-cache - docker compose -f docker-compose.production.yml push when: branch: main From 5c2f9719a9d2e215a1134607c69eb5d4ed42bd16 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 19 Jan 2024 18:51:07 +0000 Subject: [PATCH 5/8] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 08afc88..8a3123a 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,11 @@ services: - ./quarantine:/quarantine tmpfs: - /tmp + deploy: + resources: + limits: + cpus: '0.50' # Limit to 50% of a CPU + memory: 512M # Limit to 512 megabytes ``` Put this container in the crontab From ffaa20234abf173485b6c69de04e8d2bb7400be9 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 19 Jan 2024 18:57:01 +0000 Subject: [PATCH 6/8] Update docker/clam/docker-entrypoint.sh --- docker/clam/docker-entrypoint.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docker/clam/docker-entrypoint.sh b/docker/clam/docker-entrypoint.sh index 3408b04..f6cc72f 100644 --- a/docker/clam/docker-entrypoint.sh +++ b/docker/clam/docker-entrypoint.sh @@ -4,7 +4,15 @@ MODE=${1:-"scan"} scan() { echo "Running ClamAV scan..." - clamscan -r /scan --log=/var/log/clamav/clamav.log + SCAN_PRIORITY=${SCAN_PRIORITY:-low} + + if [ "$SCAN_PRIORITY" = "low" ]; then + echo "Running scan in low priority mode." + nice -n 19 clamscan -r /scan --log=/var/log/clamav/clamav.log + else + echo "Running scan in full power mode." + clamscan -r /scan --log=/var/log/clamav/clamav.log + fi } report() { From 0a2ccae3297da3a507518205af25b0eae15d8528 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 2 Feb 2024 14:27:48 +0000 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a3123a..5a7f3b2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + # Known weaknesses and caveats There is currently no significantly advanced validation except that it builds, and the packages it draws from are unlikely to break without us knowing. This doesn't validate the efficacy of the tools in this container yet; it may be something added later. From 1e54d0ae30b1d1cf0626119a3f6d71a787b4db35 Mon Sep 17 00:00:00 2001 From: colin Date: Mon, 4 Mar 2024 00:13:35 +0000 Subject: [PATCH 8/8] Update .woodpecker.yml --- .woodpecker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index d764841..ae85afb 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -29,6 +29,7 @@ steps: name: deploy-new when: branch: main + event: push # path: # include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ] image: woodpeckerci/plugin-docker-buildx @@ -69,6 +70,7 @@ steps: name: cleanup-staging when: branch: main + event: push # path: # include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ] image: woodpeckerci/plugin-docker-buildx