Add friendly name for exporter (#15)

* Add friendly name for exporter

* Fix DL3059

* Disable SC2016

* Fix tag in README

* Fix DL3059 again
This commit is contained in:
Pavel Popov 2023-06-30 22:20:49 +07:00 committed by GitHub
parent 7d2009c5b9
commit 55d66ec7f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 2 deletions

View file

@ -6,7 +6,7 @@ on:
- main
paths:
- "Dockerfile"
- "tailscale.sh"
- "entrypoint.sh"
jobs:
auto-tag:

View file

@ -3,8 +3,12 @@ FROM weejewel/wg-easy:7
# hadolint ignore=DL3022,DL3023
COPY --from=mindflavor/prometheus-wireguard-exporter:3.6.4 /usr/local/bin/prometheus_wireguard_exporter /usr/local/bin/
# shellcheck disable=SC2016
RUN apk add -U --no-cache \
wireguard-tools=1.0.20200102-r0
wireguard-tools=1.0.20200102-r0 \
&& sed \
-i '1,/^\[Peer\]/{s//[Peer]\n# friendly_name = ${client.name}\n# (${clientId})/}' \
lib/WireGuard.js
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

32
README.md Normal file
View file

@ -0,0 +1,32 @@
# wg-easy-extended
All-in-one: [wg-easy](https://github.com/wg-easy/wg-easy) + [prometheus-wireguard-exporter](https://github.com/MindFlavor/prometheus_wireguard_exporter)
## Run
<pre>
$ docker run -d \
--name=wg-easy-extended \
-e WG_HOST=<b>🚨YOUR_SERVER_IP</b> \
-e PASSWORD=<b>🚨YOUR_ADMIN_PASSWORD</b> \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
-p 9586:9586/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
--restart unless-stopped \
ghcr.io/tolkonepiu/wg-easy-extended
</pre>
> 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname.
>
> 💡 Replace `YOUR_ADMIN_PASSWORD` with a password to log in on the Web UI.
* Web UI - `http://0.0.0.0:51821`
* Exporter metrics - `http://0.0.0.0:9586/metrics`
> 💡 Your configuration files will be saved in `~/.wg-easy`