Commit Graph

10 Commits

Author SHA1 Message Date
Micah Snyder
f75c3b3b4c Github actions: Update package list before install
To fix issues with installing older packages that may have been replaced
2021-08-05 16:54:02 -07:00
Micah Snyder
9f407d83b3 Test: update clang-format-action to v3.4.0 2021-07-16 14:43:16 -07:00
Micah Snyder
9451224323 Test: ClamDScan ExcludePath; Valgrind
Adds a basic test to validate that ExcludePath correctly excludes a
subdirectory but does not exclude subsequent files. As with the other
ClamD/Scan tests, it will test in each mode: regular, stream, and
fdpass (if available).

Unlike the other tests, this one tests ClamDScan with Valgrind instead
of ClamD.

Refactored the clamd_test.py file to reduce duplicate code, and support
enabling and disabling valgrind when running ClamDScan and ClamD.

Add pytest to the github actions environments because the results when
using pytest are far easier to read.
2021-07-15 11:56:13 -07:00
Micah Snyder
ccac5567c9 Add issue template
The template includes a comment block at the top to direct security
issue reports towards the SECURITY.md instructions.

A comment block at the bottom provides instructions for how to share
files needed to reproduce the bug.

These comments blocks disappear when the report is submitted.

The older style markdown headers are used to match the headers printed
by the ClamConf tool, so that copy-pasted output from ClamConf looks
good in the bug report.
2021-06-09 16:59:15 -07:00
Micah Snyder
d57d898652 Github actions: Fix build after repo name change 2021-05-18 17:13:57 -07:00
Micah Snyder
de0086aa91 GitHub Actions: minor corrections
The clang-format action needs to check `common` instead of `shared`.

The docker db update action needs to clone the repo first.
2021-05-02 09:46:16 -07:00
Micah Snyder
6d3685c421 Docker: milter daemon, news, docs, github action
The milter default was not set correctly so it was starting
clamav-milter by default. Added default true/false settings for each of
the docker daemon environment variables.

Added command to entrypoint to change database directory ownership to
the clamav user, in case it is a mounted volume (which get root ownership
by default).

Removed the clamav user & group from the build image, as it isn't needed
until the base image.

Added announcement details and acknowledgements to the News document.

Added details to the Docker Readme describing:

- the tag naming convention
- how to mount database volumes
- various other tweaks

Fixed the path for the update script in the GitHub Action, and changed
from alpine-latest to ubuntu-latest, because alpine-latest doesn't seem
to be an option.
2021-04-29 18:15:56 -07:00
Olliver Schinagl
21a4d59fce docker: Add script to update virus database
To reduce the need for constant database updates, also push a docker
image containing the virus database.

Ideally, this script is called every time a major virus database update
happens, but as that requires integration with other systems, lets start
by having a scheduled update.

To do this a github action workflow was added on a schedule that runs
once a month. It does require the proper secrets to be setup however and
made accessible.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2021-04-29 17:55:12 -07:00
Micah Snyder
6b364826d2 Github actions: add clang-format check
Add check to make sure code is properly formatted.
2021-04-09 19:08:14 -07:00
Micah Snyder
c81968d3a7 GitHub Actions testing on Ubuntu, Mac, & Windows
Updates to fix issues in the CMake install instructions.

Updates the README.md to indicate that CMake is now preferred

Adds a GitHub Actions badge, Discord badge, and logo to the README.md.

CMake:

- Renamed ENABLE_DOCS to ENABLE_MAN_PAGES.

- Fixed build issue when milter isn't enabled on Linux. Changed the
default to build milter on non-macOS, non-Windows operating systems.

- Fix LD_LIBRARY_PATH for tests including on macOS where LD_LIBRARY_PATH
  and DYLD_LIBRARY_PATH must be manually propagated to subprocesses.

- Use UNKNOWN IMPORTED library instead of INTERFACE IMPORTED library for
  pdcurses, but still use INTERFACE IMPORTED for ncurses.
  UNKNOWN IMPORTED appears to be required so that we can use
  $<TARGET_FILE_DIR:Curses::curses> to collected the pdcurses library at
  install time on Windows.

- When building with vcpkg on Windows, CMake will automatically install
  your app local dependencies (aka the DLL runtime dependencies).
  Meanwhile, file(GET_RUNTIME_DEPENDENCIES ...) doesn't appear to work
  correctly with vcpkg packages. The solution is to use a custom target
  that has CMake perform a local install to the unit_tests directory
  when using vcpkg.
  This is in fact far easier than using GET_RUNTIME_DEPENDENCIES in the
  unit_tests for assembling the test environment but we can't use this
  method for the non-vcpkg install because it won't collect
  checkDynamic.dll for us because we don't install our tests.
  We also can't link with the static check.lib because the static
  check.lib has pthreads symbols linked in and will conflict with our
  pthread.dll.

  TL;DR: We'll continue to use file(GET_RUNTIME_DEPENDENCIES ...) for
  assembling the test enviornment on non-vcpkg builds, and use the local
  install method for vcpkg builds.

testcase.py: Wrapped a Pathlib.unlink() call in exception handling as
the missing_ok optional parameter requires a Python version too new for
common use.

Remove localtime_r from win32 compat lib.
localtime_r may be present in libcheck when building with vcpkg and
while making it a static function would also solve the issue, using
localtime_s instead like we do everywhere else should work just fine.

check_clamd: Limited the max # of connections for the stress test on Mac
to 850, to address issues found testing on macos-latest on GitHub Actions.
2021-02-25 11:41:28 -08:00