]> PHS Git Server - phs-api.git/commitdiff
Removing debug logging.
authorcharleswrayjr <charleswrayjr@gmail.com>
Mon, 15 Sep 2025 05:02:45 +0000 (00:02 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Mon, 15 Sep 2025 05:02:45 +0000 (00:02 -0500)
app.js
src/controllers/vpn.controller.js

diff --git a/app.js b/app.js
index 0f8f926393557d164c9a7452dc44ffbb6f3f6e8f..fa39c5a7b3a58ccfda6b12fd48881f999c7c964a 100755 (executable)
--- a/app.js
+++ b/app.js
@@ -160,11 +160,6 @@ process.on('unhandledRejection', (err) => {
 app.use( function ( req, res, next ) {
   if (req.url === '/.well-known/appspecific/com.chrome.devtools.json' ) next();
   else {
-    logger.warn(req.originalUrl);
-    logger.warn(req.headers['x-forwarded-for']);
-    logger.warn(req.headers['X-Real-IP']);
-    logger.warn(req.headers['x-real-ip']);
-    logger.warn(req.headers);
     next( createError( 404 ) );
   }
 
index 8655ff9978a3d82001d35340051c5e15aaa3d7cd..8b9117d9f823381eb975f0f67772242e333134ba 100644 (file)
@@ -249,14 +249,10 @@ module.exports = {
     try {
       // Read from the OpenVPN status log to get the client's real IP
       const statusContent = fs.readFileSync('/var/log/openvpn/openvpn-status.log', 'utf8');
-      logger.warn(statusContent);
       let clientIp = null;
-      logger.warn(clientName);
-      logger.warn(duration);
       const clientLine = statusContent.split('\n').find(line =>
         line.startsWith(`${clientName},`) && !line.startsWith('Virtual Address')
       );
-      logger.warn(clientLine);
       if (clientLine) {
         const [, realAddress] = clientLine.split(',');
         clientIp = realAddress.split(':')[0];
@@ -264,23 +260,17 @@ module.exports = {
         return next(new createError(404, `Client ${clientName} not connected`));
       }
 
-      logger.warn(clientIp);
-
       // Disconnect client via management interface
       const client = new net.Socket();
       let connectionAttempted = false;
       client.on('connect', () => {
-        logger.warn('Connected to OpenVPN management interface');
         connectionAttempted = true;
         client.write(`kill ${clientName}\n`);
       });
 
       client.on('data', async (data) => {
         const response = data.toString();
-        logger.warn(response);
         if (!response.includes('ERROR:')) {
-          logger.warn(duration);
-          logger.warn(clientIp);
           if (duration && clientIp) {
             // Add iptables rule to block client IP for duration
             const conn = new Client();