From f5c2a14bb939d1a65a3bdb4f092771fec5fd56ad Mon Sep 17 00:00:00 2001 From: BrainStone Date: Tue, 11 Oct 2022 00:41:45 +0200 Subject: [PATCH] Hiding private key --- src/.eslintrc.json | 2 +- src/lib/WireGuard.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/.eslintrc.json b/src/.eslintrc.json index 9fc48da5..613dd7d5 100644 --- a/src/.eslintrc.json +++ b/src/.eslintrc.json @@ -8,4 +8,4 @@ "no-shadow": "off", "max-len": "off" } -} \ No newline at end of file +} diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 7886ac91..f4c6b647 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -227,7 +227,9 @@ Endpoint = ${WG_HOST}:${WG_PORT}`; const config = await this.getConfig(); const privateKey = await Util.exec('wg genkey'); - const publicKey = await Util.exec(`echo ${privateKey} | wg pubkey`); + const publicKey = await Util.exec(`echo ${privateKey} | wg pubkey`, { + log: 'echo ***hidden*** | wg pubkey', + }); const preSharedKey = await Util.exec('wg genpsk'); // Calculate next IP