diff --git a/README.md b/README.md index 68315ae74f34e415544056abcaf1fca804205221..f247c6e47b456912da8ca8ef1231d1197b1bf696 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,14 @@ Simple Web based configuration generator for [WireGuard](https://wireguard.com). --- -<p align="left"> - <a href="https://goreportcard.com/report/github.com/vx3r/wg-gen-web"><img src="https://goreportcard.com/badge/github.com/vx3r/wg-gen-web" alt="Go Report Card"></a> - <a href="https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/commits/master"><img src="https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/badges/master/pipeline.svg" alt="Gitlab CI / CD"></a> -</p> +[](https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/commits/master) +[](https://goreportcard.com/report/github.com/vx3r/wg-gen-web) + +[](http://www.wtfpl.net/about/) + + + + ## Whay another one ? @@ -96,6 +100,12 @@ while inotifywait -e modify -e create /etc/wireguard; do done ``` +## How to use with existing WireGuard configuration + +After first run Wg Gen Web will create `server.json` in data directory with alla server informations. + +Fill free to modify this file in order to use your existing keys + ## What is out of scope * Generation or application of any `iptables` or `nftables` rules diff --git a/ui/src/views/Home.vue b/ui/src/views/Home.vue index a3a7885a6e2aaeca06b93bc9adb374f7fa135898..b5b611f66bc82b03db368ce5db0b6499995385db 100644 --- a/ui/src/views/Home.vue +++ b/ui/src/views/Home.vue @@ -171,6 +171,7 @@ v-on="on" color="success" v-model="client.enable" + v-on:change="updateClient(client)" /> </template> <span>Enable or disable this client</span> @@ -297,7 +298,7 @@ <v-btn :disabled="!valid" color="success" - @click="updateClient()" + @click="updateClient(clientToEdit)" > Submit </v-btn> @@ -376,6 +377,9 @@ }); }, updateServer () { + // convert int values + this.server.listenPort = parseInt(this.server.listenPort, 10); + this.server.persistentKeepalive = parseInt(this.server.persistentKeepalive, 10); this.$patch('/server', this.server).then((res) => { this.notify('success', "Server successfully updated"); this.getData() @@ -414,9 +418,9 @@ return `${base}/client/${id}/config` } }, - updateClient() { + updateClient(client) { this.dialogEditClient = false; - this.$patch(`/client/${this.clientToEdit.id}`, this.clientToEdit).then((res) => { + this.$patch(`/client/${client.id}`, client).then((res) => { this.notify('success', "Client successfully updated"); this.getData() }).catch((e) => {