net/wireguard: add psk to peers (#880)

This commit is contained in:
Michael
2018-10-01 19:45:44 +02:00
committed by Franco Fichtner
parent c2f178c730
commit 025fb86196
4 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= wireguard
PLUGIN_VERSION= 0.5
PLUGIN_VERSION= 0.6
PLUGIN_COMMENT= WireGuard VPN service
PLUGIN_DEPENDS= wireguard
PLUGIN_MAINTAINER= m.muenz@gmail.com
@@ -17,6 +17,12 @@
<type>text</type>
<help>Public key of this instance.</help>
</field>
<field>
<id>client.psk</id>
<label>Shared Secret</label>
<type>text</type>
<help>Shared secret (PSK) for this peer.</help>
</field>
<field>
<id>client.tunneladdress</id>
<label>Tunnel Address</label>
@@ -18,6 +18,11 @@
<pubkey type="TextField">
<Required>N</Required>
</pubkey>
<psk type="TextField">
<Required>N</Required>
<mask>/^[a-z0-9\+\=\/]{44}$/i</mask>
<ValidationMessage>Optional base64 string of 44 characters and ending with = like a public key. Allowed characters are 0-9a-zA-Z+/=</ValidationMessage>
</psk>
<tunneladdress type="NetworkField">
<default></default>
<FieldSeparator>,</FieldSeparator>
@@ -20,6 +20,9 @@ Table = off
{% if peerlist2_data != {} and peerlist2_data.enabled == '1' %}
[Peer]
PublicKey = {{ peerlist2_data.pubkey }}
{% if peerlist2_data.psk|default('') != '' %}
PresharedKey = {{ peerlist2_data.psk }}
{% endif %}
AllowedIPs = {{ peerlist2_data.tunneladdress }}
{% if peerlist2_data.serveraddress|default('') != '' %}
Endpoint = {{ peerlist2_data.serveraddress }}:{{ peerlist2_data.serverport }}