move presharedkey to peer section in peer conf

pull/165/head
aptalca 2 years ago
parent d4868914a5
commit 0be99d1153

@ -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}

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

Loading…
Cancel
Save