public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Florian Schmaus" <flow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/gvmd/, net-analyzer/gvmd/files/
Date: Mon,  9 May 2022 12:07:23 +0000 (UTC)	[thread overview]
Message-ID: <1652098036.123dc0e869f647b8d0009e5fdd2152a74ec11227.flow@gentoo> (raw)

commit:     123dc0e869f647b8d0009e5fdd2152a74ec11227
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Mon May  9 11:50:33 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Mon May  9 12:07:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=123dc0e8

net-analyzer/gvmd: fix LICENSE, gvm-sync-all helper, GVM_DEFAULT_DROP_USER

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-analyzer/gvmd/files/gvm-sync-all               | 31 ++++++++++++++++++++++
 net-analyzer/gvmd/files/gvm-sync-all.service       |  7 +++++
 net-analyzer/gvmd/files/gvm-sync-all.timer         |  9 +++++++
 ...gvmd-21.4.5-r3.ebuild => gvmd-21.4.5-r4.ebuild} |  6 ++++-
 4 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/net-analyzer/gvmd/files/gvm-sync-all b/net-analyzer/gvmd/files/gvm-sync-all
new file mode 100644
index 000000000000..d12b860e7fcb
--- /dev/null
+++ b/net-analyzer/gvmd/files/gvm-sync-all
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+case ${USER} in
+    root)
+        exec su --shell /bin/bash --command "$0 $@" gvm
+        ;;
+    gvm)
+        ;;
+    *)
+        >&2 echo "Must be run as root or gvm user not ${USER}"
+        exit 1
+        ;;
+esac
+
+while getopts d OPTION "$@"; do
+        case ${OPTION} in
+                d)
+                        set -x
+                        ;;
+        esac
+done
+shift $((OPTIND - 1))
+
+greenbone-nvt-sync
+# Note that Greenbone recommends to sync CERT *after* SCAP, as the
+# former depends on the later. See
+# https://github.com/greenbone/gvmd/blob/main/INSTALL.md#keeping-the-feeds-up-to-date
+for FEED_TYPE in SCAP CERT GVMD_DATA; do
+    greenbone-feed-sync --type ${FEED_TYPE}
+done

diff --git a/net-analyzer/gvmd/files/gvm-sync-all.service b/net-analyzer/gvmd/files/gvm-sync-all.service
new file mode 100644
index 000000000000..a82e2950f3fd
--- /dev/null
+++ b/net-analyzer/gvmd/files/gvm-sync-all.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Update all feeds of the Greenbone Vulerability Management (GMV) suite
+After=network-online.target
+
+[Service]
+ExecStart=/usr/sbin/gvm-sync-all
+User=gvm

diff --git a/net-analyzer/gvmd/files/gvm-sync-all.timer b/net-analyzer/gvmd/files/gvm-sync-all.timer
new file mode 100644
index 000000000000..9faf470e013c
--- /dev/null
+++ b/net-analyzer/gvmd/files/gvm-sync-all.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Daily update of all feeds of the Greenbone Vulerability Management (GMV) suite
+
+[Timer]
+OnCalendar=daily
+RandomizedDelaySec=2hour
+
+[Install]
+WantedBy=timers.target

diff --git a/net-analyzer/gvmd/gvmd-21.4.5-r3.ebuild b/net-analyzer/gvmd/gvmd-21.4.5-r4.ebuild
similarity index 95%
rename from net-analyzer/gvmd/gvmd-21.4.5-r3.ebuild
rename to net-analyzer/gvmd/gvmd-21.4.5-r4.ebuild
index ea09acaeeeb5..5b5e6ab83497 100644
--- a/net-analyzer/gvmd/gvmd-21.4.5-r3.ebuild
+++ b/net-analyzer/gvmd/gvmd-21.4.5-r4.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://www.greenbone.net https://github.com/greenbone/gvmd/"
 SRC_URI="https://github.com/greenbone/gvmd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
 
 SLOT="0"
-LICENSE="GPL-2+"
+LICENSE="AGPL-3+"
 KEYWORDS="~amd64 ~x86"
 IUSE="doc test"
 RESTRICT="!test? ( test )"
@@ -87,6 +87,7 @@ src_configure() {
 		"-DLIBDIR=${EPREFIX}/usr/$(get_libdir)"
 		"-DSBINDIR=${EPREFIX}/usr/bin"
 		"-DSYSTEMD_SERVICE_DIR=$(systemd_get_systemunitdir)"
+		"-DGVM_DEFAULT_DROP_USER=gvm"
 	)
 	cmake_src_configure
 }
@@ -123,4 +124,7 @@ src_install() {
 	if ! use prefix; then
 		fowners -R gvm:gvm /var/lib/gvm
 	fi
+
+	dosbin "${FILESDIR}"/gvm-sync-all
+	systemd_dounit "${FILESDIR}"/gvm-sync-all.{service,timer}
 }


             reply	other threads:[~2022-05-09 12:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 12:07 Florian Schmaus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-14  7:53 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/gvmd/, net-analyzer/gvmd/files/ Florian Schmaus
2023-10-07 15:11 Florian Schmaus
2023-08-11  9:08 Florian Schmaus
2022-05-10 19:54 Florian Schmaus
2022-05-02 14:26 Florian Schmaus
2021-01-21  7:14 Joonas Niilola
2020-10-28  7:51 Joonas Niilola
2020-03-25 13:46 Joonas Niilola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1652098036.123dc0e869f647b8d0009e5fdd2152a74ec11227.flow@gentoo \
    --to=flow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox