The specific datastore backend to use can now be set by using
command line options or by using environment variables. The default
datastore backend is still jsondb but mysql can now also be used as a
backend. Environment variables have also been added to control settings
relevant to the database. SQL queries are made by directly accessing the
database/sql API. TLS is also supported.
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Previously the GetAllocatedIPs function used it's own database
connection. It now uses a pointer with the store.IStore interface to
access the DB.
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
PresharedKey is now only set in the server and client config if the key
is set and not null (or empty).
I added this feature because I was importing old config files from
clients that did not have a preshared key set. Clients can be created
without preshared keys when editing db/client/ files manually. If the
field is not set, wireguard-ui creates invalid configs by producing:
PresharedKey =
This patch remvoes this behavior and just skips the preshared key if not
set.
Co-authored-by: Khanh Ngo <k@ndk.name>