]> PHS Git Server - phs-api.git/commitdiff
Adding available clients to VPN.
authorcharleswrayjr <charleswrayjr@gmail.com>
Tue, 9 Sep 2025 13:59:39 +0000 (08:59 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Tue, 9 Sep 2025 13:59:39 +0000 (08:59 -0500)
src/controllers/vpn.controller.js

index e1321d6b7b7c41fded1fdd55578b3349c98a7960..693054035b9d1a48e71fb8890007b752757f161e 100644 (file)
@@ -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 }` );