Skip to content

Commit

Permalink
Merge branch 'main' into clean-align
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored Jan 4, 2025
2 parents 6817598 + 25dff86 commit dc12806
Show file tree
Hide file tree
Showing 39 changed files with 5,780 additions and 3,233 deletions.
3 changes: 0 additions & 3 deletions .docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ ARG DEBIAN_FRONTEND=noninteractive
# s/mime email encryption
# gpgsm

# Loading scap and cert data
# xml-twig-tools

# Required for set up certificates for GVM
# gnutls-bin

Expand Down
20 changes: 10 additions & 10 deletions .docker/setup-mta.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

# Make any changes only when MTA_HOST has been set
if [ -n MTA_HOST ]; then
if [ -n "$MTA_HOST" ]; then
echo "setting up configuration file for mail agent"
CONFIG="/etc/msmtprc"
echo "host $MTA_HOST" > $CONFIG
[ -n MTA_PORT ] && echo "port $MTA_PORT" >> $CONFIG
[ -n MTA_TLS ] && echo "tls $MTA_TLS" >> $CONFIG
[ -n MTA_STARTTLS ] && echo "tls_starttls $MTA_STARTTLS" >> $CONFIG
[ -n MTA_TLS_CERTCHECK ] && echo "tls_certcheck $MTA_TLS_CERTCHECK" >> $CONFIG
[ -n MTA_AUTH ] && echo "auth $MTA_AUTH" >> $CONFIG
[ -n MTA_USER ] && echo "user $MTA_USER" >> $CONFIG
[ -n MTA_FROM ] && echo "from $MTA_FROM" >> $CONFIG
[ -n MTA_PASSWORD ] && echo "password $MTA_PASSWORD" >> $CONFIG
[ -n MTA_LOGFILE ] && echo "logfile $MTA_LOGFILE" >> $CONFIG
[ -n "$MTA_PORT" ] && echo "port $MTA_PORT" >> $CONFIG
[ -n "$MTA_TLS" ] && echo "tls $MTA_TLS" >> $CONFIG
[ -n "$MTA_STARTTLS" ] && echo "tls_starttls $MTA_STARTTLS" >> $CONFIG
[ -n "$MTA_TLS_CERTCHECK" ] && echo "tls_certcheck $MTA_TLS_CERTCHECK" >> $CONFIG
[ -n "$MTA_AUTH" ] && echo "auth $MTA_AUTH" >> $CONFIG
[ -n "$MTA_USER" ] && echo "user $MTA_USER" >> $CONFIG
[ -n "$MTA_FROM" ] && echo "from $MTA_FROM" >> $CONFIG
[ -n "$MTA_PASSWORD" ] && echo "password $MTA_PASSWORD" >> $CONFIG
[ -n "$MTA_LOGFILE" ] && echo "logfile $MTA_LOGFILE" >> $CONFIG
chown gvmd:mail $CONFIG
chmod 750 $CONFIG
fi
6 changes: 2 additions & 4 deletions .docker/start-gvmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

[ -z "$USER" ] && USER="admin"
[ -z "$PASSWORD" ] && PASSWORD="admin"
[ -z "$GVMD_ARGS" ] && GVMD_ARGS="--listen-mode=666"
[ -z "$GVMD_ARGS" ] && GVMD_ARGS="-f --listen-mode=666"
[ -z "$GVMD_USER" ] && GVMD_USER="gvmd"
[ -z "$PGRES_DATA" ] && PGRES_DATA="/var/lib/postgresql"

Expand Down Expand Up @@ -49,6 +49,4 @@ gvmd --modify-setting 78eceaec-3385-11ea-b237-28d24461215b --value "$uid"

echo "starting gvmd"
gvmd $GVMD_ARGS ||
(cat /var/log/gvm/gvmd.log && exit 1)

tail -f /var/log/gvm/gvmd.log
(echo "Starting gvmd failed" && exit 1)
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Configure and run tests
run: CTEST_OUTPUT_ON_FAILURE=1 cmake --build build -- tests test
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: build/coverage/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
40 changes: 21 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cmake_minimum_required (VERSION 3.0)
message ("-- Configuring Greenbone Vulnerability Manager...")

