From: charleswrayjr Date: Tue, 9 Sep 2025 03:15:24 +0000 (-0500) Subject: Cleaning up the revoke client function and starting on the create client function... X-Git-Url: https://git.phasecustomsoft.com/logo192.png?a=commitdiff_plain;h=0907457e480589297420f5b655a65ff6c66e0188;p=phs-api.git Cleaning up the revoke client function and starting on the create client function in the vpn controller. --- diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml index c278014..975388a 100644 --- a/.idea/dictionaries/project.xml +++ b/.idea/dictionaries/project.xml @@ -6,11 +6,14 @@ genkey ifconfig inkey + nobind nopass ovpn passout + phasecustomsoft phsdb pkitool + resolv \ No newline at end of file diff --git a/src/controllers/vpn.controller.js b/src/controllers/vpn.controller.js index 4a4b9bc..e976ed8 100644 --- a/src/controllers/vpn.controller.js +++ b/src/controllers/vpn.controller.js @@ -60,8 +60,9 @@ module.exports = { `cd /etc/openvpn/easy-rsa`, `sudo ./easyrsa --batch build-client-full ${clientName} nopass`, `sudo mkdir -p /etc/openvpn/client-configs`, - staticIp ? `echo "ifconfig-push ${staticIp} 255.255.255.0" | sudo tee /etc/openvpn/client-configs/${clientName}.ccd` : 'true', - `echo "client\ndev tun\nproto tcp\nremote phasecustomsoft.com 1194\nresolv-retry infinite\nnobind\npersist-key\npersist-tun\nremote-cert-tls server\ncipher AES-256-GCM\nauth SHA256\ncompress lz4-v2\nverb 3\n" | sudo tee /etc/openvpn/client-configs/${clientName}.ovpn`, + staticIp ? `echo "ifconfig-push ${staticIp} 255.255.255.0" | sudo tee /etc/openvpn/ccd/${clientName}` : 'true', + `echo "client\ndev tun\nproto tcp\nremote phasecustomsoft.com 1194\nresolv-retry infinite\nnobind\npersist-key\npersist-tun\nremote-cert-tls server\ncipher AES-256-GCM\nauth SHA256\ncompress lz4-v2\nverb 3\n" | sudo tee /etc/openvpn/client-configs/${clientName}.ovpn`, + `echo "" | sudo tee /etc/openvpn/client-configs/${clientName}.ovpn`, `sudo cat pki/ca.crt | sudo tee -a /etc/openvpn/client-configs/${clientName}.ovpn`, `echo "\n" | sudo tee -a /etc/openvpn/client-configs/${clientName}.ovpn`, `sudo cat pki/issued/${clientName}.crt | sudo tee -a /etc/openvpn/client-configs/${clientName}.ovpn`,