From 0be99d11530f885ee220720e5ca9a5aa345aa293 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Apr 2022 16:10:23 -0400 Subject: [PATCH] move presharedkey to peer section in peer conf --- root/defaults/peer.conf | 2 +- root/etc/cont-init.d/40-confs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/root/defaults/peer.conf b/root/defaults/peer.conf index ec48bbb..cd6e3ae 100644 --- a/root/defaults/peer.conf +++ b/root/defaults/peer.conf @@ -1,11 +1,11 @@ [Interface] Address = ${CLIENT_IP} -PresharedKey = $(cat /config/${PEER_ID}/presharedkey-${PEER_ID}) PrivateKey = $(cat /config/${PEER_ID}/privatekey-${PEER_ID}) ListenPort = 51820 DNS = ${PEERDNS} [Peer] PublicKey = $(cat /config/server/publickey-server) +PresharedKey = $(cat /config/${PEER_ID}/presharedkey-${PEER_ID}) Endpoint = ${SERVERURL}:${SERVERPORT} AllowedIPs = ${ALLOWEDIPS} \ No newline at end of file diff --git a/root/etc/cont-init.d/40-confs b/root/etc/cont-init.d/40-confs index 9736c8f..a3df72d 100644 --- a/root/etc/cont-init.d/40-confs +++ b/root/etc/cont-init.d/40-confs @@ -11,7 +11,7 @@ ln -s /config/wg0.conf /etc/wireguard/wg0.conf cp /defaults/peer.conf /config/templates/peer.conf # add preshared key to user templates (backwards compatibility) if ! grep -q 'PresharedKey' /config/templates/peer.conf; then - sed -i 's|^PrivateKey|PresharedKey = \$\(cat /config/\${PEER_ID}/presharedkey-\${PEER_ID}\)\nPrivateKey|' /config/templates/peer.conf + sed -i 's|^Endpoint|PresharedKey = \$\(cat /config/\${PEER_ID}/presharedkey-\${PEER_ID}\)\nEndpoint|' /config/templates/peer.conf fi generate_confs () {