From bf760b34d8c70c4dc748d2fcc332313c3e9aa6e8 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Thu, 7 Dec 2023 16:32:38 -0500 Subject: [PATCH 1/7] Github Actions: Fix pypi release workflow to use ubuntu-latest ubuntu-18.04 is gone, use ubuntu-latest instead. --- .github/workflows/pypi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index b9854dd..17451c3 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -5,7 +5,7 @@ on: release jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@master From a422e3ffdf8ca84c605b0f3adc6958322decaea7 Mon Sep 17 00:00:00 2001 From: Kim Oliver Drechsel Date: Fri, 26 Apr 2024 21:41:46 +0200 Subject: [PATCH 2/7] Add documentation for cvd add command --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index b020bd5..bc3545f 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,7 @@ Familiarize yourself with the various commands using the `--help` option. cvd --help cvd config --help cvd update --help +cvd add --help cvd clean --help ``` @@ -271,6 +272,20 @@ ls ~/.cvdupdate/logs cat ~/.cvdupdate/logs/* ``` +### Add an additional database + +Maybe add an additional database that is not part of the default set of databases. + +```bash +cvd add linux.cvd https://database.clamav.net/linux.cvd +``` + +List out the databases again: + +```bash +cvd list -V +``` + ### Serve it up, Test out FreshClam Test out your mirror with FreshClam on the same computer. From d870423b476a9ba3c7a0f964049dbb020863fd99 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 4 Sep 2024 11:47:16 -0400 Subject: [PATCH 3/7] Add setuptools to install_requires cvdupdate uses the pkg_resources module (provided by setuptools) at runtime so setuptools should be a dependency. Signed-off-by: Craig Andrews --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index c4a867d..e389227 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ "requests", "dnspython>=2.1.0", "rangehttpserver", + "setuptools", ], classifiers=[ "Programming Language :: Python :: 3", From 43a121f302c4adf6b13aee878509fbf7afa72330 Mon Sep 17 00:00:00 2001 From: Mark Petersen Date: Tue, 18 Jul 2023 14:15:02 +0200 Subject: [PATCH 4/7] Add Docker Compose file to ease deployment Add Docker Compose instructions to the README.md --- README.md | 32 +++++++++++++++++++++++++++++++- compose.yaml | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 compose.yaml diff --git a/README.md b/README.md index bc3545f..c265f1b 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ You can test it by running `freshclam` or `freshclam.exe` locally, where you've DatabaseMirror http://localhost:8000 ``` -### Use docker +## Use docker Build docker image @@ -338,6 +338,36 @@ docker run -d \ -e CRON='0 0 * * *' \ cvdupdate:latest ``` +## Use Docker compose + +Edit the compose file if you need to change the default values: + +* Port 8000 +* USER_ID=0 +* CRON=30 */4 * * * + +### Build +``` +docker compose build +``` + +### Start +``` +docker compose up -d +``` + +### Stop +``` +docker compose down +``` + +### Volumes +Volumes are defined in the composefile and will be autocreated on `docker compose up` +``` +DRIVER VOLUME NAME +local cvdupdate_database +local cvdupdate_log +``` ## Contribute diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..fae06ed --- /dev/null +++ b/compose.yaml @@ -0,0 +1,18 @@ +services: + cvdupdate: + build: ./ + hostname: cvdupdate + container_name: cvdupdate + image: cvdupdate:latest + ports: + - 8000:8000 + environment: + - CRON=30 */4 * * * + - USER_ID=0 + volumes: + - database:/cvdupdate/database + - log:/cvdupdate/logs + +volumes: + database: + log: From 1841f2aee37059de33f0a8cc7d655d42ccb592e6 Mon Sep 17 00:00:00 2001 From: Tom Judge Date: Fri, 20 Sep 2024 15:29:42 +0000 Subject: [PATCH 5/7] Add apache instance to the docker-compose setup to serve the mirror Update README.md: - Add information about volumes. - Better explanation of the docker compose setup. Co-authored-by: Micah Snyder --- README.md | 16 ++++++++++------ compose.yaml | 9 +++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c265f1b..4de183d 100644 --- a/README.md +++ b/README.md @@ -338,31 +338,35 @@ docker run -d \ -e CRON='0 0 * * *' \ cvdupdate:latest ``` -## Use Docker compose +## Use Docker Compose -Edit the compose file if you need to change the default values: +A Docker `compose.yaml` is provided to: +1. Regularly update a Docker volume with the latest ClamAV databases. +2. Serve a database mirror on port 8000 using the Apache webserver. + +Edit the `compose.yaml` file if you need to change the default values: * Port 8000 * USER_ID=0 * CRON=30 */4 * * * ### Build -``` +```bash docker compose build ``` ### Start -``` +```bash docker compose up -d ``` ### Stop -``` +```bash docker compose down ``` ### Volumes -Volumes are defined in the composefile and will be autocreated on `docker compose up` +Volumes are defined in `compose.yaml` and will be auto-created when you run `docker compose up` ``` DRIVER VOLUME NAME local cvdupdate_database diff --git a/compose.yaml b/compose.yaml index fae06ed..07c4c43 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,14 +4,19 @@ services: hostname: cvdupdate container_name: cvdupdate image: cvdupdate:latest - ports: - - 8000:8000 environment: - CRON=30 */4 * * * - USER_ID=0 volumes: - database:/cvdupdate/database - log:/cvdupdate/logs + ## Apache instance to serve the mirror + apache: + image: httpd:2.4 + volumes: + - database:/usr/local/apache2/htdocs + ports: + - 8000:80 volumes: database: From 5a4103d1601f355498fabf0c89dfb87fa3e88160 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Tue, 15 Oct 2024 10:14:41 -0400 Subject: [PATCH 6/7] Bump version to 1.1.2 Add release notes. --- CHANGES.md | 33 ++++++++++++++++++++++++++++----- setup.py | 2 +- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6a9c5e0..e9adbd6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,20 +8,43 @@ > - Fixed: 🐛 > - Security: 🛡 +## Version 1.1.2 + +➕ Added a Docker Compose file to make it easier to host a private mirror. + The Docker Compose environment runs two containers: + 1. CVD-Update. + 2. An Apache webserver to host the private mirror. + + Improvement courtesy of Mark Petersen. + - GitHub Pull-Request: https://github.com/Cisco-Talos/cvdupdate/pull/61 + +🐛 Fixed the CVD-Update Python package so it installs the `setuptools` + dependency. This fixes a runtime error on some systems. + Fix courtesy of Craig Andrews. + - GitHub Pull-Request: https://github.com/Cisco-Talos/cvdupdate/pull/59 + +🐛 Added missing documentation for `cvd add` command to the Readme. + Fix courtesy of Kim Oliver Drechsel. + - GitHub Pull-Request: https://github.com/Cisco-Talos/cvdupdate/pull/58 + +➕ Added retries in case the DNS TXT query fails. + Fix courtesy of backbord. + - GitHub Pull-Request: https://github.com/Cisco-Talos/cvdupdate/pull/50 + ## Version 1.1.1 🐛 Fixed an issue where the `.cdiff` files were only downloaded when updating a -`.cvd` and not when downloading the `.cvd` for the first time. + `.cvd` and not when downloading the `.cvd` for the first time. 🐛 Fixed an issue where `cvd update` crashes if the DNS query fails, rather -than printing a helpful error message and exiting. + than printing a helpful error message and exiting. 🐛 Fixed support for CVD Update on Windows 🪟. In prior versions, the DNS query -was failing if a DNS server was not specified manually. Now it will try to use -OpenDNS servers if no DNS server is specified. + was failing if a DNS server was not specified manually. Now it will try to use + OpenDNS servers if no DNS server is specified. ➕ Added Python dependencies to the Readme to help users that are unable to -install using `pip`. + install using `pip`. ## Version 1.1.0 diff --git a/setup.py b/setup.py index e389227..f2d9f20 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="cvdupdate", - version="1.1.1", + version="1.1.2", author="The ClamAV Team", author_email="clamav-bugs@external.cisco.com", copyright="Copyright (C) 2022 Cisco Systems, Inc. and/or its affiliates. All rights reserved.", From 6da7cf61b191852881522e5572bb2ac4274cf4b8 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Tue, 15 Oct 2024 15:02:33 -0400 Subject: [PATCH 7/7] GitHub Actions: Update Python version for release workflow --- .github/workflows/pypi.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 17451c3..720a135 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -10,10 +10,10 @@ jobs: steps: - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v1 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.12 - name: Install pypa/build run: >-