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

index fe10bd6c21a309838f92dede49c6d7ffa5c1ab99..c936b9a631bdea24d767e5e1629c66d1b597a565 100644 (file)
@@ -149,7 +149,7 @@ module.exports = {
       const commands = [
         `ls /etc/openvpn/ccd/* 2>/dev/null || true`,
         `ls /etc/openvpn/easy-rsa/pki/issued/*.crt 2>/dev/null || true`,
-        'ls /home/node/clients/* 2>/dev/null || true'
+        'ls /home/charles/clients/* 2>/dev/null || true'
       ];
       conn.exec( commands.join( ' && ' ), ( err, stream ) => {
           if (err) {
@@ -186,13 +186,12 @@ module.exports = {
               const hasCrt = crtFiles.some( crt => crt.includes( `${ clientName }.crt` ) );
               logger.warn(`hasCrt: ${ hasCrt }`);
               const hasOvpn = ovpnFiles.some( ovpn => ovpn.includes( `${ clientName }.ovpn` ) );
-              const ovpnPath = `/home/node/clients/${ clientName }.ovpn`;
+              logger.warn(`hasOvpn: ${ hasOvpn }`);
               clients.push( {
                 clientName,
                 staticIp:staticIpMatch ? staticIpMatch[1] : null,
                 hasCertificate:hasCrt,
-                hasOvpn:hasOvpn,
-                ovpnPath
+                hasOvpn:hasOvpn
               } );
             } catch (error) {
               logger.warn( `Failed to read ${ ccdFile }: ${ error.message }` );