project (gvm
VERSION 23.10.1
VERSION 24.1.3
LANGUAGES C)

if (POLICY CMP0005)
Expand Down Expand Up @@ -103,7 +103,7 @@ include (CPack)

set (GVMD_DATABASE_VERSION 256)

set (GVMD_SCAP_DATABASE_VERSION 21)
set (GVMD_SCAP_DATABASE_VERSION 22)

set (GVMD_CERT_DATABASE_VERSION 8)

Expand Down Expand Up @@ -163,11 +163,13 @@ if (NOT GVMD_STATE_DIR)
set (GVMD_STATE_DIR "${GVM_STATE_DIR}/gvmd")
endif (NOT GVMD_STATE_DIR)

if (NOT GVM_LOG_DIR)
set (GVM_LOG_DIR "${LOCALSTATEDIR}/log/gvm")
else (NOT GVM_LOG_DIR)
set (GVM_LOG_DIR "${GVM_LOG_DIR}")
endif (NOT GVM_LOG_DIR)
if (NOT GVMD_LOG_FILE)
if (GVM_LOG_DIR)
set (GVMD_LOG_FILE "${GVM_LOG_DIR}/gvmd.log")
else (GVM_LOG_DIR)
set (GVMD_LOG_FILE "-")
endif (GVM_LOG_DIR)
endif (NOT GVMD_LOG_FILE)

set (GVM_SCAP_RES_DIR "${GVM_DATA_DIR}/scap")
set (GVM_CERT_RES_DIR "${GVM_DATA_DIR}/cert")
Expand Down Expand Up @@ -247,25 +249,25 @@ if (NOT CVSS3_RATINGS)
endif (NOT CVSS3_RATINGS)
add_definitions (-DCVSS3_RATINGS=${CVSS3_RATINGS})

if (NOT COMPLIANCE_REPORTS)
set (COMPLIANCE_REPORTS 1)
endif (NOT COMPLIANCE_REPORTS)
add_definitions (-DCOMPLIANCE_REPORTS=${COMPLIANCE_REPORTS})
if (CVSS3_RATINGS EQUAL 1)
set(IF_CVSS3_RATINGS "")
set(ENDIF_CVSS3_RATINGS "")
set(IF_NOT_CVSS3_RATINGS "<!--")
set(ENDIF_NOT_CVSS3_RATINGS "-->")
elseif (CVSS3_RATINGS EQUAL 0)
set(IF_CVSS3_RATINGS "<!--")
set(ENDIF_CVSS3_RATINGS "-->")
set(IF_NOT_CVSS3_RATINGS "")
set(ENDIF_NOT_CVSS3_RATINGS "")
endif()

message ("-- Install prefix: ${CMAKE_INSTALL_PREFIX}")
message ("-- Log file: ${GVMD_LOG_FILE}")

## Version

set (GVMD_VERSION "${PROJECT_VERSION_STRING}")

if (COMPLIANCE_REPORTS EQUAL 1)
set(IF_COMPLIANCE_REPORTS "")
set(ENDIF_COMPLIANCE_REPORTS "")
elseif (COMPLIANCE_REPORTS EQUAL 0)
set(IF_COMPLIANCE_REPORTS "<!--")
set(ENDIF_COMPLIANCE_REPORTS "-->")
endif()

# Configure Doxyfile with version number
configure_file (doc/Doxyfile.in doc/Doxyfile)
configure_file (doc/Doxyfile_full.in doc/Doxyfile_full)
Expand Down
3 changes: 1 addition & 2 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


if (NOT SYSTEMD_SERVICE_DIR)
set (SYSTEMD_SERVICE_DIR "/lib/systemd/system")
set (SYSTEMD_SERVICE_DIR "${LIBDIR}/systemd/system")
endif (NOT SYSTEMD_SERVICE_DIR)

if (NOT LOGROTATE_DIR)
Expand Down
Loading

0 comments on commit dc12806

Please sign in to comment.