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 () {