From 7490835cf926283b1365de8069a1946c23365030 Mon Sep 17 00:00:00 2001 From: charleswrayjr Date: Tue, 9 Sep 2025 08:59:39 -0500 Subject: [PATCH] Adding available clients to VPN. --- src/controllers/vpn.controller.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index e1321d6..6930540 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -175,13 +175,18 @@ module.exports = { // Process .ccd files for static IPs for (const ccdFile of ccdFiles) { const clientName = path.basename( ccdFile, '' ); + logger.warn( `Processing ${ ccdFile } with clientName ${ clientName }`); try { const ccdContent = fs.readFileSync( ccdFile, 'utf8' ); + logger.warn( `ccdContent: ${ ccdContent }`); const staticIpMatch = ccdContent.match( /ifconfig-push (\S+)/ ); + logger.warn( `staticIpMatch: ${ staticIpMatch }`); + const hasCrt = crtFiles.some( crt => crt.includes( `${ clientName }.crt` ) ); + logger.warn(`hasCrt: ${ hasCrt }`); clients.push( { clientName, staticIp:staticIpMatch ? staticIpMatch[1] : null, - hasCertificate:crtFiles.some( crt => crt.includes( `${ clientName }.crt` ) ), + hasCertificate:hasCrt, } ); } catch (error) { logger.warn( `Failed to read ${ ccdFile }: ${ error.message }` ); -- 2.43.0