Compare commits

...

3 commits

Author SHA1 Message Date
02d4b5ab13 fix 2023-10-09 21:27:12 +02:00
d5ccea6fc3 set version persistent 2023-10-09 20:06:18 +02:00
Francesco Cogno
2d82a9c06c
Issue/105 (#106)
* fixed tests

* updated lock
2022-11-21 10:28:17 +01:00
5 changed files with 12 additions and 14 deletions

2
Cargo.lock generated
View file

@ -512,7 +512,7 @@ dependencies = [
[[package]] [[package]]
name = "prometheus_wireguard_exporter" name = "prometheus_wireguard_exporter"
version = "3.6.5" version = "3.6.6"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "prometheus_wireguard_exporter" name = "prometheus_wireguard_exporter"
version = "3.6.5" version = "3.6.6"
authors = ["Francesco Cogno <francesco.cogno@outlook.com>"] authors = ["Francesco Cogno <francesco.cogno@outlook.com>"]
description = "Prometheus WireGuard Exporter" description = "Prometheus WireGuard Exporter"
edition = "2018" edition = "2018"

View file

@ -1,7 +1,7 @@
ARG BUILDPLATFORM=linux/amd64 ARG BUILDPLATFORM=linux/amd64
ARG ALPINE_VERSION=3.14 ARG ALPINE_VERSION=3.14
ARG RUST_VERSION=latest ARG RUST_VERSION=1.69-bullseye
FROM --platform=${BUILDPLATFORM} rust:${RUST_VERSION} AS base FROM --platform=${BUILDPLATFORM} rust:${RUST_VERSION} AS base
WORKDIR /usr/src/prometheus_wireguard_exporter WORKDIR /usr/src/prometheus_wireguard_exporter
@ -129,6 +129,7 @@ RUN adduser prometheus-wireguard-exporter -s /bin/sh -D -u 1000 1000 && \
chmod 0440 /etc/sudoers.d/prometheus-wireguard-exporter chmod 0440 /etc/sudoers.d/prometheus-wireguard-exporter
RUN apk add --update -q --no-cache wireguard-tools-wg sudo RUN apk add --update -q --no-cache wireguard-tools-wg sudo
USER prometheus-wireguard-exporter USER prometheus-wireguard-exporter
#USER root
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/prometheus_wireguard_exporter"] ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/prometheus_wireguard_exporter"]
CMD [ "-a" ] CMD [ "-a" ]
COPY --from=build --chown=prometheus-wireguard-exporter /tmp/binary ./prometheus_wireguard_exporter COPY --from=build --chown=prometheus-wireguard-exporter /tmp/binary ./prometheus_wireguard_exporter

View file

@ -4,11 +4,11 @@
[![Crate](https://img.shields.io/crates/v/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![cratedown](https://img.shields.io/crates/d/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![cratelastdown](https://img.shields.io/crates/dv/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![Crate](https://img.shields.io/crates/v/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![cratedown](https://img.shields.io/crates/d/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter) [![cratelastdown](https://img.shields.io/crates/dv/prometheus_wireguard_exporter.svg)](https://crates.io/crates/prometheus_wireguard_exporter)
[![release](https://img.shields.io/github/release/MindFlavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.5) [![release](https://img.shields.io/github/release/MindFlavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.6)
[![tag](https://img.shields.io/github/tag/mindflavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.5) [![tag](https://img.shields.io/github/tag/mindflavor/prometheus_wireguard_exporter.svg)](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/3.6.6)
[![Rust build](https://github.com/mindflavor/prometheus_wireguard_exporter/workflows/Rust/badge.svg)](https://github.com/mindflavor/prometheus_wireguard_exporter/actions?query=workflow%3ARust) [![Rust build](https://github.com/mindflavor/prometheus_wireguard_exporter/workflows/Rust/badge.svg)](https://github.com/mindflavor/prometheus_wireguard_exporter/actions?query=workflow%3ARust)
[![commitssince](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.5)](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.5) [![commitssince](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.6)](https://img.shields.io/github/commits-since/mindflavor/prometheus_wireguard_exporter/3.6.6)
[![Docker build](https://github.com/MindFlavor/prometheus_wireguard_exporter/actions/workflows/docker.yml/badge.svg)](https://github.com/qdm12/godevcontainer/actions/workflows/docker.yml) [![Docker build](https://github.com/MindFlavor/prometheus_wireguard_exporter/actions/workflows/docker.yml/badge.svg)](https://github.com/qdm12/godevcontainer/actions/workflows/docker.yml)

View file

@ -438,7 +438,7 @@ wg0\tsUsR6xufQQ8Tf0FuyY9tfEeYdhVMeFelr4ZMUrj+B0E=\t(none)\t10.211.123.128:51820\
extract_names_config_files: None, extract_names_config_files: None,
interfaces: None, interfaces: None,
export_remote_ip_and_port: true, export_remote_ip_and_port: true,
export_latest_handshake_delay: true, export_latest_handshake_delay: false,
}; };
let s = a.render_with_names(Some(&pe), &options); let s = a.render_with_names(Some(&pe), &options);
@ -564,8 +564,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
interfaces: HashMap::new(), interfaces: HashMap::new(),
}; };
let mut v = Vec::new(); let v = vec![re];
v.push(re);
wg.interfaces.insert("Pippo".to_owned(), v); wg.interfaces.insert("Pippo".to_owned(), v);
let options = Options { let options = Options {
@ -575,7 +574,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
extract_names_config_files: None, extract_names_config_files: None,
interfaces: None, interfaces: None,
export_remote_ip_and_port: true, export_remote_ip_and_port: true,
export_latest_handshake_delay: true, export_latest_handshake_delay: false,
}; };
let prometheus = wg.render_with_names(None, &options); let prometheus = wg.render_with_names(None, &options);
@ -620,9 +619,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
interfaces: HashMap::new(), interfaces: HashMap::new(),
}; };
let mut v = Vec::new(); let v = vec![re1, re2];
v.push(re1);
v.push(re2);
wg.interfaces.insert("Pippo".to_owned(), v); wg.interfaces.insert("Pippo".to_owned(), v);
let mut pehm = PeerEntryHashMap::new(); let mut pehm = PeerEntryHashMap::new();
@ -642,7 +639,7 @@ wireguard_latest_handshake_seconds{interface=\"wg0\",public_key=\"sUsR6xufQQ8Tf0
extract_names_config_files: None, extract_names_config_files: None,
interfaces: None, interfaces: None,
export_remote_ip_and_port: true, export_remote_ip_and_port: true,
export_latest_handshake_delay: true, export_latest_handshake_delay: false,
}; };
let prometheus = wg.render_with_names(Some(&pehm), &options); let prometheus = wg.render_with_names(Some(&pehm), &options);