summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO26
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD42
-rw-r--r--prometheus-xmpp-webhook-sysusers.conf1
-rw-r--r--prometheus-xmpp-webhook.install7
-rw-r--r--xmpp-webhook.env3
-rw-r--r--xmpp-webhook.service.patch23
7 files changed, 108 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..63bd4bb7d2e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = prometheus-xmpp-webhook-bin
+ pkgdesc = XMPP-Webhook built for Prometheus/Grafana Alerts
+ pkgver = 0.2
+ pkgrel = 0
+ url = https://github.com/opthomas-prime/xmpp-webhook
+ install = prometheus-xmpp-webhook.install
+ arch = x86_64
+ license = mit
+ depends = glibc
+ optdepends = grafana: use the webhook with Grafana alerts
+ optdepends = alertmanager: use the webhook with Prometheus
+ optdepends = prometheus: use the webhook with Prometheus
+ backup = etc/xmpp-webhook.env
+ source = prometheus-xmpp-webhook-sysusers.conf
+ source = prometheus-xmpp-webhook.install
+ source = xmpp-webhook.env
+ source = xmpp-webhook.service.patch
+ source = https://github.com/opthomas-prime/xmpp-webhook/releases/download/0.2/xmpp-webhook-0.2.tar
+ sha256sums = 691af96667e6eb627512f038c5f2f7b3928edc586f27aecad37f3957437a3f6a
+ sha256sums = 0ec7e2fb1d5d843174718b922a8bb931098c0c5a7154cf5f50aa43af24717860
+ sha256sums = e97efa5c6d3f7f4e970a84220cd73fbc0fb8e213623c4c44652f3c57d348e2a4
+ sha256sums = a2938e74de29c13ee08f5dad3fc8b2c4b618ec90a85ca8e95a4470f87f8af4f7
+ sha256sums = e7939c95276430e80b191f37a46402c12c7a3546c17b11cafb0f3f238d84de24
+
+pkgname = prometheus-xmpp-webhook-bin
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..3242aa93967
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+pkg/
+src/
+*.tar
+*.tar.gz
+*.tar.xz
+*.zip
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..10617a10aac
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Sam Whited <sam@samwhited.com>
+
+pkgname=prometheus-xmpp-webhook-bin
+pkgver=0.2
+pkgrel=0
+pkgdesc='XMPP-Webhook built for Prometheus/Grafana Alerts'
+arch=('x86_64')
+url='https://github.com/opthomas-prime/xmpp-webhook'
+license=('mit')
+depends=('glibc')
+optdepends=('grafana: use the webhook with Grafana alerts'
+ 'alertmanager: use the webhook with Prometheus'
+ 'prometheus: use the webhook with Prometheus')
+backup=('etc/xmpp-webhook.env')
+install=prometheus-xmpp-webhook.install
+source=('prometheus-xmpp-webhook-sysusers.conf'
+ 'prometheus-xmpp-webhook.install'
+ 'xmpp-webhook.env'
+ 'xmpp-webhook.service.patch'
+ "https://github.com/opthomas-prime/xmpp-webhook/releases/download/${pkgver}/xmpp-webhook-${pkgver}.tar")
+sha256sums=('691af96667e6eb627512f038c5f2f7b3928edc586f27aecad37f3957437a3f6a'
+ '0ec7e2fb1d5d843174718b922a8bb931098c0c5a7154cf5f50aa43af24717860'
+ 'e97efa5c6d3f7f4e970a84220cd73fbc0fb8e213623c4c44652f3c57d348e2a4'
+ 'a2938e74de29c13ee08f5dad3fc8b2c4b618ec90a85ca8e95a4470f87f8af4f7'
+ 'e7939c95276430e80b191f37a46402c12c7a3546c17b11cafb0f3f238d84de24')
+
+prepare() {
+ patch -p1 xmpp-webhook.service xmpp-webhook.service.patch
+}
+
+package() {
+ install -dm775 "${pkgdir}"/usr/share/licenses/prometheus-xmpp-webhook
+ install -Dm644 THIRD-PARTY-NOTICES -t "${pkgdir}"/usr/share/licenses/prometheus-xmpp-webhook
+ install -Dm644 xmpp-webhook.service -t "${pkgdir}"/usr/lib/systemd/system/
+ install -Dm755 xmpp-webhook "${pkgdir}"/usr/bin/xmpp-webhook
+ install -Dm644 prometheus-xmpp-webhook-sysusers.conf "${pkgdir}"/usr/lib/sysusers.d/prometheus-xmpp-webhook.conf
+
+ # -o xmppwebhook -g xmppwebhook
+ install -Dm640 xmpp-webhook.env -t "${pkgdir}"/etc/
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/prometheus-xmpp-webhook-sysusers.conf b/prometheus-xmpp-webhook-sysusers.conf
new file mode 100644
index 00000000000..991205d6004
--- /dev/null
+++ b/prometheus-xmpp-webhook-sysusers.conf
@@ -0,0 +1 @@
+u xmppwebhook - "xmpp webhook for Prometheus and Grafana" - -
diff --git a/prometheus-xmpp-webhook.install b/prometheus-xmpp-webhook.install
new file mode 100644
index 00000000000..986d4898ba0
--- /dev/null
+++ b/prometheus-xmpp-webhook.install
@@ -0,0 +1,7 @@
+post_install() {
+ chown -R xmppwebhook:xmppwebhook /etc/xmpp-webhook.env
+
+ echo "Configure using environment variables in /etc/xmpp-webhook.env"
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/xmpp-webhook.env b/xmpp-webhook.env
new file mode 100644
index 00000000000..3cfc46f4101
--- /dev/null
+++ b/xmpp-webhook.env
@@ -0,0 +1,3 @@
+# XMPP_ID=
+# XMPP_PASS=
+# XMPP_RECEIVERS=
diff --git a/xmpp-webhook.service.patch b/xmpp-webhook.service.patch
new file mode 100644
index 00000000000..90412307273
--- /dev/null
+++ b/xmpp-webhook.service.patch
@@ -0,0 +1,23 @@
+5a6,8
+> User=xmppwebhook
+> Group=xmppwebhook
+> Type=simple
+7c10
+< ExecStart=/usr/local/bin/xmpp-webhook
+---
+> ExecStart=/usr/bin/xmpp-webhook
+9c12,23
+< RestartSec=30
+---
+> RestartSec=30s
+> NoNewPrivileges=true
+> PrivateUsers=true
+> PrivateDevices=true
+> PrivateTmp=true
+> ProtectHome=true
+> ProtectSystem=strict
+> ProtectControlGroups=yes
+> ProtectKernelTunables=true
+> ProtectKernelModules=yes
+> LockPersonality=true
+> MemoryDenyWriteExecute=true