mirror of
https://github.com/linuxserver/docker-wireguard.git
synced 2026-02-04 19:17:54 +08:00
move presharedkey to peer section in peer conf
This commit is contained in:
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…
x
Reference in New Issue
Block a user