From 759208d90329f5fb8042ff49b3672e6584098b93 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 14 Jul 2025 19:52:34 +0100 Subject: [PATCH] Disable VirusCheck plugin Not compatible with ClamAV >= 1.0. --- .github/workflows/build.yml | 34 +-------------------------------- doc/src/man/linkcheckerrc.rst | 4 ++++ linkcheck/plugins/viruscheck.py | 4 ++++ tests/__init__.py | 2 +- 4 files changed, 10 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4d0909d..c54a1077 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,35 +41,7 @@ jobs: - name: Install OS dependencies run: | sudo apt-get update - sudo apt-get install -y clamav-daemon geoip-database libgeoip-dev gettext - - - name: Make ClamAV cache directory writeable for cache action - run: | - sudo chown -R runner:docker /var/lib/clamav - - - name: ClamAV cache - id: cache-clamav - uses: actions/cache@v4 - with: - path: /var/lib/clamav - key: clamav-v1 - - - name: Restore ClamAV directory ownership - run: | - sudo chown -R clamav:clamav /var/lib/clamav - - - name: Restart ClamAV Daemon - if: ${{ steps.cache-clamav.outputs.cache-hit == 'true' }} - run: | - sudo service clamav-daemon restart - - - name: Download the ClamAV signature database - if: ${{ steps.cache-clamav.outputs.cache-hit != 'true' }} - run: | - sudo service clamav-freshclam stop - sudo freshclam - sudo service clamav-daemon restart - sudo service clamav-daemon status + sudo apt-get install -y geoip-database libgeoip-dev gettext - name: Git clone uses: actions/checkout@v4 @@ -98,10 +70,6 @@ jobs: python -m pip install -U hatchling hatch-vcs polib python -m pip install -U tox coverage - - name: Wait for ClamAV to be ready - run: | - while ! test -S /run/clamav/clamd.ctl; do printf "."; sleep 1; done - - name: Run tests run: | python -m hatchling build -t sdist --hooks-only diff --git a/doc/src/man/linkcheckerrc.rst b/doc/src/man/linkcheckerrc.rst index 80496106..62977224 100644 --- a/doc/src/man/linkcheckerrc.rst +++ b/doc/src/man/linkcheckerrc.rst @@ -569,6 +569,10 @@ daemon must be installed. **clamavconf=**\ *filename* Filename of **clamd.conf** config file. +.. note:: + + The VirusCheck plugin does not support ClamAV >= 1.0 and is disabled. + PdfParser ^^^^^^^^^ diff --git a/linkcheck/plugins/viruscheck.py b/linkcheck/plugins/viruscheck.py index 1db079e1..aae80a29 100644 --- a/linkcheck/plugins/viruscheck.py +++ b/linkcheck/plugins/viruscheck.py @@ -34,9 +34,13 @@ class VirusCheck(_ContentPlugin): self.clamav_conf = get_clamav_conf(canonical_clamav_conf()) if not self.clamav_conf: log.warn(LOG_PLUGIN, "clamav daemon not found for VirusCheck plugin") + log.warn( + LOG_PLUGIN, _("VirusCheck plugin does not support ClamAV >= 1.0.") + ) def applies_to(self, url_data): """Check for clamav and extern.""" + return False # XXX Plugin disabled return self.clamav_conf and not url_data.extern[0] def check(self, url_data): diff --git a/tests/__init__.py b/tests/__init__.py index 0bfe671e..eda846af 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -160,7 +160,7 @@ def has_clamav(): return False -need_clamav = _need_func(has_clamav, "ClamAV") +need_clamav = _need_func(has_clamav, "ClamAV", False) # XXX Plugin disabled @lru_cache(1)