wireguard_exporter/Cargo.toml
Maximilian Bosch 9a54a8f424
Strip link-local zone ids from IPv6 socket addrs
This is a fairly ugly hack to temporarily work around the issue #10.
Until now Rust doesn't support so-called zone-ids[1] in link-local IPv6
socket-addresses and has a pending RFC on this topic. As I'm
encountering this issue on one of my machines I decided to work around
this issue (for now) by removing the zone-id from the IPv6 address.

This won't harm any other cases as `regex.replace_all` simply returns
the input if the regex doesn't match:

```
>> extern crate regex;
>> let re = regex::Regex::new(r"^\[(?P<ip>[A-Fa-f0-9:]+)%(.*)\]:(?P<port>[0-9]+)$");
>> let rs = re.replace_all("fairly unrelated stuff", "[$ip]:$port");
>> rs
"fairly unrelated stuff"
```

Please note that (1) this regex isn't RFC-compliant[2] and is just a
heuristic to remove zone-ids that currently break this exporter and
(2) this is something that probably shouldn't be merged as-is. I mainly
pushed this since I needed a workaround for this issue (and others
probably too), but it may be better to wait for proper support from the
language.

[1] https://tools.ietf.org/html/rfc4007#section-11
2019-11-02 19:48:16 +01:00

30 lines
1.1 KiB
TOML

[package]
name = "prometheus_wireguard_exporter"
version = "3.2.0"
authors = ["Francesco Cogno <francesco.cogno@outlook.com>"]
description = "Prometheus WireGuard Exporter"
edition = "2018"
readme = "README.md"
license = "MIT"
repository = "https://github.com/MindFlavor/prometheus_wireguard_exporter"
documentation = "https://github.com/MindFlavor/prometheus_wireguard_exporter"
homepage = "https://github.com/MindFlavor/prometheus_wireguard_exporter"
keywords = ["prometheus", "exporter", "wireguard"]
categories = ["database"]
[dependencies]
log = "0.4.6"
env_logger = "0.6.1"
futures = "0.1.27"
clap = "2.33.0"
serde_json = "1.0.39"
serde = "1.0.91"
serde_derive = "1.0.91"
failure = "0.1.5"
hyper = "0.12.29"
http = "0.1.17"
prometheus_exporter_base = "0.2.0"
regex = "1.3.1"