From nobody Tue Sep 26 15:25:33 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rw3Tn4w06z4vHJg; Tue, 26 Sep 2023 15:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rw3Tn4SF5z4SgS; Tue, 26 Sep 2023 15:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695741933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qy0RII1/0R9yYaw5RgKfVTHNKqCu2wXhPfZI+ooGDh0=; b=dJuSCxlbo+2tg+oGHRmCwHmM3k0y1JKfwUH1OZw5i5/7GHupcsPzpVXwgEsBiXT8/68jKW /JhYQle8wOfHKELAyCruMKrUgQtY+fQuToOIOyDkUfOjQu21Zd0fRTikguSCpQHGN57+15 rYjN8gLqyX2f8ioYUBulvW5scJ+UXT+VY5zjspsM3tch/g9phNr8BK+EgzG4G8RfLxv3sV j5MwfpVoreZCFAB8PENXppBN3nKBxzbNmjtjYeczCW5dk1Zrcj2HO8k8ZxEHiO3Y3Bo1PR KcnPF1lP7PHVoqOQBm0aCprExD+SI0ZTtqX7X2lo2+PjN+DUsknETagltJUfew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695741933; a=rsa-sha256; cv=none; b=I9Rab4s2LQHQDlJYHgwuqFuuy6BcpZZCZ90ekvYELz3IiALVb+CM/lKx34YcYKOHAtohO+ ThpHdpqvLbxYDsCXI5hkznbFpEU3Faz25N7DJBcEzARXsuRLSB0lfdMbk+yYIVmDQET/n9 K1uf6NOBBFwV23DSUksNOq+B+DJd+QRuWJ4NK9qDOPtri6Drq5w78ui9vWuFUB3e1AdJX9 Lp8yh10PocUFvTJVanKAB4bVCKMpqFruIQ968EC0xwL9P688ekI0ZYNlHHOnuukakx6aBO 26ImrbzXKXPlYC4YAzI7nGjhdx240EZKRacTKYD8o/XvYakd6gOiJ3tM3l9kdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695741933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qy0RII1/0R9yYaw5RgKfVTHNKqCu2wXhPfZI+ooGDh0=; b=hOBfmtqMZcChEGZc0Hs4by4q+D7mDF8tANlA0ub/7w673pz/drlLl+jcTGgQjLiPboQpDN /ltoBkr2EoFqMQDDmNJGvhuue2i8wvrxu1iGBKWAbK3ZKT9KRHwnza4Jn1a9ngvydzHOMt qMZHocGXHI35WKiwRU//EU6eqA+YXqtWziMCrIMP1xXEjdSF4zZVtO2FROgDcRk5z7C2uD t0ycKvzp7WQnDEQAyPEsWfNLj1Q7bbMElt4CCngVrvg8LZ3H775woJ+Rc6gwYHwiJdJ6vH ZPIVUZRAKAXshcgCcdbP149WGxnSNIxSP4InZNHNYke1p1ViUVQjQpgQlrd0qA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rw3Tn3Vwwz12HB; Tue, 26 Sep 2023 15:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38QFPXTJ085085; Tue, 26 Sep 2023 15:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38QFPX4q085082; Tue, 26 Sep 2023 15:25:33 GMT (envelope-from git) Date: Tue, 26 Sep 2023 15:25:33 GMT Message-Id: <202309261525.38QFPX4q085082@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dan Langille Subject: git: 67e1373470a6 - main - net-mgmt/icingadb: Add new port List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dvl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67e1373470a6751d7843cdbba88e13facb43acac Auto-Submitted: auto-generated The branch main has been updated by dvl: URL: https://cgit.FreeBSD.org/ports/commit/?id=67e1373470a6751d7843cdbba88e13facb43acac commit 67e1373470a6751d7843cdbba88e13facb43acac Author: Dan Langille AuthorDate: 2023-09-26 15:19:52 +0000 Commit: Dan Langille CommitDate: 2023-09-26 15:22:01 +0000 net-mgmt/icingadb: Add new port Publish, synchronize, and visualize Icinga data https://icinga.com/docs/icinga-db/latest/doc/02-Installation/ --- net-mgmt/Makefile | 1 + net-mgmt/icingadb/Makefile | 48 +++++++++++++++++++ net-mgmt/icingadb/distinfo | 7 +++ net-mgmt/icingadb/files/icingadb.in | 55 ++++++++++++++++++++++ net-mgmt/icingadb/files/patch-pkg_config_config.go | 11 +++++ net-mgmt/icingadb/pkg-descr | 11 +++++ net-mgmt/icingadb/pkg-plist | 8 ++++ 7 files changed, 141 insertions(+) diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 0c7b72eec009..19f98aed89f7 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -87,6 +87,7 @@ SUBDIR += icinga-php-library SUBDIR += icinga-php-thirdparty SUBDIR += icinga2 + SUBDIR += icingadb SUBDIR += icingaweb2 SUBDIR += icingaweb2-module-businessprocess SUBDIR += icingaweb2-module-cube diff --git a/net-mgmt/icingadb/Makefile b/net-mgmt/icingadb/Makefile new file mode 100644 index 000000000000..2bf4a417406a --- /dev/null +++ b/net-mgmt/icingadb/Makefile @@ -0,0 +1,48 @@ +PORTNAME= icingadb +DISTVERSIONPREFIX= v +DISTVERSION= 1.1.1 +PORTREVISION= 5 +CATEGORIES= net-mgmt + +MAINTAINER= dvl@FreeBSD.org +COMMENT= Publish, synchronize, and visualize Icinga data +WWW= https://icinga.com/docs/icinga-db/latest/doc/02-Installation/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go:modules + +USE_RC_SUBR= icingadb + +PLIST_SUB= PORTNAME=${PORTNAME} + +# As copied from net-mgmt/icinga2 +ICINGA2USER?= icinga +ICINGA2GROUP?= icinga +USERS= ${ICINGA2USER} +GROUPS= ${ICINGA2GROUP} + +SUB_LIST= ICINGA2GROUP=${ICINGA2GROUP} \ + ICINGA2USER=${ICINGA2USER} + +USE_GITHUB= yes +GH_ACCOUNT= Icinga +GH_PROJECT= icingadb + +GO_MODULE= github.com/icinga/icingadb +GO_TARGET= ./cmd/icingadb + +SUB_LIST+= ICINGA2USER=${ICINGA2USER} \ + PREFIX=${PREFIX} + +post-patch: + @${REINPLACE_CMD} -e 's|%%PREFIX|${PREFIX}|g' ${WRKSRC}/pkg/config/config.go + +post-install: + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${MKDIR} ${STAGEDIR}${ETCDIR} + (cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) + ${INSTALL_DATA} ${WRKSRC}/config.example.yml ${STAGEDIR}${ETCDIR}/config.yml.sample + +.include diff --git a/net-mgmt/icingadb/distinfo b/net-mgmt/icingadb/distinfo new file mode 100644 index 000000000000..29e6472e8ee5 --- /dev/null +++ b/net-mgmt/icingadb/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1694197114 +SHA256 (go/net-mgmt_icingadb/Icinga-icingadb-v1.1.1_GH0/v1.1.1.mod) = a1c31eb3ce2da460c847b048f5020a1707273df2d46169f37511de4cee9b5685 +SIZE (go/net-mgmt_icingadb/Icinga-icingadb-v1.1.1_GH0/v1.1.1.mod) = 1508 +SHA256 (go/net-mgmt_icingadb/Icinga-icingadb-v1.1.1_GH0/v1.1.1.zip) = 7988ae8a59b5904a461b922bb50d35c9e1ebd5e659486d40425f01594fc2a21c +SIZE (go/net-mgmt_icingadb/Icinga-icingadb-v1.1.1_GH0/v1.1.1.zip) = 3872935 +SHA256 (go/net-mgmt_icingadb/Icinga-icingadb-v1.1.1_GH0/Icinga-icingadb-v1.1.1_GH0.tar.gz) = 8f4246765dc364917170905e38b01c62a6c44eab7d333c131fc46691a47c150a +SIZE (go/net-mgmt_icingadb/Icinga-icingadb-v1.1.1_GH0/Icinga-icingadb-v1.1.1_GH0.tar.gz) = 3868785 diff --git a/net-mgmt/icingadb/files/icingadb.in b/net-mgmt/icingadb/files/icingadb.in new file mode 100644 index 000000000000..ab55bbfa3f37 --- /dev/null +++ b/net-mgmt/icingadb/files/icingadb.in @@ -0,0 +1,55 @@ +#!/bin/sh + +# PROVIDE: icingadb +# REQUIRE: SERVERS mysql postgresql +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# icingadb_enable: Set to NO by default. +# Set it to YES to enable icingadb +# icingadb_user: The user account used to run the daemon. +# Default: %%ICINGA2USER%% +# icingadb_group: The group account used to run the daemon. +# Default: %%ICINGA2GROUP%% +# + +. /etc/rc.subr + +name=icingadb +rcvar="${name}_enable" + +load_rc_config $name + +: ${icingadb_enable:="NO"} +: ${icingadb_user:="%%ICINGA2USER%%"} +: ${icingadb_group:="%%ICINGA2GROUP%%"} + +icingadb_pid="/var/run/icingadb/icingadb.pid" +icingadb_logfile="/var/log/icinga2/$name.log" +icingadb_daemonflags="-o ${icingadb_logfile}" + +pidfile="$icingadb_pid" +command="/usr/sbin/daemon" + +start_precmd=icingadb_precmd + +icingadb_precmd() +{ + [ -f ${icingadb_logfile} ] || install -g $icingadb_group -o $icingadb_user -m 644 /dev/null ${icingadb_logfile} + + if [ ! -d "/var/run/icingadb" ]; then + install -d -o ${icingadb_user} -g ${icingadb_group} -m 0775 "/var/run/icingadb" + fi + if [ ! -e ${pidfile} ]; then + install -o ${icingadb_user} -g ${icingadb_group} /dev/null ${pidfile}; + else + chown ${icingadb_user}:${icingadb_group} ${pidfile}; + fi + +} + +command_args="$icingadb_daemonflags -P $pidfile -t ${name} -T ${name} %%PREFIX%%/bin/$name -c %%PREFIX%%/etc/icingadb/config.yml" + +run_rc_command "$1" diff --git a/net-mgmt/icingadb/files/patch-pkg_config_config.go b/net-mgmt/icingadb/files/patch-pkg_config_config.go new file mode 100644 index 000000000000..1b5b0066118c --- /dev/null +++ b/net-mgmt/icingadb/files/patch-pkg_config_config.go @@ -0,0 +1,11 @@ +--- pkg/config/config.go.orig 2023-09-08 17:19:58 UTC ++++ pkg/config/config.go +@@ -46,7 +46,7 @@ type Flags struct { + // Version decides whether to just print the version and exit. + Version bool `long:"version" description:"print version and exit"` + // Config is the path to the config file +- Config string `short:"c" long:"config" description:"path to config file" required:"true" default:"/etc/icingadb/config.yml"` ++ Config string `short:"c" long:"config" description:"path to config file" required:"true" default:"%%PREFIX%%/etc/icinga2/icingadb.yml"` + } + + // FromYAMLFile returns a new Config value created from the given YAML config file. diff --git a/net-mgmt/icingadb/pkg-descr b/net-mgmt/icingadb/pkg-descr new file mode 100644 index 000000000000..44543ed68c3c --- /dev/null +++ b/net-mgmt/icingadb/pkg-descr @@ -0,0 +1,11 @@ +Icinga DB is a set of components for publishing, synchronizing and visualizing +monitoring data in the Icinga ecosystem, consisting of: + +* Icinga DB Web which connects to both a Redis server and a database to view and + work with most up-to-date monitoring data +* Icinga 2 with its Icinga DB feature enabled, responsible for publishing the + data to the Redis server, i.e. configuration and its runtime updates, check + results, state changes, downtimes, acknowledgements, notifications, and other + events such as flapping +* And the Icinga DB daemon, which synchronizes the data between the Redis server + and the database diff --git a/net-mgmt/icingadb/pkg-plist b/net-mgmt/icingadb/pkg-plist new file mode 100644 index 000000000000..dd7f07a70e47 --- /dev/null +++ b/net-mgmt/icingadb/pkg-plist @@ -0,0 +1,8 @@ +bin/%%PORTNAME%% +@sample(root,wheel,0640) etc/%%PORTNAME%%/config.yml.sample +%%EXAMPLESDIR%%/schema/pgsql/upgrades/1.1.1.sql +%%EXAMPLESDIR%%/schema/pgsql/schema.sql +%%EXAMPLESDIR%%/schema/mysql/schema.sql +%%EXAMPLESDIR%%/schema/mysql/upgrades/1.1.1.sql +%%EXAMPLESDIR%%/schema/mysql/upgrades/1.0.0.sql +%%EXAMPLESDIR%%/schema/mysql/upgrades/1.0.0-rc2.sql