diff --git a/.vscode/settings.json b/.vscode/settings.json index a63fd15a..c966f5a5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,9 @@ "editor.tabSize": 2, "editor.useTabStops": false, "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true + "editor.formatOnSave": true, + "vue.format.enable": false, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, } \ No newline at end of file diff --git a/src/app.vue b/src/app.vue index 20b27691..5d365600 100644 --- a/src/app.vue +++ b/src/app.vue @@ -190,7 +190,7 @@ > { }); + await exec('wg-quick down wg0').catch(() => {}); await exec('wg-quick up wg0').catch((err) => { if ( err && @@ -130,8 +130,9 @@ PostDown = ${WG_POST_DOWN} # Client: ${client.name} (${clientId}) [Peer] PublicKey = ${client.publicKey} -${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' - }AllowedIPs = ${client.address}/32`; +${ + client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' +}AllowedIPs = ${client.address}/32`; } debug('Config saving...'); @@ -232,8 +233,9 @@ ${WG_MTU ? `MTU = ${WG_MTU}\n` : ''}\ [Peer] PublicKey = ${config.server.publicKey} -${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' - }AllowedIPs = ${WG_ALLOWED_IPS} +${ + client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' +}AllowedIPs = ${WG_ALLOWED_IPS} PersistentKeepalive = ${WG_PERSISTENT_KEEPALIVE} Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; } @@ -383,7 +385,7 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; // Shutdown wireguard async Shutdown() { - await exec('wg-quick down wg0').catch(() => { }); + await exec('wg-quick down wg0').catch(() => {}); } }