From 0d908f56a0d50a292a72f5f8077ae89692a42d73 Mon Sep 17 00:00:00 2001 From: Emile Nijssen Date: Mon, 10 Jan 2022 22:47:45 -0800 Subject: [PATCH] chmod config files --- src/lib/WireGuard.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 271a247..c94fc18 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -99,8 +99,12 @@ AllowedIPs = ${client.address}/32`; } debug('Saving config...'); - await fs.writeFile(path.join(WG_PATH, 'wg0.json'), JSON.stringify(config, false, 2)); - await fs.writeFile(path.join(WG_PATH, 'wg0.conf'), result); + await fs.writeFile(path.join(WG_PATH, 'wg0.json'), JSON.stringify(config, false, 2), { + mode: 0o660, + }); + await fs.writeFile(path.join(WG_PATH, 'wg0.conf'), result, { + mode: 0o600, + }); debug('Config saved.'); }