From 55d66ec7f0be7d2e68648daf71eafc681becd0b6 Mon Sep 17 00:00:00 2001 From: Pavel Popov Date: Fri, 30 Jun 2023 22:20:49 +0700 Subject: [PATCH] Add friendly name for exporter (#15) * Add friendly name for exporter * Fix DL3059 * Disable SC2016 * Fix tag in README * Fix DL3059 again --- .github/workflows/autotag.yml | 2 +- Dockerfile | 6 +++++- README.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/.github/workflows/autotag.yml b/.github/workflows/autotag.yml index d709b94..c4d62fc 100644 --- a/.github/workflows/autotag.yml +++ b/.github/workflows/autotag.yml @@ -6,7 +6,7 @@ on: - main paths: - "Dockerfile" - - "tailscale.sh" + - "entrypoint.sh" jobs: auto-tag: diff --git a/Dockerfile b/Dockerfile index 2cbb9bb..60d9fa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d38f41 --- /dev/null +++ b/README.md @@ -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 + +
+$ docker run -d \
+  --name=wg-easy-extended \
+  -e WG_HOST=🚨YOUR_SERVER_IP \
+  -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \
+  -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
+
+ +> 💡 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`