From 044bff7e8cf48681b50de074dbda6bf571cb005e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 10 Jan 2024 06:40:46 +0300 Subject: [PATCH] wireguard mostly done... Signed-off-by: Alex A. Naanou --- wireguard/make.sh | 4 +++- wireguard/templates/root/Makefile | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wireguard/make.sh b/wireguard/make.sh index 5ec36ef..60a020e 100755 --- a/wireguard/make.sh +++ b/wireguard/make.sh @@ -35,6 +35,7 @@ LAN_GATE=- REBOOT=${REBOOT:=1} +# Wireguard config... DFL_ENDPOINT=${DFL_ENDPOINT:=$(dig +short ${DOMAIN:-$DFL_DOMAIN} | tail -1)} xread "Wireguard endpoint: " ENDPOINT @@ -42,6 +43,7 @@ DFL_ENDPOINT_PORT=${DFL_ENDPOINT_PORT:=51820} xread "Wireguard endpoint port: " ENDPOINT_PORT CLIENT_IPS=${CLIENT_IPS:-10.42.0.0/16} +ALLOWED_IPS=${ALLOWED_IPS:-0.0.0.0/0,${CLIENT_IPS}} readVars @@ -75,7 +77,7 @@ OPTS_STAGE_2="\ #---------------------------------------------------------------------- echo "# Building config..." -buildAssets ENDPOINT ENDPOINT_PORT DNS CLIENT_IPS +buildAssets ENDPOINT ENDPOINT_PORT DNS CLIENT_IPS ALLOWED_IPS echo "# Creating CT..." pctCreateAlpine $ID "${OPTS_STAGE_1}" "$PASS" diff --git a/wireguard/templates/root/Makefile b/wireguard/templates/root/Makefile index 584469f..5fccdf3 100644 --- a/wireguard/templates/root/Makefile +++ b/wireguard/templates/root/Makefile @@ -11,12 +11,12 @@ SERVER_PUBLIC_KEY := $(SERVER_DIR)/server_id.pub CLIENT_TPL := templates/client.conf CLIENT_DIR := $(SERVER_DIR)/clients/ -CLIENT_IPS ?= ${CLIENT_IPS} -ENDPOINT_PORT ?= ${ENDPOINT_PORT} -ENDPOINT ?= ${ENDPOINT} +ENDPOINT ?= ${ENDPOINT} +ENDPOINT_PORT ?= ${ENDPOINT_PORT} DNS ?= ${DNS} -ALLOWED_IPS ?= 0.0.0.0/0 +CLIENT_IPS ?= ${CLIENT_IPS} +ALLOWED_IPS ?= ${ALLOWED_IPS}