mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-24 00:24:06 +03:00
Skip PresharedKey generation (#271)
Helpful for those who already have users deployed. Enter `-` in the Preshared Key field at user creation time to skip its creation. The template conf takes care of the rest. Fixes issue #235
This commit is contained in:
parent
99b586f1f7
commit
4b0a0d9061
2 changed files with 5 additions and 2 deletions
|
@ -231,6 +231,9 @@ func NewClient(db store.IStore) echo.HandlerFunc {
|
|||
})
|
||||
}
|
||||
client.PresharedKey = presharedKey.String()
|
||||
} else if client.PresharedKey == "-" {
|
||||
client.PresharedKey = ""
|
||||
log.Infof("skipped PresharedKey generation for user: %v", client.Name)
|
||||
} else {
|
||||
_, err := wgtypes.ParseKey(client.PresharedKey)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue