]> PHS Git Server - phs-api.git/commitdiff
Cleaning up the revoke client function and starting on the create client function...
authorcharleswrayjr <charleswrayjr@gmail.com>
Tue, 9 Sep 2025 02:37:09 +0000 (21:37 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Tue, 9 Sep 2025 02:37:09 +0000 (21:37 -0500)
src/controllers/vpn.controller.js

index 6b62f14b3860b2febcc406558993da838a226aa4..eab73dde1781c66006040a3344553ef0b91be1d4 100644 (file)
@@ -60,7 +60,8 @@ module.exports = {
         `cd /etc/openvpn/easy-rsa`,
         `sudo ./easyrsa --batch build-client-full ${clientName} nopass`,
         staticIp ? `echo "ifconfig-push ${staticIp} 255.255.255.0" | tee /etc/openvpn/ccd/${clientName}` : 'true',
-        `cp /etc/openvpn/client-template.txt /home/charles/clients/${clientName}.ovpn`,
+        `sudo /home/charles/clients/generate_ovpn.sh ${ clientName }`,
+        /*`cp /etc/openvpn/client-template.txt /home/charles/clients/${clientName}.ovpn`,
         `sed -i "s/CLIENT_NAME/${clientName}/" /home/charles/clients/${clientName}.ovpn`,
         `echo "<ca>" | tee -a /home/charles/clients/${clientName}.ovpn`,
         `sudo cat pki/ca.crt | tee -a /home/charles/clients/${clientName}.ovpn`,
@@ -71,7 +72,7 @@ module.exports = {
         `echo "<key>" | tee -a /home/charles/clients/${clientName}.ovpn`,
         `sudo cat pki/private/${clientName}.key | tee -a /home/charles/clients/${clientName}.ovpn`,
         `echo "</key>" | tee -a /home/charles/clients/${clientName}.ovpn`,
-        `cat /home/charles/clients/${clientName}.ovpn`,
+        `cat /home/charles/clients/${clientName}.ovpn`,*/
       ];
 
       console.log( commands );