* Added support for Pre-shared Key.
Modified Create to generate a PSK should that be required.
Included Preshared key in Config/QR if it applies.
Show PSK on EditClient Page.
* Fix formatting on existing code.
* Remove unused err variable
* Use Go embed.FS instead of external tool to embed assets
* remove go-bindata from dockerfiles and bump ci to golang 1.16.x
* remove more go-bindata related stuff
Co-authored-by: Markus Viitamäki <markus.viitamaki@embark-studios.com>
Prevent full reload of wireguard (ReplacePeers: true,) as that can
break active sessions. This is done with the UpdateOnly and Removed
flags to manage peers.
* Set name and label at creation of client. Fixes#48
Changes behaviour of the add button from directly creating an
configuration to directing the user to an "create configuration" view.
If no name is given the default name is used same way as before.
This means that the go backend works with the old frontend as well with the new.
* Follow best practice in writing json.
Also handle err.
* 2 Bug fixes.
1. Fix bug introduced in last commit.
Don't try to json encode data that is already encoded.
2. Honor --max-number-client-config
When the creation moved from Clients.svelte to NewClient.svelte the
check in returned json for errors got lost. Now it is back.
* Add limit in how many configurations each user may have.
If the option max-number-client-config is more than 0 this number is the
maximum number of clients a user can create.
The setting only limits creation. If a user had created more
configurations before this setting is enforced or lowered the user may
user the service as before, just cant create any more configurations.
* Fix spelling and fmt as suggested by @luna-duclos
* Alert user when limit is reached.
When the user tries to create more configurations than are allow an
alert will pop up.
* Change http status as discussed with @freddd
http 400 seems a better fit than 429 as a more generic error.
* Add 'Created' ad an timestamp when the config is created.
* Add field 'Modified' on ClientConfig
This field updates when the user changes name or label on their config.