Initial Commit

This commit is contained in:
Markus Pesch 2023-06-05 22:49:25 +02:00
commit 2bd9a04ce9
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
5 changed files with 84 additions and 0 deletions

20
.SRCINFO Normal file
View File

@ -0,0 +1,20 @@
pkgbase = prometheus-fail2ban-exporter
pkgdesc = Fail2Ban exporter for Fail2Ban metrics
pkgver = 0.7.2
pkgrel = 1
url = https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
arch = x86_64
license = MIT
makedepends = go
optdepends = fail2ban: for monitoring a local fail2ban daemon
source = https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/archive/0.7.2/fail2ban-prometheus-exporter-0.7.2.tar.gz
source = systemd.service
source = sysusers.conf
sha512sums = b7691cc31c747965b8ac9e8f818d4411b716888be5c84c51bbe5e206022bf9b60f95abddc37c8011a412a40ba0665107e957a55b3acba5018fd5be85c442380e
sha512sums = 35747b143d7aed606ce25673061603d6c5b1623fb86c180aaa0a23f6afde26f4d2cde99d05cc1cc7fd7d8ccacbb6d3413cfcfcc3f26f7530d1f0d9151877b4d1
sha512sums = c070f57c58f367421835fe757b6b46e4c6cc3a69e0e927b10c229daab945fc52e57acdf25a84f04f752cb7304c40c2ff95e7987daf41c80f8857d409def1752f
b2sums = 87ab07b334594ecb792d817abb9bca1c7565be64df79d6dfa5edd268241534345a9e7e5b782dfcfd623d6a63db77b8803c614e44c3d44f9b7ca6b41952c6eb20
b2sums = a4ff2f3da50e353f8cfdca96de54a5fa83a2bcd12cf7a7c873b4cf4a55e745e35593b0d13a77edd6ade51ce582c6001d2241bd20491269538880e2b9e0816181
b2sums = 4b731a290e1ad967f9e7708b00d4b9279bdbc57461c62d09a8bff00958e72cb8e69848d73af486bcc9e58ffe1e087ca86dc2625770a25ebd47e41d7bba193bef
pkgname = prometheus-fail2ban-exporter

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
pkg
src
*tar.gz*
*tar.zst*

41
PKGBUILD Normal file
View File

@ -0,0 +1,41 @@
# Maintainer: Markus Pesch <markus.pesch plus apps at cryptic.systems>
pkgname=prometheus-fail2ban-exporter
_pkgname=fail2ban-prometheus-exporter
pkgver=0.7.2
pkgrel=1
pkgdesc="Fail2Ban exporter for Fail2Ban metrics"
arch=('x86_64')
url="https://gitlab.com/hectorjsmith/$_pkgname"
license=('MIT')
makedepends=('go')
optdepends=('fail2ban: for monitoring a local fail2ban daemon')
source=(
"$url/-/archive/$pkgver/$_pkgname-$pkgver.tar.gz"
'systemd.service'
'sysusers.conf'
)
sha512sums=('b7691cc31c747965b8ac9e8f818d4411b716888be5c84c51bbe5e206022bf9b60f95abddc37c8011a412a40ba0665107e957a55b3acba5018fd5be85c442380e'
'35747b143d7aed606ce25673061603d6c5b1623fb86c180aaa0a23f6afde26f4d2cde99d05cc1cc7fd7d8ccacbb6d3413cfcfcc3f26f7530d1f0d9151877b4d1'
'c070f57c58f367421835fe757b6b46e4c6cc3a69e0e927b10c229daab945fc52e57acdf25a84f04f752cb7304c40c2ff95e7987daf41c80f8857d409def1752f')
b2sums=('87ab07b334594ecb792d817abb9bca1c7565be64df79d6dfa5edd268241534345a9e7e5b782dfcfd623d6a63db77b8803c614e44c3d44f9b7ca6b41952c6eb20'
'a4ff2f3da50e353f8cfdca96de54a5fa83a2bcd12cf7a7c873b4cf4a55e745e35593b0d13a77edd6ade51ce582c6001d2241bd20491269538880e2b9e0816181'
'4b731a290e1ad967f9e7708b00d4b9279bdbc57461c62d09a8bff00958e72cb8e69848d73af486bcc9e58ffe1e087ca86dc2625770a25ebd47e41d7bba193bef')
build() {
cd "$_pkgname-$pkgver/src"
go build -v \
-buildmode=pie \
-trimpath \
-o fail2ban-exporter .
}
package() {
# systemd integration
install -Dm644 systemd.service "$pkgdir/usr/lib/systemd/system/fail2ban-exporter.service"
install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/fail2ban-exporter.conf"
# binary
install -D --mode 0755 --target-directory "$pkgdir/usr/bin" "$_pkgname-$pkgver/src/fail2ban-exporter"
install -D --mode 0755 --target-directory "$pkgdir/usr/share/licenses/$pkgname" "$_pkgname-$pkgver/LICENSE"
}

17
systemd.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description=Prometheus exporter for fail2ban metrics
Requires=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/fail2ban-exporter
ExecReload=/bin/kill -HUP $MAINPID
User=root
Group=root
Restart=on-failure
RestartSec=5s
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target

1
sysusers.conf Normal file
View File

@ -0,0 +1 @@
u fail2ban-exporter - "Prometheus fail2ban exporter user"