[arch-commits] Commit in (8 files)
Tim Meusel
bastelfreak at gemini.archlinux.org
Sun Aug 7 17:32:32 UTC 2022
Date: Sunday, August 7, 2022 @ 17:32:32
Author: bastelfreak
Revision: 1260565
add prometheus-wireguard-exporter
Added:
prometheus-wireguard-exporter/
prometheus-wireguard-exporter/repos/
prometheus-wireguard-exporter/trunk/
prometheus-wireguard-exporter/trunk/PKGBUILD
prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.conf
prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.install
prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.service
prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.sysusers
----------------------------------------+
PKGBUILD | 51 +++++++++++++++++++++++++++++++
prometheus-wireguard-exporter.conf | 1
prometheus-wireguard-exporter.install | 5 +++
prometheus-wireguard-exporter.service | 23 +++++++++++++
prometheus-wireguard-exporter.sysusers | 1
5 files changed, 81 insertions(+)
Added: prometheus-wireguard-exporter/trunk/PKGBUILD
===================================================================
--- prometheus-wireguard-exporter/trunk/PKGBUILD (rev 0)
+++ prometheus-wireguard-exporter/trunk/PKGBUILD 2022-08-07 17:32:32 UTC (rev 1260565)
@@ -0,0 +1,51 @@
+# Maintainer: Tim Meusel <tim at bastelfreak.de>
+pkgname=prometheus-wireguard-exporter
+pkgver=3.6.3
+pkgrel=1
+pkgdesc='A Prometheus exporter for WireGuard, written in Rust.'
+arch=('x86_64')
+license=('MIT')
+url='https://github.com/MindFlavor/prometheus_wireguard_exporter'
+source=("${pkgname}-${pkgver}.tar.gz::https://static.crates.io/crates/prometheus_wireguard_exporter/prometheus_wireguard_exporter-${pkgver}.crate"
+ 'prometheus-wireguard-exporter.service'
+ 'prometheus-wireguard-exporter.conf'
+ 'prometheus-wireguard-exporter.sysusers'
+ 'prometheus-wireguard-exporter.install'
+ )
+install='prometheus-wireguard-exporter.install'
+makedepends=(cargo)
+depends=(wireguard-tools)
+sha512sums=('9ff42deaf28a45be26cf0211b11878be873467bee0bdb128efec3c1a9d4f7214f53b74e8df6249212d07e5d8c16f2a183d4e6b0173ee23f41d872f4ccb2a1b82'
+ '9df12fd511a9a179351d46a9de1d439b72b7e9658ef2ae68d62e2ef9bbe6657707ff3aba36f45213caca1462a7bb85005b1ded2b924dbf40542ff930f0631155'
+ '63520a99e021d7eaa53b7ea8d832698f116507ccba6d322cd33005c43aa1d65179437c0320662ba99fefe4e9bf23457bc3360dba22a4ee79d261dd21c2ba8074'
+ '52c5e10f8d156efc18e1f44076023b36efb799d7446d016d07a9d8ff9480e49273878d1a460146d3300732f2a82e0608cbc5d4c04465640677d0a8b491368594'
+ 'fe8e41c85543a0e0d745aa57752f4139654547c9ae07cb4a8ac9d8679c8075f310bb0b6b73dc984cb52672b2416f364ce0371eaa16285e4ee3e576131f32f00c')
+
+prepare() {
+ cd "prometheus_wireguard_exporter-${pkgver}"
+ cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
+}
+
+build() {
+ cd "prometheus_wireguard_exporter-${pkgver}"
+ export RUSTUP_TOOLCHAIN=stable
+ export CARGO_TARGET_DIR=target
+ cargo build --frozen --release --all-features
+}
+
+check() {
+ cd "prometheus_wireguard_exporter-${pkgver}"
+ export RUSTUP_TOOLCHAIN=stable
+ cargo test --frozen --all-features
+}
+
+package() {
+ install -Dm644 prometheus-wireguard-exporter.service -t "${pkgdir}/usr/lib/systemd/system/"
+ install -Dm644 prometheus-wireguard-exporter.conf "$pkgdir/etc/conf.d/prometheus-wireguard-exporter"
+ install -Dm644 prometheus-wireguard-exporter.sysusers "${pkgdir}/usr/lib/sysusers.d/prometheus-wireguard-exporter.conf"
+
+ cd "prometheus_wireguard_exporter-${pkgver}"
+ install -Dm0755 'target/release/prometheus_wireguard_exporter' "$pkgdir/usr/bin/prometheus-wireguard-exporter"
+ install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+ install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}/"
+}
Added: prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.conf
===================================================================
--- prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.conf (rev 0)
+++ prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.conf 2022-08-07 17:32:32 UTC (rev 1260565)
@@ -0,0 +1 @@
+WIREGUARD_EXPORTER_ARGS="--prepend_sudo=true"
Added: prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.install
===================================================================
--- prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.install (rev 0)
+++ prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.install 2022-08-07 17:32:32 UTC (rev 1260565)
@@ -0,0 +1,5 @@
+post_install() {
+ echo "it is recommended to run the exporter as wireguard_exporter user, not as root"
+ echo "that requires a sudo rule"
+ echo "example: 'wireguard_exporter ALL=(root) NOPASSWD: /usr/bin/wg'"
+}
Added: prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.service
===================================================================
--- prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.service (rev 0)
+++ prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.service 2022-08-07 17:32:32 UTC (rev 1260565)
@@ -0,0 +1,23 @@
+[Unit]
+Description=Prometheus WireGuard Exporter
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+User=wireguard_exporter
+Group=wireguard_exporter
+Type=simple
+Restart=on-failure
+EnvironmentFile=-/etc/conf.d/prometheus-wireguard-exporter
+ExecStart=/usr/bin/prometheus-wireguard-exporter $WIREGUARD_EXPORTER_ARGS
+PrivateTmp=yes
+ProtectHome=yes
+ProtectControlGroups=yes
+UMask=077
+RemoveIPC=yes
+BindReadOnlyPaths=/dev/log /run/systemd/journal/socket /run/systemd/journal/stdout
+ProtectSystem=strict
+ProtectProc=noaccess
+
+[Install]
+WantedBy=multi-user.target
Added: prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.sysusers
===================================================================
--- prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.sysusers (rev 0)
+++ prometheus-wireguard-exporter/trunk/prometheus-wireguard-exporter.sysusers 2022-08-07 17:32:32 UTC (rev 1260565)
@@ -0,0 +1 @@
+u wireguard_exporter - "Prometheus wireguard-exporter user"
More information about the arch-commits
mailing list