www-apps/karma-bin: Alert dashboard for the Prometheus Alertmanager
authorWilliam Hubbs <william.hubbs@sony.com>
Fri, 8 Feb 2019 22:57:06 +0000 (16:57 -0600)
committerWilliam Hubbs <williamh@gentoo.org>
Fri, 8 Feb 2019 22:58:30 +0000 (16:58 -0600)
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: William Hubbs <williamh@gentoo.org>
www-apps/karma-bin/Manifest [new file with mode: 0644]
www-apps/karma-bin/files/karma-0.24.yaml [new file with mode: 0644]
www-apps/karma-bin/files/karma.initd [new file with mode: 0644]
www-apps/karma-bin/karma-bin-0.24.ebuild [new file with mode: 0644]
www-apps/karma-bin/metadata.xml [new file with mode: 0644]

diff --git a/www-apps/karma-bin/Manifest b/www-apps/karma-bin/Manifest
new file mode 100644 (file)
index 0000000..6a8d567
--- /dev/null
@@ -0,0 +1 @@
+DIST karma-bin-0.24-amd64.tar.gz 11511588 BLAKE2B 4de38f4925e039ae28e160d2f541cb8b92388b42c68b3f00ca1a4aced635078a5f8bfabe63fe20dcb05a5a75188b2a866b627a26fd68d43de5f0c21a97a28160 SHA512 2864eac54be7f156f4b8feb144825615576e7f18f61f58d3e3834e9968a59a0373d0b156a0f00c5c019b922b251f8a7f35a41f139fbf42c27c562a74af33f14d
diff --git a/www-apps/karma-bin/files/karma-0.24.yaml b/www-apps/karma-bin/files/karma-0.24.yaml
new file mode 100644 (file)
index 0000000..38b2dd3
--- /dev/null
@@ -0,0 +1,55 @@
+alertmanager:
+  interval: 60s
+  servers:
+    - name: local
+      uri: http://localhost:9093
+      timeout: 10s
+      proxy: true
+      headers:
+        X-Auth-Test: some-token-or-other-string
+    - name: client-auth
+      uri: https://localhost:9093
+      timeout: 10s
+      tls:
+        ca: /etc/ssl/certs/ca-bundle.crt
+        cert: /etc/karma/client.pem
+        key: /etc/karma/client.key
+annotations:
+  default:
+    hidden: false
+  hidden:
+    - help
+  visible: []
+custom:
+  css: /custom.css
+  js: /custom.js
+debug: false
+filters:
+  default:
+    - "@receiver=by-cluster-service"
+labels:
+  color:
+    static:
+      - job
+    unique:
+      - cluster
+      - instance
+      - "@receiver"
+  keep: []
+  strip: []
+listen:
+  address: "0.0.0.0"
+  port: 8080
+  prefix: /
+log:
+  config: false
+  level: info
+jira:
+  - regex: DEVOPS-[0-9]+
+    uri: https://jira.example.com
+receivers:
+  keep: []
+  strip: []
+sentry:
+  private: secret
+  public: 123456789
diff --git a/www-apps/karma-bin/files/karma.initd b/www-apps/karma-bin/files/karma.initd
new file mode 100644 (file)
index 0000000..08dbc3b
--- /dev/null
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 2018-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/bin/karma
+command_args="--config.file /etc/karma/karma.yaml ${command_args}"
+command_background=yes
+command_group=karma
+command_user=karma
+error_log=/var/log/karma/karma.log
+output_log=/var/log/karma/karma.log
+pidfile=/var/run/karma.pid
diff --git a/www-apps/karma-bin/karma-bin-0.24.ebuild b/www-apps/karma-bin/karma-bin-0.24.ebuild
new file mode 100644 (file)
index 0000000..215180c
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+MY_PN=${PN%-bin}
+
+inherit user
+
+DESCRIPTION="Alerts dashboard for Prometheus Alertmanager"
+HOMEPAGE="https://github.com/prymitive/karma"
+SRC_URI="https://github.com/prymitive/${MY_PN}/releases/download/v${PV}/${MY_PN}-linux-amd64.tar.gz -> ${P}-amd64.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+QA_PREBUILT="usr/bin/*"
+S="${WORKDIR}"
+
+pkg_setup() {
+       enewgroup ${MY_PN}
+       enewuser ${MY_PN} -1 -1 -1 ${MY_PN}
+}
+
+src_install() {
+       dobin karma-linux-amd64
+       dosym karma-linux-amd64 /usr/bin/karma
+       insinto /etc/${MY_PN}
+       newins "${FILESDIR}"/${MY_PN}-${PV}.yaml ${MY_PN}.yaml
+       newinitd "${FILESDIR}"/${MY_PN}.initd ${MY_PN}
+keepdir /var/log/${MY_PN}
+fowners ${MY_PN}:${MY_PN} /var/log/${MY_PN}
+}
+
+pkg_postinst() {
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               elog "Please edit ${EROOT}/etc/karma/karma.yaml to match your system."
+       fi
+}
diff --git a/www-apps/karma-bin/metadata.xml b/www-apps/karma-bin/metadata.xml
new file mode 100644 (file)
index 0000000..c36c371
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>williamh@gentoo.org</email>
+               <name>William Hubbs</name>
+       </maintainer>
+</pkgmetadata>